diff --git a/css/all-app.css b/css/all-app.css index c42f3706eb..ff022b795f 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -3349,9 +3349,6 @@ div.list-row { border-bottom: 1px solid #eee; padding: 5px 0px; } -div.list-row:hover { - background-color: #eef -} div.list-row .label { margin-right: 4px; diff --git a/css/all-web.css b/css/all-web.css index 416e9022e0..146d478211 100644 --- a/css/all-web.css +++ b/css/all-web.css @@ -1720,9 +1720,6 @@ div.list-row { border-bottom: 1px solid #eee; padding: 5px 0px; } -div.list-row:hover { - background-color: #eef -} div.list-row .label { margin-right: 4px; diff --git a/erpnext/knowledge_base/page/kb_common/kb_common.js b/erpnext/knowledge_base/page/kb_common/kb_common.js index 6fb4d38741..23c1ba31fd 100644 --- a/erpnext/knowledge_base/page/kb_common/kb_common.js +++ b/erpnext/knowledge_base/page/kb_common/kb_common.js @@ -78,9 +78,9 @@ EditableText = function(args) { me.$w = $(repl('
\
\ - [edit]\ -
\ -
Formatted as [edit]\ + \ +

Formatted as markdown
\ \ Cancel\ diff --git a/erpnext/knowledge_base/page/question_view/question_view.html b/erpnext/knowledge_base/page/question_view/question_view.html index 521244599e..721e48acd4 100644 --- a/erpnext/knowledge_base/page/question_view/question_view.html +++ b/erpnext/knowledge_base/page/question_view/question_view.html @@ -1,6 +1,6 @@
-
+

diff --git a/erpnext/knowledge_base/page/questions/questions.html b/erpnext/knowledge_base/page/questions/questions.html index 1085b7555a..bec483e09a 100644 --- a/erpnext/knowledge_base/page/questions/questions.html +++ b/erpnext/knowledge_base/page/questions/questions.html @@ -1,7 +1,7 @@
-
+
+
+

A wiki or Q&A for your organization

\ No newline at end of file diff --git a/erpnext/knowledge_base/page/questions/questions.js b/erpnext/knowledge_base/page/questions/questions.js index edb8063cbc..5d2820aeef 100644 --- a/erpnext/knowledge_base/page/questions/questions.js +++ b/erpnext/knowledge_base/page/questions/questions.js @@ -24,7 +24,7 @@ pscript.onload_questions = function(wrapper) { var kb = new KnowledgeBase(body); // sidebar - this.sidebar = new wn.widgets.PageSidebar($(wrapper).find('.layout-side-section').get(0), { + this.sidebar = new wn.widgets.PageSidebar($(wrapper).find('.questions-tags').get(0), { sections: [ { title: 'Top Tags', @@ -113,6 +113,7 @@ function KnowledgeBase(w) { this.list = new wn.ui.Listing({ parent: this.list_area, no_results_message: 'No questions found. Ask a new question!', + appframe: wn.pages.questions.appframe, as_dict: 1, get_query: function() { diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 6dfb628bd2..f0fd801613 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -258,18 +258,21 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) { //------------------------for printing without amount---------- var set_print_hide= function(doc, cdt, cdn){ + var dn_fields = wn.meta.docfield_map['Delivery Note']; + var dn_item_fields = wn.meta.docfield_map['Delivery Note Item']; + if (doc.print_without_amount) { - fields['Delivery Note']['currency'].print_hide = 1; - fields['Delivery Note Item']['export_rate'].print_hide = 1; - fields['Delivery Note Item']['adj_rate'].print_hide = 1; - fields['Delivery Note Item']['ref_rate'].print_hide = 1; - fields['Delivery Note Item']['export_amount'].print_hide = 1; + dn_fields['currency'].print_hide = 1; + dn_item_fields['export_rate'].print_hide = 1; + dn_item_fields['adj_rate'].print_hide = 1; + dn_item_fields['ref_rate'].print_hide = 1; + dn_item_fields['export_amount'].print_hide = 1; } else { - fields['Delivery Note']['currency'].print_hide = 0; - fields['Delivery Note Item']['export_rate'].print_hide = 0; - fields['Delivery Note Item']['adj_rate'].print_hide = 0; - fields['Delivery Note Item']['ref_rate'].print_hide = 0; - fields['Delivery Note Item']['export_amount'].print_hide = 0; + dn_fields['currency'].print_hide = 0; + dn_item_fields['export_rate'].print_hide = 0; + dn_item_fields['adj_rate'].print_hide = 0; + dn_item_fields['ref_rate'].print_hide = 0; + dn_item_fields['export_amount'].print_hide = 0; } } diff --git a/js/all-app.js b/js/all-app.js index fe0efa9162..8c1058bed3 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -193,6 +193,12 @@ $.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_i * lib/js/wn/model.js */ wn.provide('wn.model');wn.model={no_value_type:['Section Break','Column Break','HTML','Table','Button','Image'],new_names:{},with_doctype:function(doctype,callback){if(locals.DocType[doctype]){callback();}else{wn.call({method:'webnotes.widgets.form.load.getdoctype',args:{doctype:doctype},callback:callback});}},with_doc:function(doctype,name,callback){if(!name)name=doctype;if(locals[doctype]&&locals[doctype][name]){callback(name);}else{wn.call({method:'webnotes.widgets.form.load.getdoc',args:{doctype:doctype,name:name},callback:function(r){callback(name,r);}});}},can_delete:function(doctype){if(!doctype)return false;return locals.DocType[doctype].allow_trash&&wn.boot.profile.can_cancel.indexOf(doctype)!=-1;}} +/* + * lib/js/wn/meta.js + */ +wn.provide('wn.meta.docfield_map');wn.provide('wn.meta.docfield_list');wn.provide('wn.meta.doctypes');$.extend(wn.meta,{add_field:function(df){wn.provide('wn.meta.docfield_map.'+df.parent);wn.meta.docfield_map[df.parent][df.fieldname||df.label]=df;if(!wn.meta.docfield_list[df.parent]) +wn.meta.docfield_list[df.parent]=[] +wn.meta.docfield_list[df.parent].push(df);}}); /* * lib/js/wn/misc/tools.js */ @@ -207,6 +213,8 @@ if(!wn.boot.user_info[uid])return def if(!wn.boot.user_info[uid].fullname) wn.boot.user_info[uid].fullname=uid;if(!wn.boot.user_info[uid].image) wn.boot.user_info[uid].image=def.image;return wn.boot.user_info[uid];} +wn.provide('wn.user');$.extend(wn.user,{name:wn.boot.profile.name,has_role:function(rl){if(typeof rl=='string')rl=[rl];for(var i in rl){if(wn.boot.profile.roles.indexOf(rl[i])!=-1) +return true;}}}) wn.session_alive=true;$(document).bind('mousemove',function(){wn.session_alive=true;if(wn.session_alive_timeout) clearTimeout(wn.session_alive_timeout);wn.session_alive_timeout=setTimeout('wn.session_alive=false;',30000);}) /* @@ -243,7 +251,7 @@ throw new SyntaxError('JSON.parse');};}}()); wn.re_route={} wn.route=function(){if(wn.re_route[window.location.hash]){window.location.hash=wn.re_route[window.location.hash];} wn._cur_route=window.location.hash;route=wn.get_route();switch(route[0]){case"List":wn.views.doclistview.show(route[1]);break;case"Form":if(route.length>3){route[2]=route.splice(2).join('/');} -wn.views.formview.show(route[1],route[2]);break;case"Report":wn.views.reportview.show(route[1],route[2]);break;default:wn.views.pageview.show(route[0]);}} +wn.views.formview.show(route[1],route[2]);break;case"Report":wn.views.reportview.show(route[1],route[2]);break;case"Report2":wn.views.reportview2.show(route[1],route[2]);break;default:wn.views.pageview.show(route[0]);}} wn.get_route=function(route){if(!route) route=window.location.hash;if(route.substr(0,1)=='#')route=route.substr(1);if(route.substr(0,1)=='!')route=route.substr(1);return $.map(route.split('/'),function(r){return decodeURIComponent(r);});} wn.set_route=function(){route=$.map(arguments,function(a){return encodeURIComponent(a)}).join('/');window.location.hash=route;wn.app.set_favicon();} @@ -282,7 +290,6 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\ \
\
\ -
\
\ \
\ @@ -304,16 +311,18 @@ args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_l if(this.args) $.extend(args,this.args) if(this.get_args){$.extend(args,this.get_args(opts));} -return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}} -if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i=this.page_length) -this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('
').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length) +return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);this.update_paging(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}} +if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i=this.page_length){this.$w.find('.btn-more').toggle(true);this.start+=this.page_length;}},add_row:function(){return this.$w.find('.result-list').append('
').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}}); +/* + * lib/js/wn/ui/filters.js + */ +wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length) this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field) values.push(f.get_value());}) return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);}) this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname) -return this.filters[i];}}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this,opts);this.doctype=this.flist.doctype;this.fields_by_name={};this.make();this.make_options();this.set_events();},make:function(){this.flist.$w.find('.filter_area').append('
\ - \ +return this.filters[i];}}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this,opts);this.doctype=this.flist.doctype;this.make();this.make_select();this.set_events();},make:function(){this.flist.$w.find('.filter_area').append('
\ + \ \ \ ×\ -
');this.$w=this.flist.$w.find('.list_filter:last-child');this.$select=this.$w.find('.fieldname_select');},make_options:function(){if(this.filter_fields){for(var i in this.filter_fields) -this.add_field_option(this.filter_fields[i])}else{this.render_field_select();}},set_events:function(){var me=this;this.$w.find('.fieldname_select').bind('change',function(){me.set_field(this.value);});this.$w.find('a.close').bind('click',function(){me.$w.css('display','none');var value=me.field.get_value();me.field=null;if(!me.flist.get_filters().length){me.flist.$w.find('.set_filters').toggle(true);me.flist.$w.find('.show_filters').toggle(false);} +
');this.$w=this.flist.$w.find('.list_filter:last-child');},make_select:function(){this.fieldselect=new wn.ui.FieldSelect(this.$w.find('.fieldname_select_area'),this.doctype,this.filter_fields);},set_events:function(){var me=this;this.fieldselect.$select.bind('change',function(){me.set_field(this.value);});this.$w.find('a.close').bind('click',function(){me.$w.css('display','none');var value=me.field.get_value();me.field=null;if(!me.flist.get_filters().length){me.flist.$w.find('.set_filters').toggle(true);me.flist.$w.find('.show_filters').toggle(false);} if(value){me.flist.listobj.run();} me.flist.update_filters();return false;});me.$w.find('.condition').change(function(){if($(this).val()=='in'){me.set_field(me.field.df.fieldname,'Data');if(!me.field.desc_area) -me.field.desc_area=$a(me.field.wrapper,'span','help',null,'values separated by comma');}else{me.set_field(me.field.df.fieldname);}});if(me.fieldname){this.set_values(me.fieldname,me.condition,me.value);}else{me.set_field('name');}},set_values:function(fieldname,condition,value){this.set_field(fieldname);if(condition)this.$w.find('.condition').val(condition).change();if(value)this.field.set_input(value)},render_field_select:function(){var me=this;me.table_fields=[];var std_filters=[{fieldname:'name',fieldtype:'Data',label:'ID',parent:me.doctype},{fieldname:'modified',fieldtype:'Date',label:'Last Modified',parent:me.doctype},{fieldname:'owner',fieldtype:'Data',label:'Created By',parent:me.doctype},{fieldname:'_user_tags',fieldtype:'Data',label:'Tags',parent:me.doctype}];$.each(std_filters.concat(fields_list[me.doctype]),function(i,df){me.add_field_option(df);});$.each(me.table_fields,function(i,table_df){if(table_df.options){$.each(fields_list[table_df.options],function(i,df){me.add_field_option(df);});}})},add_field_option:function(df){var me=this;if(me.doctype&&df.parent==me.doctype){var label=df.label;var table=get_label_doctype(me.doctype);if(df.fieldtype=='Table')me.table_fields.push(df);}else{var label=df.label+' ('+df.parent+')';var table=df.parent;} -if(wn.model.no_value_type.indexOf(df.fieldtype)==-1&&!me.fields_by_name[df.fieldname]){this.$select.append($('
');this.$w=this.flist.$w.find('.list_filter:last-child');},make_select:function(){this.fieldselect=new wn.ui.FieldSelect(this.$w.find('.fieldname_select_area'),this.doctype,this.filter_fields);},set_events:function(){var me=this;this.fieldselect.$select.bind('change',function(){me.set_field(this.value);});this.$w.find('a.close').bind('click',function(){me.$w.css('display','none');var value=me.field.get_value();me.field=null;if(!me.flist.get_filters().length){me.flist.$w.find('.set_filters').toggle(true);me.flist.$w.find('.show_filters').toggle(false);} if(value){me.flist.listobj.run();} me.flist.update_filters();return false;});me.$w.find('.condition').change(function(){if($(this).val()=='in'){me.set_field(me.field.df.fieldname,'Data');if(!me.field.desc_area) -me.field.desc_area=$a(me.field.wrapper,'span','help',null,'values separated by comma');}else{me.set_field(me.field.df.fieldname);}});if(me.fieldname){this.set_values(me.fieldname,me.condition,me.value);}else{me.set_field('name');}},set_values:function(fieldname,condition,value){this.set_field(fieldname);if(condition)this.$w.find('.condition').val(condition).change();if(value)this.field.set_input(value)},render_field_select:function(){var me=this;me.table_fields=[];var std_filters=[{fieldname:'name',fieldtype:'Data',label:'ID',parent:me.doctype},{fieldname:'modified',fieldtype:'Date',label:'Last Modified',parent:me.doctype},{fieldname:'owner',fieldtype:'Data',label:'Created By',parent:me.doctype},{fieldname:'_user_tags',fieldtype:'Data',label:'Tags',parent:me.doctype}];$.each(std_filters.concat(fields_list[me.doctype]),function(i,df){me.add_field_option(df);});$.each(me.table_fields,function(i,table_df){if(table_df.options){$.each(fields_list[table_df.options],function(i,df){me.add_field_option(df);});}})},add_field_option:function(df){var me=this;if(me.doctype&&df.parent==me.doctype){var label=df.label;var table=get_label_doctype(me.doctype);if(df.fieldtype=='Table')me.table_fields.push(df);}else{var label=df.label+' ('+df.parent+')';var table=df.parent;} -if(wn.model.no_value_type.indexOf(df.fieldtype)==-1&&!me.fields_by_name[df.fieldname]){this.$select.append($('
');this.$w=this.flist.$w.find('.list_filter:last-child');this.$select=this.$w.find('.fieldname_select');},make_options:function(){if(this.filter_fields){for(var i in this.filter_fields) -this.add_field_option(this.filter_fields[i])}else{this.render_field_select();}},set_events:function(){var me=this;this.$w.find('.fieldname_select').bind('change',function(){me.set_field(this.value);});this.$w.find('a.close').bind('click',function(){me.$w.css('display','none');var value=me.field.get_value();me.field=null;if(!me.flist.get_filters().length){me.flist.$w.find('.set_filters').toggle(true);me.flist.$w.find('.show_filters').toggle(false);} -if(value){me.flist.listobj.run();} -me.flist.update_filters();return false;});me.$w.find('.condition').change(function(){if($(this).val()=='in'){me.set_field(me.field.df.fieldname,'Data');if(!me.field.desc_area) -me.field.desc_area=$a(me.field.wrapper,'span','help',null,'values separated by comma');}else{me.set_field(me.field.df.fieldname);}});if(me.fieldname){this.set_values(me.fieldname,me.condition,me.value);}else{me.set_field('name');}},set_values:function(fieldname,condition,value){this.set_field(fieldname);if(condition)this.$w.find('.condition').val(condition).change();if(value)this.field.set_input(value)},render_field_select:function(){var me=this;me.table_fields=[];var std_filters=[{fieldname:'name',fieldtype:'Data',label:'ID',parent:me.doctype},{fieldname:'modified',fieldtype:'Date',label:'Last Modified',parent:me.doctype},{fieldname:'owner',fieldtype:'Data',label:'Created By',parent:me.doctype},{fieldname:'_user_tags',fieldtype:'Data',label:'Tags',parent:me.doctype}];$.each(std_filters.concat(fields_list[me.doctype]),function(i,df){me.add_field_option(df);});$.each(me.table_fields,function(i,table_df){if(table_df.options){$.each(fields_list[table_df.options],function(i,df){me.add_field_option(df);});}})},add_field_option:function(df){var me=this;if(me.doctype&&df.parent==me.doctype){var label=df.label;var table=get_label_doctype(me.doctype);if(df.fieldtype=='Table')me.table_fields.push(df);}else{var label=df.label+' ('+df.parent+')';var table=df.parent;} -if(wn.model.no_value_type.indexOf(df.fieldtype)==-1&&!me.fields_by_name[df.fieldname]){this.$select.append($('