@@ -231,10 +231,15 @@ div.std-footer-item { | |||||
padding: 15px; | padding: 15px; | ||||
} | } | ||||
.layout-wrapper-background { | |||||
background-color: #f2f2f2 !important; | |||||
padding: 0px; | |||||
} | |||||
.layout-main-section { | .layout-main-section { | ||||
width: 68%; | width: 68%; | ||||
float: left; | float: left; | ||||
padding: 13px; | |||||
padding: 15px; | |||||
background-color: #FFF; | background-color: #FFF; | ||||
min-height: 450px; | min-height: 450px; | ||||
} | } | ||||
@@ -242,10 +247,9 @@ div.std-footer-item { | |||||
.layout-side-section { | .layout-side-section { | ||||
width: 24%; | width: 24%; | ||||
float: right; | float: right; | ||||
margin-right: 15px; | |||||
color: #606060; | color: #606060; | ||||
overflow-x: hidden; | overflow-x: hidden; | ||||
padding: 13px; | |||||
padding: 15px; | |||||
min-height: 450px; | min-height: 450px; | ||||
} | } | ||||
@@ -1,40 +1,33 @@ | |||||
div.psidebar-wrapper { | |||||
margin: 0px 8px; | |||||
div.psidebar { | |||||
} | } | ||||
div.psidebar-head { | |||||
div.psidebar div.head { | |||||
font-size: 14px; | font-size: 14px; | ||||
font-weight: bold; | font-weight: bold; | ||||
color: #555; | color: #555; | ||||
margin-bottom: 12px; | margin-bottom: 12px; | ||||
} | } | ||||
div.psidebar-section { | |||||
div.psidebar div.section { | |||||
margin-bottom: 11px; | margin-bottom: 11px; | ||||
overflow: hidden; | overflow: hidden; | ||||
} | } | ||||
div.psidebar-section-head { | |||||
div.psidebar div.section-head { | |||||
font-size: 12px; | font-size: 12px; | ||||
padding: 5px 11px; | padding: 5px 11px; | ||||
border-bottom: 2px solid #444; | border-bottom: 2px solid #444; | ||||
} | } | ||||
div.psidebar-section-body { | |||||
div.psidebar div.section-body { | |||||
margin: 7px 11px 11px 11px; | margin: 7px 11px 11px 11px; | ||||
} | } | ||||
div.psidebar-section-item { | |||||
div.psidebar div.section-item { | |||||
margin-bottom: 7px; | margin-bottom: 7px; | ||||
} | } | ||||
.psidebar-section-link { | |||||
div.psidebar .section-link { | |||||
font-size: 11px; | font-size: 11px; | ||||
color: #666; | color: #666; | ||||
} | |||||
div.follower-list { | |||||
color: #666; | |||||
margin-top: 7px; | |||||
font-size: 11px; | |||||
} | } |
@@ -10,11 +10,9 @@ | |||||
*/ | */ | ||||
wn.sidebar_background = '#f2f2f2'; | |||||
wn.PageLayout = function(args) { | wn.PageLayout = function(args) { | ||||
$.extend(this, 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.main = $a(this.wrapper, 'div', 'layout-main-section'); | ||||
this.sidebar_area = $a(this.wrapper, 'div', 'layout-side-section'); | this.sidebar_area = $a(this.wrapper, 'div', 'layout-side-section'); | ||||
$a(this.wrapper, 'div', '', {clear:'both'}); | $a(this.wrapper, 'div', '', {clear:'both'}); | ||||
@@ -14,7 +14,7 @@ | |||||
wn.widgets.PageSidebar = function(parent, opts) { | wn.widgets.PageSidebar = function(parent, opts) { | ||||
this.opts = opts | this.opts = opts | ||||
this.sections = {} | this.sections = {} | ||||
this.wrapper = $a(parent, 'div', 'psidebar-wrapper') | |||||
this.wrapper = $a(parent, 'div', 'psidebar') | |||||
// refresh sidebar - make head and sections | // refresh sidebar - make head and sections | ||||
this.refresh = function() { | this.refresh = function() { | ||||
@@ -34,7 +34,7 @@ wn.widgets.PageSidebar = function(parent, opts) { | |||||
} | } | ||||
this.make_head = function() { | 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(); | this.refresh(); | ||||
@@ -46,9 +46,9 @@ wn.widgets.PageSidebar = function(parent, opts) { | |||||
wn.widgets.PageSidebarSection = function(sidebar, opts) { | wn.widgets.PageSidebarSection = function(sidebar, opts) { | ||||
this.items = []; | this.items = []; | ||||
this.sidebar = sidebar; | 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'); | $br(this.wrapper, '5px'); | ||||
this.opts = opts; | this.opts = opts; | ||||
@@ -60,7 +60,7 @@ wn.widgets.PageSidebarSection = function(sidebar, opts) { | |||||
var item = this.opts.items[i]; | var item = this.opts.items[i]; | ||||
if((item.display && item.display()) || !item.display) { | 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); | this.make_one_item(item, div); | ||||
} | } | ||||
@@ -116,7 +116,7 @@ wn.widgets.PageSidebarLink = function(section, opts, wrapper) { | |||||
if(opts.icon) { | if(opts.icon) { | ||||
section.add_icon(this.wrapper, 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) }; | this.ln.onclick = function() { me.opts.onclick(me) }; | ||||
} | } | ||||
@@ -4,7 +4,9 @@ | |||||
// | // | ||||
// opts: | // opts: | ||||
// parent | // 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 | // query_max | ||||
// no_result_message ("No result") | // no_result_message ("No result") | ||||
// page_length (20) | // page_length (20) | ||||
@@ -56,7 +58,7 @@ wn.widgets.Listing = function(opts) { | |||||
// make the toolbar | // make the toolbar | ||||
this.make_toolbar = function() { | 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 = $a(this.toolbar_area, 'span', 'link_type', {color:'#888'}, '[refresh]'); | ||||
this.ref_img.onclick = function() { me.run(); } | this.ref_img.onclick = function() { me.run(); } | ||||
@@ -151,18 +153,28 @@ wn.widgets.Listing = function(opts) { | |||||
this.start = 0; | this.start = 0; | ||||
// load query | // 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 | // show loading | ||||
if(this.loading_img) $di(this.loading_img); | if(this.loading_img) $di(this.loading_img); | ||||
wn.call({ | wn.call({ | ||||
method:'webnotes.widgets.query_builder.runquery', | |||||
method: this.opts.method || 'webnotes.widgets.query_builder.runquery', | |||||
args: args, | args: args, | ||||
callback: function(r, rt) { me.make_results(r, rt) }, | callback: function(r, rt) { me.make_results(r, rt) }, | ||||
no_spinner: this.opts.no_loading, | no_spinner: this.opts.no_loading, | ||||
@@ -20,7 +20,7 @@ class Bundle: | |||||
if ':' in f: | if ':' in f: | ||||
f, suffix = f.split(':') | 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 | # get data | ||||
with open(f, 'r') as infile: | with open(f, 'r') as infile: | ||||