fixed tags in list2
This commit is contained in:
parent
f47192c5ce
commit
2438de4c9b
129
css/all-app.css
129
css/all-app.css
@ -122,6 +122,18 @@ header .container {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
div#body_div, header .container, footer {
|
||||
width: 900px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
div#body_div, header .container, footer {
|
||||
width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
div.no_script {
|
||||
display: none;
|
||||
}
|
||||
@ -236,12 +248,14 @@ div.std-footer-item {
|
||||
|
||||
.avatar-small {
|
||||
display: inline-block;
|
||||
min-width: 29px;
|
||||
width: 24px;
|
||||
height: 20px;
|
||||
vertical-align: middle;
|
||||
overflow: hidden;
|
||||
margin: 0px 3px;
|
||||
}
|
||||
.avatar-small img {
|
||||
height: 24px;
|
||||
margin-bottom: -7px;
|
||||
max-width: 24px;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -673,17 +687,7 @@ div.sidebar-comment-info {
|
||||
/*
|
||||
* lib/css/legacy/listing.css
|
||||
*/
|
||||
/* listing 2.0 */
|
||||
|
||||
div.listing-more {
|
||||
margin: 7px 0px 17px 0px;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.listing-toolbar {
|
||||
margin: 7px 0px;
|
||||
}
|
||||
|
||||
/* SRS */
|
||||
|
||||
@ -727,47 +731,6 @@ div.srs_filter_area td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
/* stats */
|
||||
|
||||
div.stat-grid {
|
||||
border: 2px solid #bbb;
|
||||
background-color: white;
|
||||
margin-bottom: 19px;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.stat-label {
|
||||
position: relative;
|
||||
padding: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
div.stat-label, div.stat-label a {
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
div.stat-item {
|
||||
position: relative;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
div.stat-item:last-child {
|
||||
border-bottom: 0px solid #ddd;
|
||||
}
|
||||
|
||||
div.stat-bar {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
background-color: #def;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* lib/css/legacy/report.css
|
||||
*/
|
||||
@ -1631,13 +1594,21 @@ div.psidebar div.section-item, div.psidebar .section-link {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
/* list-row */
|
||||
div.list-row {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding: 3px 0px;
|
||||
padding: 5px 0px;
|
||||
}
|
||||
div.list-row:hover {
|
||||
background-color: #eef
|
||||
}
|
||||
div.list-row .label {
|
||||
margin-left: 3px;
|
||||
}
|
||||
div.list-row .main {
|
||||
margin-left: 4px;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
div.paging-button {
|
||||
text-align: center;
|
||||
@ -1674,6 +1645,8 @@ div.list_filter input, div.list_filter select {
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
/* bar */
|
||||
|
||||
span.bar-outer {
|
||||
display: inline-block;
|
||||
margin: 0px 7px;
|
||||
@ -1694,6 +1667,50 @@ span.bar-complete {
|
||||
}
|
||||
|
||||
|
||||
/* stats */
|
||||
|
||||
div.stat-wrapper {
|
||||
margin-bottom: 19px;
|
||||
}
|
||||
|
||||
div.stat-grid {
|
||||
border: 2px solid #bbb;
|
||||
background-color: white;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.stat-label {
|
||||
position: relative;
|
||||
padding: 3px;
|
||||
text-align: center;
|
||||
}
|
||||
div.stat-label, div.stat-label a {
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
div.stat-item {
|
||||
position: relative;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
div.stat-item:last-child {
|
||||
border-bottom: 0px solid #ddd;
|
||||
}
|
||||
|
||||
div.stat-bar {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
background-color: #def;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* lib/css/bootstrap/headings.css
|
||||
*/
|
||||
|
@ -122,6 +122,18 @@ header .container {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
div#body_div, header .container, footer {
|
||||
width: 900px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
div#body_div, header .container, footer {
|
||||
width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
div.no_script {
|
||||
display: none;
|
||||
}
|
||||
@ -236,12 +248,14 @@ div.std-footer-item {
|
||||
|
||||
.avatar-small {
|
||||
display: inline-block;
|
||||
min-width: 29px;
|
||||
width: 24px;
|
||||
height: 20px;
|
||||
vertical-align: middle;
|
||||
overflow: hidden;
|
||||
margin: 0px 3px;
|
||||
}
|
||||
.avatar-small img {
|
||||
height: 24px;
|
||||
margin-bottom: -7px;
|
||||
max-width: 24px;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,6 +1,6 @@
|
||||
wn.doclistviews['Journal Voucher'] = wn.pages.ListView.extend({
|
||||
init: function(doctype) {
|
||||
this._super(doctype);
|
||||
init: function(d) {
|
||||
this._super(d);
|
||||
this.fields = this.fields.concat([
|
||||
'`tabJournal Voucher`.voucher_type'
|
||||
]);
|
||||
|
@ -1,7 +1,7 @@
|
||||
// render
|
||||
wn.doclistviews['Sales Order'] = wn.pages.ListView.extend({
|
||||
init: function(doctype) {
|
||||
this._super(doctype)
|
||||
init: function(d) {
|
||||
this._super(d)
|
||||
this.fields = this.fields.concat([
|
||||
"`tabSales Order`.customer_name",
|
||||
"ifnull(`tabSales Order`.per_delivered,0) as per_delivered",
|
||||
@ -9,6 +9,7 @@ wn.doclistviews['Sales Order'] = wn.pages.ListView.extend({
|
||||
"`tabSales Order`.currency",
|
||||
"ifnull(`tabSales Order`.grand_total_export,0) as grand_total_export"
|
||||
]);
|
||||
this.stats = this.stats.concat(['status']);
|
||||
},
|
||||
render: function(row, data, listobj) {
|
||||
|
||||
|
@ -255,7 +255,8 @@ if(r.server_messages)msgprint(r.server_messages)
|
||||
if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);}
|
||||
wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});msgprint('Unable to complete request: '+textStatus)
|
||||
if(opts.error)opts.error(xhr)}})}
|
||||
wn.call=function(opts){var args=opts.args||{};if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
|
||||
wn.call=function(opts){var args=$.extend({},opts.args)
|
||||
if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
|
||||
for(key in args){if(args[key]&&typeof args[key]!='string'){args[key]=JSON.stringify(args[key]);}}
|
||||
wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,freeze:opts.freeze,show_spinner:!opts.no_spinner});}
|
||||
/*
|
||||
|
@ -169,7 +169,8 @@ if(r.server_messages)msgprint(r.server_messages)
|
||||
if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);}
|
||||
wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});msgprint('Unable to complete request: '+textStatus)
|
||||
if(opts.error)opts.error(xhr)}})}
|
||||
wn.call=function(opts){var args=opts.args||{};if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
|
||||
wn.call=function(opts){var args=$.extend({},opts.args)
|
||||
if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
|
||||
for(key in args){if(args[key]&&typeof args[key]!='string'){args[key]=JSON.stringify(args[key]);}}
|
||||
wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,freeze:opts.freeze,show_spinner:!opts.no_spinner});}
|
||||
/*
|
||||
@ -685,7 +686,18 @@ if(!this.opts.no_result_message){this.opts.no_result_message='Nothing to show'}}
|
||||
this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
||||
<div class="wnlist">\
|
||||
<h3 class="title hide">%(title)s</h3>\
|
||||
<div style="height: 37px;" class="list-toolbar-wrapper">\
|
||||
\
|
||||
<div class="list-filters hide">\
|
||||
<div class="show_filters well">\
|
||||
<div>\
|
||||
<button class="btn btn-small add-filter-btn">\
|
||||
<i class="icon-plus"></i> Add Filter</button>\
|
||||
</div>\
|
||||
<div class="filter_area"></div>\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div style="height: 37px; margin-bottom:9px" class="list-toolbar-wrapper">\
|
||||
<div class="list-toolbar">\
|
||||
<a class="btn btn-small btn-refresh btn-info">\
|
||||
<i class="icon-refresh icon-white"></i> Refresh</a>\
|
||||
@ -698,16 +710,6 @@ this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
|
||||
class="img-load" style="float: left;"/>\
|
||||
</div><div style="clear:both"></div>\
|
||||
\
|
||||
<div class="list-filters hide">\
|
||||
<div class="show_filters well">\
|
||||
<div class="filter_area"></div>\
|
||||
<div>\
|
||||
<button class="btn btn-small add-filter-btn">\
|
||||
<i class="icon-plus"></i> Add Filter</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div class="no-result help hide">\
|
||||
%(no_result_message)s\
|
||||
</div>\
|
||||
@ -737,11 +739,12 @@ if(this.get_args){$.extend(args,this.get_args());}
|
||||
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<m;i++){this.render_row(this.add_row(),values[i],this,i);}
|
||||
this.start+=m;if(values.length>=this.page_length)
|
||||
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').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){$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
|
||||
this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').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.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
|
||||
me.add_filter();});this.$w.find('.add-filter-btn').bind('click',function(){me.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;}});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('<div class="list_filter">\
|
||||
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('<div class="list_filter">\
|
||||
<select class="fieldname_select"></select>\
|
||||
<select class="condition">\
|
||||
<option value="=">Equals</option>\
|
||||
@ -758,11 +761,14 @@ this.filters=fl;}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this
|
||||
</div>');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(!me.field.desc_area){me.field.desc_area=$a(me.field.wrapper,'span','help');}
|
||||
me.field.desc_area.innerHTML='';if($(this).val()=='in'){me.field.desc_area.innerHTML='Multiple values, separated by a comma'}});if(me.fieldname){me.set_field(me.fieldname);if(me.condition)me.$w.find('.condition').val(me.condition).change();if(me.value)me.field.set_input(me.value)}else{me.set_field('name');}},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($('<option>',{value:df.fieldname,table:table}).text(label));me.fields_by_name[df.fieldname]=df;}},set_field:function(fieldname){var me=this;me.$w.find('.fieldname_select').val(fieldname);wn.require('lib/js/legacy/widgets/form/fields.js');var field_area=me.$w.find('.filter_field').empty().get(0);var df=me.fields_by_name[fieldname];df.original_type=df.fieldtype;df.description='';df.reqd=0;if(df.fieldtype=='Check'){df.fieldtype='Select';df.options='No\nYes';}else if(['Text','Text Editor','Code','Link'].indexOf(df.fieldtype)!=-1){df.fieldtype='Data';}
|
||||
f=make_field(me.fields_by_name[fieldname],null,field_area,null,0,1);f.df.single_select=1;f.not_in_form=1;f.with_label=0;f.refresh();me.field=f;if(df.fieldtype=='Data'){me.$w.find('.condition').val('like');}else{me.$w.find('.condition').val('=');}
|
||||
$(me.field.wrapper).find(':input').keydown(function(ev){if(ev.which==13){me.flist.listobj.run();}})},get_value:function(){var me=this;var val=me.field.get_value();var cond=me.$w.find('.condition').val();if(me.field.df.original_type=='Check'){val=(val=='Yes'?1:0);}
|
||||
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($('<option>',{value:df.fieldname,table:table}).text(label));me.fields_by_name[df.fieldname]=df;}},set_field:function(fieldname,fieldtype){var me=this;var cur=me.field?{fieldname:me.field.df.fieldname,fieldtype:me.field.df.fieldtype}:{}
|
||||
var df=me.fields_by_name[fieldname];this.set_fieldtype(df,fieldtype);if(me.field&&cur.fieldname==fieldname&&df.fieldtype==cur.fieldtype){return;}
|
||||
me.$w.find('.fieldname_select').val(fieldname);var field_area=me.$w.find('.filter_field').empty().get(0);f=make_field(df,null,field_area,null,0,1);f.df.single_select=1;f.not_in_form=1;f.with_label=0;f.refresh();me.field=f;this.set_default_condition(df,fieldtype);$(me.field.wrapper).find(':input').keydown(function(ev){if(ev.which==13){me.flist.listobj.run();}})},set_fieldtype:function(df,fieldtype){if(df.original_type)
|
||||
df.fieldtype=df.original_type;else
|
||||
df.original_type=df.fieldtype;df.description='';df.reqd=0;if(fieldtype){df.fieldtype=fieldtype;return;}
|
||||
if(df.fieldtype=='Check'){df.fieldtype='Select';df.options='No\nYes';}else if(['Text','Text Editor','Code','Link'].indexOf(df.fieldtype)!=-1){df.fieldtype='Data';}},set_default_condition:function(df,fieldtype){if(!fieldtype){if(df.fieldtype=='Data'){this.$w.find('.condition').val('like');}else{this.$w.find('.condition').val('=');}}},get_value:function(){var me=this;var val=me.field.get_value();var cond=me.$w.find('.condition').val();if(me.field.df.original_type=='Check'){val=(val=='Yes'?1:0);}
|
||||
if(cond=='like'){val=val+'%';}
|
||||
return[me.$w.find('.fieldname_select option:selected').attr('table'),me.field.df.fieldname,me.$w.find('.condition').val(),val];}});
|
||||
/*
|
||||
|
@ -1 +1 @@
|
||||
1049
|
||||
1066
|
Loading…
x
Reference in New Issue
Block a user