diff --git a/css/legacy/body.css b/css/legacy/body.css index c53547c7d5..fcfc582b48 100644 --- a/css/legacy/body.css +++ b/css/legacy/body.css @@ -165,7 +165,7 @@ div.loading_div { } div.std-footer { - margin: 13px 0px; + margin: 13px -15px; border-top: 1px solid #AAA; padding: 13px; } diff --git a/css/legacy/forms.css b/css/legacy/forms.css index 5c90cebf93..f2fb8ea7a8 100644 --- a/css/legacy/forms.css +++ b/css/legacy/forms.css @@ -1,5 +1,12 @@ /* FORMS */ +div.form-title { + /*background-color: #e0eeff;*/ + padding: 5px 11px 15px 11px; + margin: -15px -15px 0px -15px; + border-bottom: 1px solid #eee; +} + div.form-section-head { margin: 11px -15px 3px -15px; border-top: 1px solid #ccc; @@ -9,7 +16,7 @@ div.form-section-head { div.form-layout-row:first-child .form-section-head { border-top: 0px solid #ccc !important; margin-top: 0px; - padding-top: 0px; + padding-top: 15px; } div.form-section-head h3 { diff --git a/js/core.min.js b/js/core.min.js index 67dc804ad3..f175fc7e83 100644 --- a/js/core.min.js +++ b/js/core.min.js @@ -222,10 +222,7 @@ wn.views.add_list_btn=function(parent,doctype){$(parent).append(repl('\ -
\ - \ - ×\ -
\ +
\
\

%(label)s

\
\ @@ -240,7 +237,7 @@ wn.views.DocListView=wn.ui.Listing.extend({init:function(doctype,page){this.doct
\ \
\ - ',{label:this.label}));wn.views.breadcrumbs(this.$page.find('.breadcrumbs-area').get(0),locals.DocType[this.doctype].module);},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 + ',{label:this.label}));this.appframe=new wn.views.AppFrame(this.$page.find('.appframe-area'));wn.views.breadcrumbs($('').appendTo(this.appframe.$titlebar),locals.DocType[this.doctype].module);},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,no_result_message:this.make_no_result(),columns:this.listview.fields});this.run();},make_no_result:function(){return repl('

No %(doctype_label)s found

\ %(description)s\ diff --git a/js/legacy/report.compressed.js b/js/legacy/report.compressed.js index 3f007880b5..d5c4255b73 100644 --- a/js/legacy/report.compressed.js +++ b/js/legacy/report.compressed.js @@ -3,9 +3,9 @@ * lib/js/legacy/widgets/report_builder/report_builder.js */ _r.ReportContainer=function(){if(user=='Guest'){msgprint("Not Allowed");return;} -this.wrapper=$a(wn.container.add_page("Report Builder"),'div','layout-wrapper');var head_div=$a(this.wrapper,'div');this.rb_area=$a(this.wrapper,'div');var me=this;this.rb_dict={};this.page_head=new PageHeader(head_div);$y(this.page_head.wrapper,{marginBottom:'0px'});var run_fn=function(){if(me.cur_rb){me.cur_rb.dt.start_rec=1;me.cur_rb.dt.run();}} -var runbtn=this.page_head.add_button('Run',run_fn,1,'ui-icon-circle-triangle-e',1);if(has_common(['Administrator','System Manager'],user_roles)){var savebtn=this.page_head.add_button('Save',function(){if(me.cur_rb)me.cur_rb.save_criteria();},0,'ui-icon-disk');var fn=function(){if(me.cur_rb){if(!me.cur_rb.current_loaded){msgprint("error:You must save the report before you can set Advanced features");return;} -loaddoc('Search Criteria',me.cur_rb.sc_dict[me.cur_rb.current_loaded]);}};var advancedbtn=this.page_head.add_button('Advanced Settings',fn);} +var page=wn.container.add_page("Report Builder");this.wrapper=$a(page,'div','layout-wrapper',{padding:'0px'});this.appframe=new wn.views.AppFrame(this.wrapper);this.appframe.$titlebar.append('');this.rb_area=$a(this.wrapper,'div','',{padding:'15px'});var me=this;this.rb_dict={};var run_fn=function(){if(me.cur_rb){me.cur_rb.dt.start_rec=1;me.cur_rb.dt.run();}} +var runbtn=this.appframe.add_button('Run',run_fn,'icon-refresh');this.appframe.add_button('Export',function(){me.cur_rb&&me.cur_rb.dt.do_export();},'icon-download-alt');this.appframe.add_button('Print',function(){me.cur_rb&&me.cur_rb.dt.do_print();},'icon-print');this.appframe.add_button('Calc',function(){me.cur_rb&&me.cur_rb.dt.do_calc();},'icon-plus');if(has_common(['Administrator','System Manager'],user_roles)){var savebtn=this.appframe.add_button('Save',function(){if(me.cur_rb)me.cur_rb.save_criteria();});var fn=function(){if(me.cur_rb){if(!me.cur_rb.current_loaded){msgprint("error:You must save the report before you can set Advanced features");return;} +loaddoc('Search Criteria',me.cur_rb.sc_dict[me.cur_rb.current_loaded]);}};var advancedbtn=this.appframe.add_button('Advanced Settings',fn,'icon-cog');} this.set_dt=function(dt,onload){my_onload=function(f){if(!f.forbidden){me.cur_rb=f;me.cur_rb.mytabs.items['Result'].expand();if(onload)onload(f);}} if(me.cur_rb) me.cur_rb.hide();if(me.rb_dict[dt]){me.rb_dict[dt].show(my_onload);}else{me.rb_dict[dt]=new _r.ReportBuilder(me.rb_area,dt,my_onload);}}} @@ -28,7 +28,7 @@ _r.ReportBuilder.prototype.run=function(){this.dt.run();} _r.ReportBuilder.prototype.clear_criteria=function(){this.column_picker.clear();this.column_picker.set_defaults();for(var i=0;i'; // show / hide buttons if(this.frm_head)this.frm_head.refresh(); // add to recent - if(wn.ui.toolbar.recent) wn.ui.toolbar.recent.add(this.doctype, this.docname, 1); + if(wn.ui.toolbar.recent) + wn.ui.toolbar.recent.add(this.doctype, this.docname, 1); } // -------------------------------------------------------------------------------------- diff --git a/js/legacy/widgets/form/form_fields.js b/js/legacy/widgets/form/form_fields.js index 160d729847..f3a912cb10 100644 --- a/js/legacy/widgets/form/form_fields.js +++ b/js/legacy/widgets/form/form_fields.js @@ -83,7 +83,7 @@ _f.SectionBreak.prototype.make_body = function() { if(!this.df.description) this.df.description = ''; $(this.row.main_head).html(repl('
\ -

%(label)s

\ +

%(label)s

\
%(description)s
\
', this.df)); @@ -104,8 +104,8 @@ _f.SectionBreak.prototype.make_body = function() { // expand section this.section_expand = function(no_animation) { $(me.row.main_head).find('.head') - .html('

' - + me.df.label + '

'); + .html('

' + + me.df.label + '

'); if(no_animation) $(me.row.main_body).toggle(true); else diff --git a/js/legacy/widgets/form/form_header.js b/js/legacy/widgets/form/form_header.js index 486e5f4ba3..c84ff9090d 100644 --- a/js/legacy/widgets/form/form_header.js +++ b/js/legacy/widgets/form/form_header.js @@ -30,19 +30,10 @@ _f.FrmHeader = Class.extend({ init: function(parent, frm) { - this.buttons = {}; - this.$w = $('
\ -
\ - \ - \ - ×\ -
\ -
\ -
\ -
').appendTo(parent); - this.$w.find('.close').click(function() { - window.history.back(); - }) + this.appframe = new wn.views.AppFrame(parent) + this.appframe.$titlebar.append('\ + '); + this.$w = this.appframe.$w; }, refresh: function() { // refresh breadcrumbs @@ -72,17 +63,17 @@ _f.FrmHeader = Class.extend({ }, refresh_toolbar: function() { // clear - this.$w.find('.page-app-toolbar').empty(); + this.appframe.clear_buttons(); var p = cur_frm.get_doc_perms(); // Edit if(cur_frm.meta.read_only_onload && !cur_frm.doc.__islocal) { if(!cur_frm.editable) - this.add_button('Edit', function() { + this.appframe.add_button('Edit', function() { cur_frm.edit_doc(); },'icon-pencil'); else - this.add_button('Print View', function() { + this.appframe.add_button('Print View', function() { cur_frm.is_editable[cur_frm.docname] = 0; cur_frm.refresh(); }, 'icon-print' ); } @@ -90,38 +81,28 @@ _f.FrmHeader = Class.extend({ var docstatus = cint(cur_frm.doc.docstatus); // Save if(docstatus==0 && p[WRITE]) { - this.add_button('Save', function() { cur_frm.save('Save');}, ''); - this.buttons['Save'].addClass('btn-info'); + this.appframe.add_button('Save', function() { cur_frm.save('Save');}, ''); + this.appframe.buttons['Save'].addClass('btn-info'); } // Submit if(docstatus==0 && p[SUBMIT] && (!cur_frm.doc.__islocal)) - this.add_button('Submit', function() { cur_frm.savesubmit();}, 'icon-lock'); + this.appframe.add_button('Submit', function() { cur_frm.savesubmit();}, 'icon-lock'); // Update after sumit if(docstatus==1 && p[SUBMIT]) { - this.add_button('Update', function() { cur_frm.savesubmit();}, ''); - if(!cur_frm.doc.__unsaved) this.buttons['Update'].toggle(false); + this.appframe.add_button('Update', function() { cur_frm.savesubmit();}, ''); + if(!cur_frm.doc.__unsaved) this.appframe.buttons['Update'].toggle(false); } // Cancel if(docstatus==1 && p[CANCEL]) - this.add_button('Cancel', function() { cur_frm.savecancel() }, 'icon-remove'); + this.appframe.add_button('Cancel', function() { cur_frm.savecancel() }, 'icon-remove'); // Amend if(docstatus==2 && p[AMEND]) - this.add_button('Amend', function() { cur_frm.amend_doc() }, 'icon-pencil'); + this.appframe.add_button('Amend', function() { cur_frm.amend_doc() }, 'icon-pencil'); }, - add_button: function(label, click, icon) { - args = { label: label, icon:'' }; - if(icon) { - args.icon = ''; - } - this.buttons[label] = $(repl('', args)) - .click(click) - .appendTo(this.$w.find('.page-app-toolbar')); - }, show: function() { }, hide: function() { diff --git a/js/legacy/widgets/report_builder/datatable.js b/js/legacy/widgets/report_builder/datatable.js index a9e6ae560e..f1ba7a8186 100644 --- a/js/legacy/widgets/report_builder/datatable.js +++ b/js/legacy/widgets/report_builder/datatable.js @@ -119,24 +119,6 @@ _r.DataTable.prototype.make_toolbar = function(parent) { var ht = make_table(this.hbar,1,3,'100%',['40%','40%','20%'],{verticalAlign:'middle'}); var div = $a($td(ht,0,0), 'div'); - var make_btn = function(label,icon,onclick,bold) { - var btn = $btn(div,label,onclick); - if(bold)$y(btn,{fontWeight: 'bold'}); - } - - - // refresh btn - make_btn('Refresh','ui-icon-refresh',function() { me.start_rec = 1; me.run();},1); - - // export - make_btn('Export','ui-icon-circle-arrow-e',function() {me.do_export();}); - - // print - make_btn('Print','ui-icon-print',function() {me.do_print();}); - - // print - make_btn('Calc','ui-icon-calculator',function() {me.do_calc();}); - // sort select var t = make_table($td(ht,0,1),1,6,null,[null,null,null,'20px',null,null],{verticalAlign:'middle'}); diff --git a/js/legacy/widgets/report_builder/report_builder.js b/js/legacy/widgets/report_builder/report_builder.js index 4a8b1e47fc..b50b996940 100644 --- a/js/legacy/widgets/report_builder/report_builder.js +++ b/js/legacy/widgets/report_builder/report_builder.js @@ -30,18 +30,15 @@ _r.ReportContainer = function() { msgprint("Not Allowed"); return; } - this.wrapper = $a(wn.container.add_page("Report Builder"), 'div', 'layout-wrapper'); - var head_div = $a(this.wrapper, 'div'); - this.rb_area = $a(this.wrapper, 'div'); + var page = wn.container.add_page("Report Builder"); + this.wrapper = $a(page, 'div', 'layout-wrapper', {padding: '0px'}); + this.appframe = new wn.views.AppFrame(this.wrapper); + this.appframe.$titlebar.append(''); + this.rb_area = $a(this.wrapper, 'div', '', {padding: '15px'}); var me = this; this.rb_dict = {}; - // tool bar - this.page_head = new PageHeader(head_div); - $y(this.page_head.wrapper, {marginBottom:'0px'}); - - // buttons var run_fn = function() { if(me.cur_rb){ @@ -50,13 +47,22 @@ _r.ReportContainer = function() { } } - var runbtn = this.page_head.add_button('Run', run_fn, 1, 'ui-icon-circle-triangle-e', 1); - + var runbtn = this.appframe.add_button('Run', run_fn, 'icon-refresh'); + + // refresh btn + this.appframe.add_button('Export', function() { me.cur_rb && me.cur_rb.dt.do_export(); }, + 'icon-download-alt'); + this.appframe.add_button('Print', function() { me.cur_rb && me.cur_rb.dt.do_print(); }, + 'icon-print'); + this.appframe.add_button('Calc', function() { me.cur_rb && me.cur_rb.dt.do_calc(); }, + 'icon-plus'); + // new if(has_common(['Administrator', 'System Manager'], user_roles)) { // save - var savebtn = this.page_head.add_button('Save', function() {if(me.cur_rb) me.cur_rb.save_criteria(); }, 0, 'ui-icon-disk'); + var savebtn = this.appframe.add_button('Save', + function() {if(me.cur_rb) me.cur_rb.save_criteria(); }); // advanced var fn = function() { @@ -68,7 +74,7 @@ _r.ReportContainer = function() { loaddoc('Search Criteria', me.cur_rb.sc_dict[me.cur_rb.current_loaded]); } }; - var advancedbtn = this.page_head.add_button('Advanced Settings', fn); + var advancedbtn = this.appframe.add_button('Advanced Settings', fn, 'icon-cog'); } // set a type @@ -300,9 +306,9 @@ _r.ReportBuilder.prototype.clear_criteria = function() { // ------------------------------------------------------------------------------------- _r.ReportBuilder.prototype.set_main_title = function(t, t1) { - _r.rb_con.page_head.main_head.innerHTML = t; - _r.rb_con.page_head.sub_head.innerHTML = (t1 ? t1 : ''); - set_title(t); + var title = t + (t1 ? t1 : ''); + _r.rb_con.appframe.$titlebar.find('.report-title').html(title); + set_title(title); } _r.ReportBuilder.prototype.select_column = function(dt, label, value) { diff --git a/js/legacy/wn/page_layout.js b/js/legacy/wn/page_layout.js index c480fd6b8e..7e99d88506 100644 --- a/js/legacy/wn/page_layout.js +++ b/js/legacy/wn/page_layout.js @@ -39,7 +39,7 @@ wn.PageLayout = function(args) { this.main = $a(this.wrapper, 'div', 'layout-main-section'); this.sidebar_area = $a(this.wrapper, 'div', 'layout-side-section'); $a(this.wrapper, 'div', '', {clear:'both'}); - this.toolbar_area = $a(this.main, 'div'); + this.main_head = $a(this.main, 'div', 'form-title'); this.body = $a(this.main, 'div'); this.footer = $a(this.main, 'div'); if(this.heading) { diff --git a/js/wn/views/doclistview.js b/js/wn/views/doclistview.js index d64d9ae4f2..f659927e6a 100644 --- a/js/wn/views/doclistview.js +++ b/js/wn/views/doclistview.js @@ -54,10 +54,7 @@ wn.views.DocListView = wn.ui.Listing.extend({ make_page: function() { var me = this; this.$page.html(repl('
\ -
\ - \ - ×\ -
\ +
\
\

%(label)s

\
\ @@ -74,7 +71,8 @@ wn.views.DocListView = wn.ui.Listing.extend({
\
', {label: this.label})); - wn.views.breadcrumbs(this.$page.find('.breadcrumbs-area').get(0), locals.DocType[this.doctype].module); + this.appframe = new wn.views.AppFrame(this.$page.find('.appframe-area')); + wn.views.breadcrumbs($('').appendTo(this.appframe.$titlebar), locals.DocType[this.doctype].module); }, setup: function() {