diff --git a/css/legacy/body.css b/css/legacy/body.css index 4868662a1e..594628fa62 100644 --- a/css/legacy/body.css +++ b/css/legacy/body.css @@ -231,10 +231,15 @@ div.std-footer-item { padding: 15px; } +.layout-wrapper-background { + background-color: #f2f2f2 !important; + padding: 0px; +} + .layout-main-section { width: 68%; float: left; - padding: 13px; + padding: 15px; background-color: #FFF; min-height: 450px; } @@ -242,10 +247,9 @@ div.std-footer-item { .layout-side-section { width: 24%; float: right; - margin-right: 15px; color: #606060; overflow-x: hidden; - padding: 13px; + padding: 15px; min-height: 450px; } diff --git a/css/legacy/sidebar.css b/css/legacy/sidebar.css index c740975d20..d9778e7a55 100644 --- a/css/legacy/sidebar.css +++ b/css/legacy/sidebar.css @@ -1,40 +1,33 @@ -div.psidebar-wrapper { - margin: 0px 8px; +div.psidebar { } -div.psidebar-head { +div.psidebar div.head { font-size: 14px; font-weight: bold; color: #555; margin-bottom: 12px; } -div.psidebar-section { +div.psidebar div.section { margin-bottom: 11px; overflow: hidden; } -div.psidebar-section-head { +div.psidebar div.section-head { font-size: 12px; padding: 5px 11px; border-bottom: 2px solid #444; } -div.psidebar-section-body { +div.psidebar div.section-body { margin: 7px 11px 11px 11px; } -div.psidebar-section-item { +div.psidebar div.section-item { margin-bottom: 7px; } -.psidebar-section-link { +div.psidebar .section-link { font-size: 11px; color: #666; -} - -div.follower-list { - color: #666; - margin-top: 7px; - font-size: 11px; } \ No newline at end of file diff --git a/js/legacy/wn/page_layout.js b/js/legacy/wn/page_layout.js index 8e6b898152..bd252d7c2a 100644 --- a/js/legacy/wn/page_layout.js +++ b/js/legacy/wn/page_layout.js @@ -10,11 +10,9 @@ */ -wn.sidebar_background = '#f2f2f2'; wn.PageLayout = function(args) { $.extend(this, args) - this.wrapper = $a(this.parent, 'div', 'layout-wrapper', - {backgroundColor: wn.sidebar_background, padding: '0px'}); + this.wrapper = $a(this.parent, 'div', 'layout-wrapper layout-wrapper-background'); 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'}); diff --git a/js/legacy/wn/widgets/page_sidebar.js b/js/legacy/wn/widgets/page_sidebar.js index 770a680977..5daa8c65c4 100644 --- a/js/legacy/wn/widgets/page_sidebar.js +++ b/js/legacy/wn/widgets/page_sidebar.js @@ -14,7 +14,7 @@ wn.widgets.PageSidebar = function(parent, opts) { this.opts = opts this.sections = {} - this.wrapper = $a(parent, 'div', 'psidebar-wrapper') + this.wrapper = $a(parent, 'div', 'psidebar') // refresh sidebar - make head and sections this.refresh = function() { @@ -34,7 +34,7 @@ wn.widgets.PageSidebar = function(parent, opts) { } this.make_head = function() { - this.head = $a(this.wrapper, 'div', 'psidebar-head', '', this.opts.title); + this.head = $a(this.wrapper, 'div', 'head', '', this.opts.title); } this.refresh(); @@ -46,9 +46,9 @@ wn.widgets.PageSidebar = function(parent, opts) { wn.widgets.PageSidebarSection = function(sidebar, opts) { this.items = []; this.sidebar = sidebar; - this.wrapper = $a(sidebar.wrapper, 'div', 'psidebar-section'); - this.head = $a(this.wrapper, 'div', 'psidebar-section-head', '', opts.title); - this.body = $a(this.wrapper, 'div', 'psidebar-section-body'); + this.wrapper = $a(sidebar.wrapper, 'div', 'section'); + this.head = $a(this.wrapper, 'div', 'section-head', '', opts.title); + this.body = $a(this.wrapper, 'div', 'section-body'); $br(this.wrapper, '5px'); this.opts = opts; @@ -60,7 +60,7 @@ wn.widgets.PageSidebarSection = function(sidebar, opts) { var item = this.opts.items[i]; if((item.display && item.display()) || !item.display) { - var div = $a(this.body, 'div', 'psidebar-section-item'); + var div = $a(this.body, 'div', 'section-item'); this.make_one_item(item, div); } @@ -116,7 +116,7 @@ wn.widgets.PageSidebarLink = function(section, opts, wrapper) { if(opts.icon) { section.add_icon(this.wrapper, opts.icon); } - this.ln = $a(this.wrapper, 'span', 'link_type psidebar-section-link', opts.style, opts.label); + this.ln = $a(this.wrapper, 'span', 'link_type section-link', opts.style, opts.label); this.ln.onclick = function() { me.opts.onclick(me) }; } diff --git a/js/wn/ui/listing.js b/js/wn/ui/listing.js index 9819197bbb..5fba01674a 100644 --- a/js/wn/ui/listing.js +++ b/js/wn/ui/listing.js @@ -4,7 +4,9 @@ // // opts: // parent -// query or get_query +// method (method to call on server) +// args (additional args to method) +// query or get_query (will be deprecated) // query_max // no_result_message ("No result") // page_length (20) @@ -56,7 +58,7 @@ wn.widgets.Listing = function(opts) { // make the toolbar this.make_toolbar = function() { - if(!this.opts.hide_refresh) { + if(!(this.opts.hide_refresh || this.opts.no_refresh)) { this.ref_img = $a(this.toolbar_area, 'span', 'link_type', {color:'#888'}, '[refresh]'); this.ref_img.onclick = function() { me.run(); } @@ -151,18 +153,28 @@ wn.widgets.Listing = function(opts) { this.start = 0; // load query - this.query = this.opts.get_query ? this.opts.get_query() : this.opts.query; - this.add_limits(); - - args={ query_max: this.query_max || this.opts.query_max || '' } - args.simple_query = this.query; + if(!this.opts.method) { + this.query = this.opts.get_query ? this.opts.get_query() : this.opts.query; + this.add_limits(); + var args={ + query_max: this.query_max || this.opts.query_max || '', + as_dict: 1 + } + args.simple_query = this.query; + } else { + var args = { + limit_start: this.start, + limit_page_length: this.page_length + } + } - args.as_dict = 1; + if(this.opts.args) + $.extend(args, this.opts.args) // show loading if(this.loading_img) $di(this.loading_img); wn.call({ - method:'webnotes.widgets.query_builder.runquery', + method: this.opts.method || 'webnotes.widgets.query_builder.runquery', args: args, callback: function(r, rt) { me.make_results(r, rt) }, no_spinner: this.opts.no_loading, diff --git a/py/build/bundle.py b/py/build/bundle.py index 14dc409514..6c3953ba37 100644 --- a/py/build/bundle.py +++ b/py/build/bundle.py @@ -20,7 +20,7 @@ class Bundle: if ':' in f: f, suffix = f.split(':') - print f + ' | ' + str(int(os.path.getsize(f)/1024)) + 'k' + # print f + ' | ' + str(int(os.path.getsize(f)/1024)) + 'k' # get data with open(f, 'r') as infile: