added website settings, refactored home

This commit is contained in:
Rushabh Mehta
2012-02-02 13:42:28 +05:30
parent d47e1d14b7
commit 7018b19f42
27 changed files with 349 additions and 256 deletions

View File

@@ -40,10 +40,11 @@ def boot_session(bootinfo):
import webnotes.model.doc
if webnotes.session['user']=='Guest':
bootinfo['topbar'] = webnotes.model.doc.getsingle('Top Bar Settings')
bootinfo['topbaritems'] = webnotes.conn.sql("""select label, std_page, custom_page,
bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
bootinfo['website_menus'] = webnotes.conn.sql("""select label, std_page, custom_page,
parent_label, parentfield
from `tabTop Bar Item` where parent='Top Bar Settings' order by idx asc""", as_dict=1)
from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
else:
bootinfo['letter_heads'] = get_letter_heads()

View File

@@ -55,7 +55,7 @@ pscript.select_sidebar_menu = function(t, dt, dn) {
var body_background = '#e2e2e2';
MenuPointer = function(parent, label) {
var me = this;
this.wrapper = $a(parent, 'div', '', {padding:'0px', cursor:'pointer', margin:'2px 0px'});
$br(this.wrapper, '3px');
@@ -73,8 +73,10 @@ MenuPointer = function(parent, label) {
$(this.wrapper)
.hover(
function() { if(!this.selected)$bg(this, '#eee'); } ,
function() { if(!this.selected)$bg(this, body_background); }
function() { if(!me.selected)
$bg(this, '#eee'); } ,
function() { if(!me.selected)
$bg(this, body_background); }
)
$y($td(this.tab, 0, 0), {borderBottom:'1px solid #ddd'});
@@ -84,9 +86,10 @@ MenuPointer = function(parent, label) {
// ====================================================================
MenuPointer.prototype.select = function(grey) {
$y($td(this.tab, 0, 0), {color:'#fff', borderBottom:'0px solid #000'});
//$gr(this.wrapper, '#F84', '#F63');
$gr(this.wrapper, '#888', '#666');
$y($td(this.tab, 0, 0), {
color:'#fff', borderBottom:'0px solid #000'
});
$(this.wrapper).css('background-color', '#999');
this.selected = 1;
if(cur_menu_pointer && cur_menu_pointer != this)
@@ -99,7 +102,7 @@ MenuPointer.prototype.select = function(grey) {
MenuPointer.prototype.deselect = function() {
$y($td(this.tab, 0, 0), {color:'#444', borderBottom:'1px solid #ddd'});
$gr(this.wrapper, body_background, body_background);
$(this.wrapper).css('background-color', body_background);
this.selected = 0;
}

View File

@@ -1,13 +1,17 @@
h1, h2, h3, h4 {
h1, h2, h3, h4, h5 {
font-family: Tahoma, Arial, Verdana, sans-serif;
font-weight: bold;
}
body, span, div, td, input, textarea, button, select {
body {
font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
font-size: 12px;
}
span, div, td, input, textarea, button, select {
font-family: inherit;
}
body {
background-color: #e2e2e2;
}

View File

@@ -19,6 +19,12 @@ erpnext.startup.start = function() {
$dh(page_body.left_sidebar);
wn.require('erpnext/website/css/website.css');
wn.require('erpnext/website/js/topbar.js');
if(wn.boot.custom_css) {
set_style(wn.boot.custom_css);
}
if(wn.boot.website_settings.title_prefix) {
wn.title_prefix = wn.boot.website_settings.title_prefix;
}
} else {
// modules
wn.require('erpnext/startup/modules.js');