From 078867c4110476db0e4dac01937ef8446c77eb07 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 9 May 2012 16:15:51 +0530 Subject: [PATCH] fixes to listview --- .../doctype/journal_voucher/listview.js | 2 +- .../doctype/purchase_invoice/listview.js | 2 +- .../doctype/sales_invoice/listview.js | 2 +- .../buying/doctype/purchase_order/listview.js | 2 +- .../doctype/purchase_request/listview.js | 2 +- erpnext/selling/doctype/lead/listview.js | 2 +- .../selling/doctype/opportunity/listview.js | 2 +- erpnext/selling/doctype/quotation/listview.js | 2 +- .../selling/doctype/sales_order/listview.js | 2 +- .../stock/doctype/delivery_note/listview.js | 2 +- erpnext/stock/doctype/item/listview.js | 2 +- .../doctype/purchase_receipt/listview.js | 2 +- erpnext/stock/doctype/stock_entry/listview.js | 2 +- .../doctype/support_ticket/listview.js | 2 +- public/css/all-app.css | 27 ++++++++----------- public/css/all-web.css | 27 ++++++++----------- public/js/all-app.js | 4 +-- 17 files changed, 38 insertions(+), 48 deletions(-) diff --git a/erpnext/accounts/doctype/journal_voucher/listview.js b/erpnext/accounts/doctype/journal_voucher/listview.js index 5d7f85a7d9..a4965b1ce4 100644 --- a/erpnext/accounts/doctype/journal_voucher/listview.js +++ b/erpnext/accounts/doctype/journal_voucher/listview.js @@ -21,7 +21,7 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({ {width: '3%', content:'docstatus'}, {width: '12%', content:'name'}, {width: '15%', content:'voucher_type'}, - {width: '38%', content:'tags+remark', css: {'color':'#aaa'}}, + {width: '38%', content:'tags+remark', css: {'color':'#222'}}, { width: '18%', content: function(parent, data) { diff --git a/erpnext/accounts/doctype/purchase_invoice/listview.js b/erpnext/accounts/doctype/purchase_invoice/listview.js index da8d2ac341..f431e0356c 100644 --- a/erpnext/accounts/doctype/purchase_invoice/listview.js +++ b/erpnext/accounts/doctype/purchase_invoice/listview.js @@ -23,7 +23,7 @@ wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({ {width: '5%', content: 'avatar'}, {width: '3%', content: 'docstatus'}, {width: '15%', content: 'name'}, - {width: '37%', content: 'tags+supplier_name', css: {color: '#aaa'}}, + {width: '37%', content: 'tags+supplier_name', css: {color: '#222'}}, { width: '18%', content: function(parent, data) { diff --git a/erpnext/accounts/doctype/sales_invoice/listview.js b/erpnext/accounts/doctype/sales_invoice/listview.js index b9f4686212..b792cafee5 100644 --- a/erpnext/accounts/doctype/sales_invoice/listview.js +++ b/erpnext/accounts/doctype/sales_invoice/listview.js @@ -18,7 +18,7 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '37%', content:'tags+customer_name', css: {color:'#aaa'}}, + {width: '37%', content:'tags+customer_name', css: {color:'#222'}}, { width: '18%', content: function(parent, data) { diff --git a/erpnext/buying/doctype/purchase_order/listview.js b/erpnext/buying/doctype/purchase_order/listview.js index 528fe60c9d..c2ae4e22a7 100644 --- a/erpnext/buying/doctype/purchase_order/listview.js +++ b/erpnext/buying/doctype/purchase_order/listview.js @@ -16,7 +16,7 @@ wn.doclistviews['Purchase Order'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '35%', content:'tags+supplier_name', css: {color:'#aaa'}}, + {width: '35%', content:'tags+supplier_name', css: {color:'#222'}}, { width: '18%', content: function(parent, data) { diff --git a/erpnext/buying/doctype/purchase_request/listview.js b/erpnext/buying/doctype/purchase_request/listview.js index 5e35bf103c..e45fc4c340 100644 --- a/erpnext/buying/doctype/purchase_request/listview.js +++ b/erpnext/buying/doctype/purchase_request/listview.js @@ -25,7 +25,7 @@ wn.doclistviews['Purchase Request'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '17%', content:'name'}, - {width: '53%', content:'status_html+tags+remark', css: {'color': '#aaa'}}, + {width: '53%', content:'status_html+tags+remark', css: {'color': '#222'}}, {width: '10%', content: 'per_ordered', type:'bar-graph', label:'Ordered'}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] diff --git a/erpnext/selling/doctype/lead/listview.js b/erpnext/selling/doctype/lead/listview.js index 4751c64e23..c3efc1e3b4 100644 --- a/erpnext/selling/doctype/lead/listview.js +++ b/erpnext/selling/doctype/lead/listview.js @@ -26,7 +26,7 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({ columns: [ {width: '20%', content:'name'}, {width: '12%', content:'status_html'}, - {width: '55%', content:'tags+lead_name', css: {color:'#aaa'}}, + {width: '55%', content:'tags+lead_name', css: {color:'#222'}}, {width: '13%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] }) diff --git a/erpnext/selling/doctype/opportunity/listview.js b/erpnext/selling/doctype/opportunity/listview.js index db7f67c46c..3d2ab205b8 100644 --- a/erpnext/selling/doctype/opportunity/listview.js +++ b/erpnext/selling/doctype/opportunity/listview.js @@ -31,7 +31,7 @@ wn.doclistviews['Opportunity'] = wn.views.ListView.extend({ columns: [ {width: '15%', content:'name'}, {width: '18%', content:'status_html'}, - {width: '55%', content:'tags+enquiry_name', css: {color:'#aaa'}}, + {width: '55%', content:'tags+enquiry_name', css: {color:'#222'}}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] }) diff --git a/erpnext/selling/doctype/quotation/listview.js b/erpnext/selling/doctype/quotation/listview.js index 1489df3479..cb8acb6e58 100644 --- a/erpnext/selling/doctype/quotation/listview.js +++ b/erpnext/selling/doctype/quotation/listview.js @@ -25,7 +25,7 @@ wn.doclistviews['Quotation'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '47%', content:'tags+quotation_name', css: {color:'#aaa'}}, + {width: '47%', content:'tags+quotation_name', css: {color:'#222'}}, { width: '18%', content: function(parent, data) { diff --git a/erpnext/selling/doctype/sales_order/listview.js b/erpnext/selling/doctype/sales_order/listview.js index 3b764d191a..3a910a0900 100644 --- a/erpnext/selling/doctype/sales_order/listview.js +++ b/erpnext/selling/doctype/sales_order/listview.js @@ -16,7 +16,7 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '35%', content:'tags+customer_name', css: {color:'#aaa'}}, + {width: '35%', content:'tags+customer_name', css: {color:'#222'}}, { width: '18%', content: function(parent, data) { diff --git a/erpnext/stock/doctype/delivery_note/listview.js b/erpnext/stock/doctype/delivery_note/listview.js index 0cce341fcf..5b960be135 100644 --- a/erpnext/stock/doctype/delivery_note/listview.js +++ b/erpnext/stock/doctype/delivery_note/listview.js @@ -11,7 +11,7 @@ wn.doclistviews['Delivery Note'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '50%', content:'tags+customer_name', css: {color:'#aaa'}}, + {width: '50%', content:'tags+customer_name', css: {color:'#222'}}, {width: '15%', content:'sales_order_no', type:'link', doctype:'Sales Order'}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] diff --git a/erpnext/stock/doctype/item/listview.js b/erpnext/stock/doctype/item/listview.js index 7f0dbc8ae9..d7096f4df3 100644 --- a/erpnext/stock/doctype/item/listview.js +++ b/erpnext/stock/doctype/item/listview.js @@ -17,7 +17,7 @@ wn.doclistviews['Item'] = wn.views.ListView.extend({ columns: [ {width: '5%', content:'avatar'}, {width: '20%', content:'name'}, - {width: '63%', content:'tags+description', css: {'color': '#aaa'}}, + {width: '63%', content:'tags+description', css: {'color': '#222'}}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] }); diff --git a/erpnext/stock/doctype/purchase_receipt/listview.js b/erpnext/stock/doctype/purchase_receipt/listview.js index 4275b54884..ba2d0e3aff 100644 --- a/erpnext/stock/doctype/purchase_receipt/listview.js +++ b/erpnext/stock/doctype/purchase_receipt/listview.js @@ -11,7 +11,7 @@ wn.doclistviews['Purchase Receipt'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '50%', content:'tags+supplier_name', css: {color:'#aaa'}}, + {width: '50%', content:'tags+supplier_name', css: {color:'#222'}}, {width: '15%', content:'purchase_order_no', type:'link', doctype:'Purchase Order Order'}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] diff --git a/erpnext/stock/doctype/stock_entry/listview.js b/erpnext/stock/doctype/stock_entry/listview.js index 4c52e9e7bb..fb79fb99aa 100644 --- a/erpnext/stock/doctype/stock_entry/listview.js +++ b/erpnext/stock/doctype/stock_entry/listview.js @@ -12,7 +12,7 @@ wn.doclistviews['Stock Entry'] = wn.views.ListView.extend({ {width: '5%', content:'avatar'}, {width: '3%', content:'docstatus'}, {width: '15%', content:'name'}, - {width: '18%', content:'tags+purpose', css: {color:'#aaa'}}, + {width: '18%', content:'tags+purpose', css: {color:'#222'}}, {width: '18%', content:'from_warehouse', template: 'From %(from_warehouse)s'}, {width: '18%', content:'to_warehouse', template: 'To %(to_warehouse)s'}, {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} diff --git a/erpnext/support/doctype/support_ticket/listview.js b/erpnext/support/doctype/support_ticket/listview.js index 944c08fb4f..32f825dccf 100644 --- a/erpnext/support/doctype/support_ticket/listview.js +++ b/erpnext/support/doctype/support_ticket/listview.js @@ -47,7 +47,7 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({ {width: '3%', content:'check'}, {width: '20%', content:'name'}, {width: '10%', content:'status_html'}, - {width: '53%', content:'tags+description', css: {color:'#aaa'}}, + {width: '53%', content:'tags+description', css: {color:'#222'}}, {width: '14%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} ] diff --git a/public/css/all-app.css b/public/css/all-app.css index 3674fb52d6..25dbbe8bfb 100644 --- a/public/css/all-app.css +++ b/public/css/all-app.css @@ -3575,7 +3575,7 @@ div.psidebar div.section-item, div.psidebar .section-link { /* list-row */ div.list-row { - border-bottom: 1px solid #eee; + border-bottom: 1px solid #ddd; padding: 5px 0px; } @@ -3663,15 +3663,11 @@ span.bar-empty { /* stats */ div.stat-wrapper { - margin-bottom: 19px; + margin-bottom: 19px; } div.stat-grid { - border: 2px solid #bbb; - background-color: white; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; + margin-top: 9px; overflow: hidden; } @@ -3686,24 +3682,23 @@ div.stat-label, div.stat-label a { div.stat-item { position: relative; - border-bottom: 1px solid #ddd; -} -div.stat-item:last-child { - border-bottom: 0px solid #ddd; + margin-bottom: 7px; + background-color: #fff; + height: 22px; + border: 2px solid #aaa; + border-radius: 11px; + overflow: hidden; } div.stat-bar { position: absolute; left: 0px; - background-color: #def; + background-color: #DEF9A7; + border-radius: 11px 0px 0px 11px; height: 100%; z-index: 0; } - - - - /* * lib/css/ui/views.css */ diff --git a/public/css/all-web.css b/public/css/all-web.css index 3ba8b73156..f2327f2a1b 100644 --- a/public/css/all-web.css +++ b/public/css/all-web.css @@ -2327,7 +2327,7 @@ div.dialog_row table td textarea { /* list-row */ div.list-row { - border-bottom: 1px solid #eee; + border-bottom: 1px solid #ddd; padding: 5px 0px; } @@ -2415,15 +2415,11 @@ span.bar-empty { /* stats */ div.stat-wrapper { - margin-bottom: 19px; + margin-bottom: 19px; } div.stat-grid { - border: 2px solid #bbb; - background-color: white; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; + margin-top: 9px; overflow: hidden; } @@ -2438,24 +2434,23 @@ div.stat-label, div.stat-label a { div.stat-item { position: relative; - border-bottom: 1px solid #ddd; -} -div.stat-item:last-child { - border-bottom: 0px solid #ddd; + margin-bottom: 7px; + background-color: #fff; + height: 22px; + border: 2px solid #aaa; + border-radius: 11px; + overflow: hidden; } div.stat-bar { position: absolute; left: 0px; - background-color: #def; + background-color: #DEF9A7; + border-radius: 11px 0px 0px 11px; height: 100%; z-index: 0; } - - - - /* * lib/css/ui/views.css */ diff --git a/public/js/all-app.js b/public/js/all-app.js index b59d5b200a..439bd3cdfd 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -991,7 +991,7 @@ args.label=v[0];args.width=flt(v[1])/max*100;args.count=v[1];args.field=field;$i %(label)s \ (%(count)s)\ ',args));this.setup_stat_item_click($item);return $item;},setup_stat_item_click:function($item){var me=this;$item.find('a').click(function(){var fieldname=$(this).attr('data-field');var label=$(this).attr('data-label');me.set_filter(fieldname,label);return false;});},set_filter:function(fieldname,label){var filter=this.filter_list.get_filter(fieldname);if(filter){var v=filter.field.get_value();if(v.indexOf(label)!=-1){return false;}else{if(fieldname=='_user_tags'){this.filter_list.add_filter(fieldname,'like','%'+label);}else{filter.set_values(fieldname,'in',v+', '+label);}}}else{if(fieldname=='_user_tags'){this.filter_list.add_filter(fieldname,'like','%'+label);}else{this.filter_list.add_filter(fieldname,'=',label);}} -this.run();}});wn.views.ListView=Class.extend({init:function(doclistview){this.doclistview=doclistview;this.doctype=doclistview.doctype;var t="`tab"+this.doctype+"`.";this.fields=[t+'name',t+'owner',t+'docstatus',t+'_user_tags',t+'modified'];this.stats=['_user_tags'];this.show_hide_check_column();},columns:[{width:'3%',content:'check'},{width:'4%',content:'avatar'},{width:'3%',content:'docstatus',css:{"text-align":"center"}},{width:'35%',content:'name'},{width:'40%',content:'tags',css:{'color':'#aaa'}},{width:'15%',content:'modified',css:{'text-align':'right','color':'#777'}}],render_column:function(data,parent,opts){var me=this;if(opts.css){$.each(opts.css,function(k,v){$(parent).css(k,v)});} +this.run();}});wn.views.ListView=Class.extend({init:function(doclistview){this.doclistview=doclistview;this.doctype=doclistview.doctype;var t="`tab"+this.doctype+"`.";this.fields=[t+'name',t+'owner',t+'docstatus',t+'_user_tags',t+'modified'];this.stats=['_user_tags'];this.show_hide_check_column();},columns:[{width:'3%',content:'check'},{width:'4%',content:'avatar'},{width:'3%',content:'docstatus',css:{"text-align":"center"}},{width:'35%',content:'name'},{width:'40%',content:'tags',css:{'color':'#aaa'}},{width:'15%',content:'modified',css:{'text-align':'right','color':'#222'}}],render_column:function(data,parent,opts){var me=this;if(opts.css){$.each(opts.css,function(k,v){$(parent).css(k,v)});} if(opts.content.indexOf&&opts.content.indexOf('+')!=-1){$.map(opts.content.split('+'),function(v){me.render_column(data,parent,{content:v});});return;} if(typeof opts.content=='function'){opts.content(parent,data);} else if(opts.content=='name'){$(parent).append(repl('%(name)s',data));} @@ -1011,7 +1011,7 @@ $(parent).append(repl(''+data[opts.content]+'',data));} else if(opts.template){$(parent).append(repl(opts.template,data));} -else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:function(row,data){var me=this;this.prepare_data(data);rowhtml='';$.each(this.columns,function(i,v){rowhtml+=repl('',v);});var tr=$(row).html(''+rowhtml+'
').find('tr').get(0);$.each(this.columns,function(i,v){me.render_column(data,tr.cells[i],v);});},prepare_data:function(data){data.fullname=wn.user_info(data.owner).fullname;data.avatar=wn.user_info(data.owner).image;data.when=dateutil.str_to_user(data.modified).split(' ')[0];var diff=dateutil.get_diff(dateutil.get_today(),data.modified.split(' ')[0]);if(diff==0){data.when='Today'} +else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:function(row,data){var me=this;this.prepare_data(data);rowhtml='';$.each(this.columns,function(i,v){rowhtml+=repl('',v);});var tr=$(row).html(''+rowhtml+'
').find('tr').get(0);$.each(this.columns,function(i,v){me.render_column(data,tr.cells[i],v);});},prepare_data:function(data){data.fullname=wn.user_info(data.owner).fullname;data.avatar=wn.user_info(data.owner).image;data.when=dateutil.str_to_user(data.modified).split(' ')[0];var diff=dateutil.get_diff(dateutil.get_today(),data.modified.split(' ')[0]);if(diff==0){data.when=dateutil.comment_when(data.modified);} if(diff==1){data.when='Yesterday'} if(diff==2){data.when='2 days ago'} if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';data.docstatus_title='Editable';}else if(data.docstatus==1){data.docstatus_icon='icon-lock';data.docstatus_title='Submitted';}else if(data.docstatus==2){data.docstatus_icon='icon-remove';data.docstatus_title='Cancelled';}