diff --git a/css/all-app.css b/css/all-app.css index 37de7731f7..5e74fa2ef8 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -29,7 +29,7 @@ select, input, textarea { border: 1px solid #ccc; -moz-border-radius: 4px; -webkit-border-radius: 4px; - font-size: 13px; + font-size: inherit; padding: 4px; color: #444; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); @@ -41,7 +41,7 @@ textarea { font-family: inherit; height: 120px; width: 90%; - font-size: 12px; + font-size: inherit; white-space: normal; } @@ -104,6 +104,15 @@ div.fix_ff_cursor { overflow: auto; } div.comment { color: #444; } +.small { + font-size: 11px; +} + +.help { + margin: 3px 0px; + color: #888; +} + div#body_div { position: relative; display: none; @@ -185,7 +194,6 @@ div.loading_div { display: none; text-align: center; padding: 2px; - font-size: 12px; border: 1px solid #FF4; } @@ -391,24 +399,6 @@ div.grid_tbarlinks { } -div.frm_tip_box { - margin: 0px; - padding: 8px; - background-color: #FFC; - display: none; - font-size: 11px; - border: 1px solid #FFB; -} - -div.frm_tip_box table { - border-collapse: collapse; - vertical-align: top; -} - -td.frm_tray_area { - width: 122px; -} - div.dialog_frm { position: relative; margin: 10px; @@ -505,12 +495,6 @@ div.time_field select{ .datainputcell { padding: 2px 0px; } -.field_description, .help { - margin: 3px 0px; - font-size: 11px; - color: #888; -} - .help ol { padding-left: 19px; } @@ -519,9 +503,6 @@ div.time_field select{ margin-bottom: 3px; } -.field_label { - font-size:11px; -} .input_area input, select, textarea { font-size: 14px; padding: 2px; @@ -572,7 +553,6 @@ div.sidebar-comment-wrapper input { } div.sidebar-comment-message { margin-top: 8px; - font-size: 11px; color: #777; } @@ -583,7 +563,6 @@ div.sidebar-comment-text { color: #444; } div.sidebar-comment-info { - font-size: 10px; color: #777; } @@ -1103,7 +1082,7 @@ div.psidebar div.section { div.psidebar div.section-head { padding: 5px 11px; - border-bottom: 2px solid #777; + border-bottom: 1px solid #aaa; } div.psidebar div.section-body { @@ -1115,7 +1094,6 @@ div.psidebar div.section-item { } div.psidebar div.section-item, div.psidebar .section-link { - font-size: 11px; color: #666; } @@ -1759,7 +1737,7 @@ div.stat-bar { @font-face { font-family: 'Pontano Sans'; font-style: normal; - font-weight: 400; + font-weight: 800; src: url('../lib/css/fonts/pontanosans.woff') format('woff'); } diff --git a/css/all-web.css b/css/all-web.css index d89dcadc84..03a92e4957 100644 --- a/css/all-web.css +++ b/css/all-web.css @@ -29,7 +29,7 @@ select, input, textarea { border: 1px solid #ccc; -moz-border-radius: 4px; -webkit-border-radius: 4px; - font-size: 13px; + font-size: inherit; padding: 4px; color: #444; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); @@ -41,7 +41,7 @@ textarea { font-family: inherit; height: 120px; width: 90%; - font-size: 12px; + font-size: inherit; white-space: normal; } @@ -104,6 +104,15 @@ div.fix_ff_cursor { overflow: auto; } div.comment { color: #444; } +.small { + font-size: 11px; +} + +.help { + margin: 3px 0px; + color: #888; +} + div#body_div { position: relative; display: none; @@ -185,7 +194,6 @@ div.loading_div { display: none; text-align: center; padding: 2px; - font-size: 12px; border: 1px solid #FF4; } diff --git a/erpnext/accounts/doctype/receivable_voucher/listview.js b/erpnext/accounts/doctype/receivable_voucher/listview.js index 1e43b9255a..d30431ff32 100644 --- a/erpnext/accounts/doctype/receivable_voucher/listview.js +++ b/erpnext/accounts/doctype/receivable_voucher/listview.js @@ -9,36 +9,24 @@ wn.doclistviews['Receivable Voucher'] = wn.views.ListView.extend({ "`tabReceivable Voucher`.currency", "ifnull(`tabReceivable Voucher`.grand_total_export,0) as grand_total_export" ]); - this.stats = this.stats.concat(['status']); }, - render: function(row, data, listobj) { - - // bar color for billed - data.per_paid = flt((data.grand_total - data.outstanding_amount) / data.grand_total * 100, 2) - - data.bar_outer_class = ''; data.bar_inner_class = ''; - if(data.outstanding_amount == 0) data.bar_inner_class = 'bar-complete'; - if(data.per_paid < 1) data.bar_outer_class = 'bar-empty'; - - // lock for docstatus - data.icon = ''; - data.item_color = 'grey'; - if(data.docstatus==0) { - data.customer = '[Draft] ' + data.customer; - } else if(data.docstatus==1) { - data.item_color = 'blue'; - } else if(data.docstatus==2) { - data.item_color = 'red'; - } - - this._super(row, data); - this.$main.html(repl('%(customer)s\ - \ - \ - \ - %(currency)s %(grand_total_export)s\ - ', data)) - } + prepare_data: function(data) { + this._super(data); + data.paid = flt((data.grand_total - data.outstanding_amount) / data.grand_total * 100, 2); + }, + columns: [ + {width: '5%', content:'avatar'}, + {width: '3%', content:'docstatus'}, + {width: '15%', content:'name'}, + {width: '37%', content:'tags+customer', css: {color:'#aaa'}}, + { + width: '18%', + content: function(parent, data) { + $(parent).html(data.currency + ' ' + fmt_money(data.grand_total_export)) + }, + css: {'text-align':'right'} + }, + {width: '10%', content: 'paid', type:'bar-graph', label:'Paid'}, + {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + ] }); diff --git a/erpnext/selling/doctype/sales_order/listview.js b/erpnext/selling/doctype/sales_order/listview.js index 0b458109ba..c0b3895d8a 100644 --- a/erpnext/selling/doctype/sales_order/listview.js +++ b/erpnext/selling/doctype/sales_order/listview.js @@ -11,40 +11,22 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({ ]); this.stats = this.stats.concat(['status']); }, + + columns: [ + {width: '5%', content:'avatar'}, + {width: '3%', content:'docstatus'}, + {width: '15%', content:'name'}, + {width: '37%', content:'tags+customer_name', css: {color:'#aaa'}}, + { + width: '18%', + content: function(parent, data) { + $(parent).html(data.currency + ' ' + fmt_money(data.grand_total_export)) + }, + css: {'text-align':'right'} + }, + {width: '8%', content: 'per_delivered', type:'bar-graph', label:'Delivered'}, + {width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'}, + {width: '10%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + ] - render: function(row, data, listobj) { - - // bar color for billed - data.bar_class_delivered = ''; data.bar_class_billed = ''; - if(data.per_delivered == 100) data.bar_class_delivered = 'bar-complete'; - if(data.per_billed == 100) data.bar_class_billed = 'bar-complete'; - - // lock for docstatus - data.icon = ''; - data.item_color = 'grey'; - if(data.docstatus==0) { - data.customer_name = '[Draft] ' + data.customer_name; - } else if(data.docstatus==1) { - data.icon = ' '; - data.item_color = 'blue'; - } else if(data.docstatus==2) { - data.icon = ' '; - data.item_color = 'red'; - } - - this._super(row, data); - this.$main.html(repl('%(customer_name)s\ - \ - \ - \ - \ - \ - \ - %(currency)s %(grand_total_export)s\ - ', data)) - } }); diff --git a/erpnext/support/DocType Label/Ticket/Ticket.txt b/erpnext/support/DocType Label/Ticket/Ticket.txt deleted file mode 100644 index 8707e8fff4..0000000000 --- a/erpnext/support/DocType Label/Ticket/Ticket.txt +++ /dev/null @@ -1 +0,0 @@ -[{'modified_by': 'Administrator', 'name': 'Ticket', 'parent': None, 'dt_label': 'Task', 'creation': '2010-06-28 12:55:47', 'modified': '2010-06-28 12:55:47', 'module': 'Accounts', 'doctype': 'DocType Label', 'idx': None, 'parenttype': None, 'owner': 'Administrator', 'docstatus': 0, 'dt': 'Ticket', 'parentfield': None}] \ No newline at end of file diff --git a/erpnext/support/Module Def/Support/Support.txt b/erpnext/support/Module Def/Support/Support.txt deleted file mode 100644 index 9c66c3d1c3..0000000000 --- a/erpnext/support/Module Def/Support/Support.txt +++ /dev/null @@ -1,149 +0,0 @@ -# Module Def, Support -[ - - # These values are common in all dictionaries - { - 'creation': '2011-07-01 17:42:15', - 'docstatus': 0, - 'modified': '2011-10-10 16:59:49', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all Module Def Role - { - 'doctype': 'Module Def Role', - 'name': '__common__', - 'parent': 'Support', - 'parentfield': 'roles', - 'parenttype': 'Module Def' - }, - - # These values are common for all Module Def Item - { - 'doctype': 'Module Def Item', - 'name': '__common__', - 'parent': 'Support', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - - # These values are common for all Module Def - { - 'disabled': 'No', - 'doctype': u'Module Def', - 'doctype_list': 'DocType Label, Ticket', - 'is_hidden': 'No', - 'module_desc': 'Manage maintenance quotes, orders, schedule etc.', - 'module_icon': 'Maintenance.gif', - 'module_label': 'Support', - 'module_name': 'Support', - 'module_seq': 8, - 'name': '__common__' - }, - - # Module Def, Support - { - 'doctype': u'Module Def', - 'name': 'Support' - }, - - # Module Def Item - { - 'description': "Database of Support Ticket's raised by Customers", - 'display_name': 'Support Ticket', - 'doc_name': 'Support Ticket', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\nopening_date\ncustomer\nallocated_to' - }, - - # Module Def Item - { - 'description': 'Create schedule based on maintenance order', - 'display_name': 'Maintenance Schedule', - 'doc_name': 'Maintenance Schedule', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\ntransaction_date\ncustomer\nsales_order_no' - }, - - # Module Def Item - { - 'description': 'Database of issues raised your Customers', - 'display_name': 'Customer Issue', - 'doc_name': 'Customer Issue', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\ncomplaint_date\ncustomer\nallocated_to\nallocated_on' - }, - - # Module Def Item - { - 'display_name': 'Maintenance Visit', - 'doc_name': 'Maintenance Visit', - 'doc_type': 'Forms', - 'doctype': 'Module Def Item', - 'fields': 'status\nmntc_date\ncustomer\nmaintenance_type\ncompletion_status' - }, - - # Module Def Item - { - 'description': 'List of all scheduled mainteance. You can filter by sales person, date, serial no etc. ', - 'display_name': 'Maintenance Schedule Details', - 'doc_name': 'Maintenance Schedule Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'description': 'List of all issues raised by customer', - 'display_name': 'Customer Issues', - 'doc_name': 'Customer Issue', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Warranty/AMC Expiry Details', - 'doc_name': 'Serial No', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Warranty/AMC Summary', - 'doc_name': 'Serial No', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Item - { - 'display_name': 'Maintenance Orderwise Pending Amount To Bill', - 'doc_name': 'Sales Order Detail', - 'doc_type': 'Reports', - 'doctype': 'Module Def Item' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Administrator' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Maintenance User' - }, - - # Module Def Role - { - 'doctype': 'Module Def Role', - 'role': 'Maintenance Manager' - } -] \ No newline at end of file diff --git a/erpnext/support/Role/Maintenance Manager/Maintenance Manager.txt b/erpnext/support/Role/Maintenance Manager/Maintenance Manager.txt deleted file mode 100644 index 291a52c844..0000000000 --- a/erpnext/support/Role/Maintenance Manager/Maintenance Manager.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Role, Maintenance Manager -[ - - # These values are common in all dictionaries - { - 'creation': '2010-08-08 17:08:51', - 'docstatus': 0, - 'modified': '2010-07-22 15:19:33', - 'modified_by': 'Administrator', - 'owner': 'ashwini@webnotestech.com' - }, - - # These values are common for all Role - { - 'doctype': 'Role', - 'module': 'Support', - 'name': '__common__', - 'role_name': 'Maintenance Manager' - }, - - # Role, Maintenance Manager - { - 'doctype': 'Role', - 'name': 'Maintenance Manager' - } -] \ No newline at end of file diff --git a/erpnext/support/Role/Maintenance User/Maintenance User.txt b/erpnext/support/Role/Maintenance User/Maintenance User.txt deleted file mode 100644 index c0a9e4e30b..0000000000 --- a/erpnext/support/Role/Maintenance User/Maintenance User.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Role, Maintenance User -[ - - # These values are common in all dictionaries - { - 'creation': '2010-08-08 17:08:51', - 'docstatus': 0, - 'modified': '2010-07-22 15:19:19', - 'modified_by': 'Administrator', - 'owner': 'ashwini@webnotestech.com' - }, - - # These values are common for all Role - { - 'doctype': 'Role', - 'module': 'Support', - 'name': '__common__', - 'role_name': 'Maintenance User' - }, - - # Role, Maintenance User - { - 'doctype': 'Role', - 'name': 'Maintenance User' - } -] \ No newline at end of file diff --git a/erpnext/support/Role/Support Manager/Support Manager.txt b/erpnext/support/Role/Support Manager/Support Manager.txt deleted file mode 100644 index 409280fd99..0000000000 --- a/erpnext/support/Role/Support Manager/Support Manager.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Role, Support Manager -[ - - # These values are common in all dictionaries - { - 'creation': '2010-12-28 17:02:39', - 'docstatus': 0, - 'modified': '2010-12-28 15:17:40', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all Role - { - 'doctype': 'Role', - 'module': 'Support', - 'name': '__common__', - 'role_name': 'Support Manager' - }, - - # Role, Support Manager - { - 'doctype': 'Role', - 'name': 'Support Manager' - } -] \ No newline at end of file diff --git a/erpnext/support/Role/Support Team/Support Team.txt b/erpnext/support/Role/Support Team/Support Team.txt deleted file mode 100644 index f5bcca664a..0000000000 --- a/erpnext/support/Role/Support Team/Support Team.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Role, Support Team -[ - - # These values are common in all dictionaries - { - 'creation': '2010-12-28 17:02:39', - 'docstatus': 0, - 'modified': '2010-12-28 15:19:11', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all Role - { - 'doctype': 'Role', - 'module': 'Support', - 'name': '__common__', - 'role_name': 'Support Team' - }, - - # Role, Support Team - { - 'doctype': 'Role', - 'name': 'Support Team' - } -] \ No newline at end of file diff --git a/erpnext/support/__init__.py b/erpnext/support/__init__.py index e69de29bb2..b94538b23f 100644 --- a/erpnext/support/__init__.py +++ b/erpnext/support/__init__.py @@ -0,0 +1,6 @@ +install_docs = [ + {'doctype':'Role', 'name':'Support Team'}, + {'doctype':'Role', 'name':'Support Manager'}, + {'doctype':'Role', 'name':'Maintenance User'}, + {'doctype':'Role', 'name':'Maintenance Manager'} +] \ No newline at end of file diff --git a/erpnext/support/doctype/support_ticket/listview.js b/erpnext/support/doctype/support_ticket/listview.js new file mode 100644 index 0000000000..91cb448306 --- /dev/null +++ b/erpnext/support/doctype/support_ticket/listview.js @@ -0,0 +1,44 @@ +// render +wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabSupport Ticket`.status", + "`tabSupport Ticket`.subject", + "`tabSupport Ticket`.description" + ]); + this.stats = this.stats.concat(['status']); + }, + + prepare_data: function(data) { + this._super(data); + if(data.status=='Open' || data.status=='To Reply') { + data.label_type = 'important' + } + else if(data.status=='Closed') { + data.label_type = 'success' + } + else if(data.status=='Hold') { + data.label_type = 'info' + } + else if(data.status=='Waiting for Customer') { + data.label_type = 'info' + } + data.status_html = repl('%(status)s', data); + + // description + if(data.description && data.description.length > 30) { + data.description = '' + data.description.substr(0,30) + '...'; + } + }, + + columns: [ + {width: '5%', content:'avatar'}, + {width: '3%', content:'docstatus'}, + {width: '12%', content:'name'}, + {width: '8%', content:'status_html'}, + {width: '62%', content:'tags+subject+description', css: {color:'#aaa'}}, + {width: '10%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + ] + +}); diff --git a/erpnext/website/doctype/style_settings/custom_template.css b/erpnext/website/doctype/style_settings/custom_template.css index 28515bf6a5..72c15a1929 100644 --- a/erpnext/website/doctype/style_settings/custom_template.css +++ b/erpnext/website/doctype/style_settings/custom_template.css @@ -12,6 +12,12 @@ body { {% endif %} } +{% if doc.font_size %} +.small { + font-size: {{ doc.small_font_size }} !important; +} +{% endif %} + {% if doc.footer_font_color %} footer { color: {{ doc.footer_font_color }}; diff --git a/erpnext/website/doctype/style_settings/style_settings.py b/erpnext/website/doctype/style_settings/style_settings.py index 83961e055c..282cd93fd4 100644 --- a/erpnext/website/doctype/style_settings/style_settings.py +++ b/erpnext/website/doctype/style_settings/style_settings.py @@ -25,9 +25,13 @@ class DocType: with open('erpnext/website/doctype/style_settings/custom_template.css', 'r') as f: temp = Template(f.read()) + self.doc.small_font_size = str(int(self.doc.font_size[:-2])-2) + 'px' + self.doc.custom_css = temp.render(doc = self.doc) from webnotes.session_cache import clear_cache clear_cache('Guest') + del self.doc.fields['small_font_size'] + \ No newline at end of file diff --git a/erpnext/website/doctype/style_settings/style_settings.txt b/erpnext/website/doctype/style_settings/style_settings.txt index 134237af5c..18bd24c4a5 100644 --- a/erpnext/website/doctype/style_settings/style_settings.txt +++ b/erpnext/website/doctype/style_settings/style_settings.txt @@ -5,7 +5,7 @@ { 'creation': '2012-02-02 09:57:25', 'docstatus': 0, - 'modified': '2012-03-20 11:25:05', + 'modified': '2012-03-21 10:53:38', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -23,7 +23,7 @@ 'name': '__common__', 'section_style': u'Simple', 'show_in_menu': 0, - 'version': 14 + 'version': 15 }, # These values are common for all DocField @@ -105,7 +105,7 @@ 'fieldname': u'font_size', 'fieldtype': u'Select', 'label': u'Font Size', - 'options': u'\n12px\n13px\n14px', + 'options': u'\n12px\n13px\n14px\n15px\n16px', 'permlevel': 0 }, diff --git a/js/all-app.js b/js/all-app.js index 44e05a0e68..d9068de42c 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -365,11 +365,11 @@ wn.views.DocListView=wn.ui.Listing.extend({init:function(doctype,page){this.doct ',{label:this.label}));},setup:function(){var me=this;me.can_delete=wn.model.can_delete(me.doctype);me.meta=locals.DocType[me.doctype];me.$page.find('.wnlist-area').empty(),me.setup_docstatus_filter();me.setup_listview();me.init_list();me.init_stats();me.add_delete_option();},setup_docstatus_filter:function(){var me=this;this.can_submit=$.map(locals.DocPerm,function(d){if(d.parent==me.meta.name&&d.submit)return 1 else return null;}).length;if(this.can_submit){this.$page.find('.show-docstatus').removeClass('hide');this.$page.find('.show-docstatus input').click(function(){me.run();})}},setup_listview:function(){if(this.meta.__listjs){eval(this.meta.__listjs);this.listview=new wn.doclistviews[this.doctype](this);}else{this.listview=new wn.views.ListView(this);} this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.$page.find('.wnlist-area'),start:0,page_length:20,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:true,columns:this.listview.fields});this.run();},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('\ - Delete',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-check :checked'),function(e){return $(e).data('name');});if(!dl.length) + Delete',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length) return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;} me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(r.message,function(field,stat){me.render_stat(field,stat);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('

Tags

\ -
No records tagged.

\ +
No records tagged.

\ To add a tag, open the document and click on \ "Add Tag" on the sidebar
');} return;} @@ -392,12 +392,18 @@ if(typeof opts.content=='function'){opts.content(parent,data);} else if(opts.content=='name'){$(parent).html(repl('%(name)s',data));} else if(opts.content=='avatar'){$(parent).html(repl('',data));} -else if(opts.content=='check'){$(parent).html('');$(parent).find('input').data('name',data.name);} +else if(opts.content=='check'){$(parent).html('');$(parent).find('input').data('name',data.name);} else if(opts.content=='docstatus'){$(parent).html(repl('',data));} else if(opts.content=='tags'){this.add_user_tags(parent,data);} else if(opts.content=='modified'){$(parent).append(data.when);} -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];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';}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){$.each(data._user_tags.split(','),function(i,t){if(t){$('' +else if(opts.type=='bar-graph'){args={percent:data[opts.content],fully_delivered:(data[opts.content]>99?'bar-complete':''),label:opts.label} +$(parent).html(repl('\ + \ + ',args));} +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];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';}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){$.each(data._user_tags.split(','),function(i,t){if(t){$('' +strip(t)+'').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}}}) /* * lib/js/wn/views/pageview.js @@ -705,7 +711,7 @@ var no_value_fields=['Section Break','Column Break','HTML','Table','FlexTable',' Field.prototype.make_body=function(){var ischk=(this.df.fieldtype=='Check'?1:0);if(this.parent) this.wrapper=$a(this.parent,(this.with_label?'div':'span'));else this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'0px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});} -if(this.with_label){this.label_span=$a(this.label_area,'span','field_label') +if(this.with_label){this.label_span=$a(this.label_area,'span','small') this.label_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 4px'});$dh(this.label_icon);this.label_icon.src='lib/images/icons/error.gif';this.label_icon.title='Mandatory value needs to be entered';this.suggest_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 0px'});$dh(this.suggest_icon);this.suggest_icon.src='lib/images/icons/bullet_arrow_down.png';this.suggest_icon.title='With suggestions';}else{this.label_span=$a(this.label_area,'span','',{marginRight:'4px'}) $dh(this.label_area);} if(!this.input_area){this.input_area=$a(this.wrapper,(this.with_label?'div':'span'));this.disp_area=$a(this.wrapper,(this.with_label?'div':'span'));} @@ -714,9 +720,9 @@ if(this.onmake)this.onmake();} Field.prototype.set_max_width=function(){var no_max=['Code','Text Editor','Text','Table','HTML'] if(this.wrapper&&this.layout_cell&&this.layout_cell.parentNode.cells&&this.layout_cell.parentNode.cells.length==1&&!in_list(no_max,this.df.fieldtype)){$y(this.wrapper,{paddingRight:'50%'});}} Field.prototype.set_label=function(){if(this.with_label&&this.label_area&&this.label!=this.df.label){this.label_span.innerHTML=this.df.label;this.label=this.df.label;}} -Field.prototype.set_description=function(){if(this.df.description){var p=in_list(['Text Editor','Code','Check'],this.df.fieldtype)?this.label_area:this.wrapper;this.desc_area=$a(p,'div','help','',this.df.description) +Field.prototype.set_description=function(){if(this.df.description){var p=in_list(['Text Editor','Code','Check'],this.df.fieldtype)?this.label_area:this.wrapper;this.desc_area=$a(p,'div','help small','',this.df.description) if(in_list(['Text Editor','Code'],this.df.fieldtype)) -$(this.desc_area).addClass('field_description_top');}} +$(this.desc_area).addClass('help small');}} Field.prototype.get_status=function(){if(this.in_filter)this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';} if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') ret='None';if(cint(this.df.hidden)) @@ -843,7 +849,7 @@ this.get_value=function(){return this.input.value;}} var text_dialog;function make_text_dialog(){var d=new Dialog(520,410,'Edit Text');d.make_body([['Text','Enter Text'],['HTML','Description'],['Button','Update']]);d.widgets['Update'].onclick=function(){var t=this.dialog;t.field.set(t.widgets['Enter Text'].value);t.hide();} d.onshow=function(){this.widgets['Enter Text'].style.height='300px';var v=_f.get_value(this.field.doctype,this.field.docname,this.field.df.fieldname);this.widgets['Enter Text'].value=v==null?'':v;this.widgets['Enter Text'].focus();this.widgets['Description'].innerHTML='' if(this.field.df.description) -$a(this.widgets['Description'],'div','field_description','',this.field.df.description);} +$a(this.widgets['Description'],'div','help small','',this.field.df.description);} d.onhide=function(){if(_f.cur_grid_cell) _f.cur_grid_cell.grid.cell_deselect();} text_dialog=d;} @@ -1195,7 +1201,7 @@ this.make_head();for(var i=0;i\
%(label)s\ -
%(description)s
\ +
%(description)s
\
',this.df));this.$expand=$(this.row.main_head).find('.head').click(function(){if($(me.row.main_head).find('h3').length){me.section_collapse();}else{me.section_expand();} return false;});this.collapsible=true;}else{$(this.wrapper).html('
');} this.section_collapse=function(){$(me.row.main_head).find('.head').html(' \ @@ -1806,7 +1812,7 @@ for(var dn in this.images)if(dn!=this.docname)$dh(this.images[dn]);var doc=local $w(img,allow_width+'px');}else{$ds(this.no_img);}} _f.ImageField.prototype.set_disp=function(val){} _f.ImageField.prototype.set=function(val){} -_f.TableField=function(){};_f.TableField.prototype=new Field();_f.TableField.prototype.with_label=0;_f.TableField.prototype.make_body=function(){if(this.perm[this.df.permlevel]&&this.perm[this.df.permlevel][READ]){if(this.df.description){this.desc_area=$a(this.parent,'div','field_description','',this.df.description)} +_f.TableField=function(){};_f.TableField.prototype=new Field();_f.TableField.prototype.with_label=0;_f.TableField.prototype.make_body=function(){if(this.perm[this.df.permlevel]&&this.perm[this.df.permlevel][READ]){if(this.df.description){this.desc_area=$a(this.parent,'div','help small','',this.df.description)} this.grid=new _f.FormGrid(this);if(this.frm)this.frm.grids[this.frm.grids.length]=this;this.grid.make_buttons();}} _f.TableField.prototype.refresh=function(){if(!this.grid)return;var st=this.get_status();if(!this.df['default']) this.df['default']='';this.grid.can_add_rows=false;this.grid.can_edit=false @@ -2078,11 +2084,11 @@ CommentItem.prototype.cmt_delete=function(cell,ri,ci,d){var me=this;if(d[ri][2]= wn.widgets.form.sidebar={Sidebar:function(form){var me=this;this.form=form;this.opts={sections:[{title:'Actions',items:[{type:'link',label:'New',icon:'icon-plus',display:function(){return in_list(profile.can_create,form.doctype)},onclick:function(){new_doc(me.form.doctype)}},{type:'link',label:'List',icon:'icon-list',display:function(){return!me.form.meta.issingle;},onclick:function(){window.location.href="#!List/"+me.form.doctype}},{type:'link',label:'Refresh',icon:'icon-refresh',onclick:function(){me.form.reload_doc()}},{type:'link',label:'Print',display:function(){return!(me.form.doc.__islocal||me.form.meta.allow_print);},icon:'icon-print',onclick:function(){me.form.print_doc()}},{type:'link',label:'Email',display:function(){return!(me.form.doc.__islocal||me.form.meta.allow_email);},icon:'icon-envelope',onclick:function(){me.form.email_doc()}},{type:'link',label:'Copy',display:function(){return in_list(profile.can_create,me.form.doctype)&&!me.form.meta.allow_copy},icon:'icon-file',onclick:function(){me.form.copy_doc()}},{type:'link',label:'Delete',display:function(){return me.form.meta.allow_trash&&cint(me.form.doc.docstatus)!=2&&(!me.form.doc.__islocal)&&me.form.perm[0][CANCEL]},icon:'icon-remove-sign',onclick:function(){me.form.savetrash()}}]},{title:'Assign To',render:function(wrapper){me.form.assign_to=new wn.widgets.form.sidebar.AssignTo(wrapper,me,me.form.doctype,me.form.docname);},display:function(){if(me.form.doc.__local)return false;else return true;}},{title:'Attachments',render:function(wrapper){me.form.attachments=new wn.widgets.form.sidebar.Attachments(wrapper,me,me.form.doctype,me.form.docname);},display:function(){return me.form.meta.allow_attach}},{title:'Comments',render:function(wrapper){new wn.widgets.form.sidebar.Comments(wrapper,me,me.form.doctype,me.form.docname);},display:function(){return!me.form.doc.__islocal}},{title:'Tags',render:function(wrapper){me.form.taglist=new TagList(wrapper,me.form.doc._user_tags?me.form.doc._user_tags.split(','):[],me.form.doctype,me.form.docname,0,function(){});},display:function(){return!me.form.doc.__islocal}},{title:'Users',render:function(wrapper){var doc=cur_frm.doc;var scrub_date=function(d){if(d)t=d.split(' ');else return'';return dateutil.str_to_user(t[0])+' '+t[1];} $(wrapper).html(repl('

Created:
\ \ - %(creation)s

\ + %(creation)s

\

Modified:
\ \ - %(modified)s

',{created_by:wn.user_info(doc.owner).fullname,avatar_created:wn.user_info(doc.owner).image,creation:scrub_date(doc.creation),modified_by:wn.user_info(doc.modified_by).fullname,avatar_modified:wn.user_info(doc.modified_by).image,modified:scrub_date(doc.modified)}));},display:function(){return!me.form.doc.__islocal}},{title:'Help',render:function(wrapper){if(!wn.md2html){wn.require('lib/js/lib/showdown.js');wn.md2html=new Showdown.converter();} -$a(wrapper,'div','help',{},wn.md2html.makeHtml(me.form.meta.description));},display:function(){return me.form.meta.description}}]} + %(modified)s

',{created_by:wn.user_info(doc.owner).fullname,avatar_created:wn.user_info(doc.owner).image,creation:scrub_date(doc.creation),modified_by:wn.user_info(doc.modified_by).fullname,avatar_modified:wn.user_info(doc.modified_by).image,modified:scrub_date(doc.modified)}));},display:function(){return!me.form.doc.__islocal}},{title:'Help',render:function(wrapper){if(!wn.md2html){wn.require('lib/js/lib/showdown.js');wn.md2html=new Showdown.converter();} +$a(wrapper,'div','help small',{},wn.md2html.makeHtml(me.form.meta.description));},display:function(){return me.form.meta.description}}]} this.refresh=function(){var parent=this.form.page_layout.sidebar_area;if(!this.sidebar){this.sidebar=new wn.widgets.PageSidebar(parent,this.opts);}else{this.sidebar.refresh();}}}} /* * lib/js/legacy/wn/widgets/form/comments.js @@ -2090,7 +2096,8 @@ this.refresh=function(){var parent=this.form.page_layout.sidebar_area;if(!this.s wn.widgets.form.sidebar.Comments=function(parent,sidebar,doctype,docname){var me=this;this.sidebar=sidebar;this.doctype=doctype;this.docname=docname;this.refresh=function(){$c('webnotes.widgets.form.comments.get_comments',{dt:me.doctype,dn:me.docname,limit:5},function(r,rt){wn.widgets.form.comments.sync(me.doctype,me.docname,r);me.make_body();});} this.make_body=function(){if(this.wrapper)this.wrapper.innerHTML='';else this.wrapper=$a(parent,'div','sidebar-comment-wrapper');this.input=$a_input(this.wrapper,'text');this.btn=$btn(this.wrapper,'Post',function(){me.add_comment()},{marginLeft:'8px'});this.render_comments()} this.render_comments=function(){var f=wn.widgets.form.comments;var cl=f.comment_list[me.docname] -this.msg=$a(this.wrapper,'div','sidebar-comment-message');if(cl){this.msg.innerHTML=cl.length+' out of '+f.n_comments[me.docname]+' comments';if(f.n_comments[me.docname]>cl.length){this.msg.innerHTML+=' Show all'} +this.msg=$a(this.wrapper,'div','help small');if(cl){this.msg.innerHTML=cl.length+' out of '+f.n_comments[me.docname]+' comments';if(f.n_comments[me.docname]>cl.length){this.msg.innerHTML+=' Show all'} for(var i=0;i',{label:this.label}));},setup:function(){var me=this;me.can_delete=wn.model.can_delete(me.doctype);me.meta=locals.DocType[me.doctype];me.$page.find('.wnlist-area').empty(),me.setup_docstatus_filter();me.setup_listview();me.init_list();me.init_stats();me.add_delete_option();},setup_docstatus_filter:function(){var me=this;this.can_submit=$.map(locals.DocPerm,function(d){if(d.parent==me.meta.name&&d.submit)return 1 else return null;}).length;if(this.can_submit){this.$page.find('.show-docstatus').removeClass('hide');this.$page.find('.show-docstatus input').click(function(){me.run();})}},setup_listview:function(){if(this.meta.__listjs){eval(this.meta.__listjs);this.listview=new wn.doclistviews[this.doctype](this);}else{this.listview=new wn.views.ListView(this);} this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.$page.find('.wnlist-area'),start:0,page_length:20,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:true,columns:this.listview.fields});this.run();},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('\ - Delete',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-check :checked'),function(e){return $(e).data('name');});if(!dl.length) + Delete',function(){me.delete_items();},'.btn-filter')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length) return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;} me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(r.message,function(field,stat){me.render_stat(field,stat);});}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('

Tags

\ -
No records tagged.

\ +
No records tagged.

\ To add a tag, open the document and click on \ "Add Tag" on the sidebar
');} return;} @@ -306,12 +306,18 @@ if(typeof opts.content=='function'){opts.content(parent,data);} else if(opts.content=='name'){$(parent).html(repl('%(name)s',data));} else if(opts.content=='avatar'){$(parent).html(repl('',data));} -else if(opts.content=='check'){$(parent).html('');$(parent).find('input').data('name',data.name);} +else if(opts.content=='check'){$(parent).html('');$(parent).find('input').data('name',data.name);} else if(opts.content=='docstatus'){$(parent).html(repl('',data));} else if(opts.content=='tags'){this.add_user_tags(parent,data);} else if(opts.content=='modified'){$(parent).append(data.when);} -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];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';}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){$.each(data._user_tags.split(','),function(i,t){if(t){$('' +else if(opts.type=='bar-graph'){args={percent:data[opts.content],fully_delivered:(data[opts.content]>99?'bar-complete':''),label:opts.label} +$(parent).html(repl('\ + \ + ',args));} +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];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';}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){$.each(data._user_tags.split(','),function(i,t){if(t){$('' +strip(t)+'').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}}}) /* * lib/js/wn/views/pageview.js @@ -602,7 +608,7 @@ var no_value_fields=['Section Break','Column Break','HTML','Table','FlexTable',' Field.prototype.make_body=function(){var ischk=(this.df.fieldtype=='Check'?1:0);if(this.parent) this.wrapper=$a(this.parent,(this.with_label?'div':'span'));else this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'0px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});} -if(this.with_label){this.label_span=$a(this.label_area,'span','field_label') +if(this.with_label){this.label_span=$a(this.label_area,'span','small') this.label_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 4px'});$dh(this.label_icon);this.label_icon.src='lib/images/icons/error.gif';this.label_icon.title='Mandatory value needs to be entered';this.suggest_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 0px'});$dh(this.suggest_icon);this.suggest_icon.src='lib/images/icons/bullet_arrow_down.png';this.suggest_icon.title='With suggestions';}else{this.label_span=$a(this.label_area,'span','',{marginRight:'4px'}) $dh(this.label_area);} if(!this.input_area){this.input_area=$a(this.wrapper,(this.with_label?'div':'span'));this.disp_area=$a(this.wrapper,(this.with_label?'div':'span'));} @@ -611,9 +617,9 @@ if(this.onmake)this.onmake();} Field.prototype.set_max_width=function(){var no_max=['Code','Text Editor','Text','Table','HTML'] if(this.wrapper&&this.layout_cell&&this.layout_cell.parentNode.cells&&this.layout_cell.parentNode.cells.length==1&&!in_list(no_max,this.df.fieldtype)){$y(this.wrapper,{paddingRight:'50%'});}} Field.prototype.set_label=function(){if(this.with_label&&this.label_area&&this.label!=this.df.label){this.label_span.innerHTML=this.df.label;this.label=this.df.label;}} -Field.prototype.set_description=function(){if(this.df.description){var p=in_list(['Text Editor','Code','Check'],this.df.fieldtype)?this.label_area:this.wrapper;this.desc_area=$a(p,'div','help','',this.df.description) +Field.prototype.set_description=function(){if(this.df.description){var p=in_list(['Text Editor','Code','Check'],this.df.fieldtype)?this.label_area:this.wrapper;this.desc_area=$a(p,'div','help small','',this.df.description) if(in_list(['Text Editor','Code'],this.df.fieldtype)) -$(this.desc_area).addClass('field_description_top');}} +$(this.desc_area).addClass('help small');}} Field.prototype.get_status=function(){if(this.in_filter)this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';} if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') ret='None';if(cint(this.df.hidden)) @@ -740,7 +746,7 @@ this.get_value=function(){return this.input.value;}} var text_dialog;function make_text_dialog(){var d=new Dialog(520,410,'Edit Text');d.make_body([['Text','Enter Text'],['HTML','Description'],['Button','Update']]);d.widgets['Update'].onclick=function(){var t=this.dialog;t.field.set(t.widgets['Enter Text'].value);t.hide();} d.onshow=function(){this.widgets['Enter Text'].style.height='300px';var v=_f.get_value(this.field.doctype,this.field.docname,this.field.df.fieldname);this.widgets['Enter Text'].value=v==null?'':v;this.widgets['Enter Text'].focus();this.widgets['Description'].innerHTML='' if(this.field.df.description) -$a(this.widgets['Description'],'div','field_description','',this.field.df.description);} +$a(this.widgets['Description'],'div','help small','',this.field.df.description);} d.onhide=function(){if(_f.cur_grid_cell) _f.cur_grid_cell.grid.cell_deselect();} text_dialog=d;} diff --git a/version.num b/version.num index c8846577bd..b532769d3d 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -1280 \ No newline at end of file +1291 \ No newline at end of file