fixed conflict using theirs
diff --git a/erpnext/home/page/profile_settings/profile_settings.html b/erpnext/home/page/profile_settings/profile_settings.html
index e69de29..49b1990 100644
--- a/erpnext/home/page/profile_settings/profile_settings.html
+++ b/erpnext/home/page/profile_settings/profile_settings.html
@@ -0,0 +1,5 @@
+<div class="layout-wrapper layout-wrapper-appframe">
+ <div class="layout-appframe"></div>
+ <div class="layout-main">
+ </div>
+</div>
\ No newline at end of file
diff --git a/erpnext/home/page/profile_settings/profile_settings.js b/erpnext/home/page/profile_settings/profile_settings.js
index f1ee6ff..667265e 100644
--- a/erpnext/home/page/profile_settings/profile_settings.js
+++ b/erpnext/home/page/profile_settings/profile_settings.js
@@ -16,7 +16,6 @@
pscript['onload_profile-settings'] = function() {
var wrapper = wn.pages['profile-settings'];
- wrapper.className = 'layout_wrapper';
pscript.myprofile = new MyProfile(wrapper)
}
@@ -25,11 +24,11 @@
var me = this;
this.make = function() {
- this.head = new PageHeader(this.wrapper, 'My Profile Settings');
- this.head.add_button('Change Password', this.change_password);
- this.head.add_button('Change Background', this.change_background);
+ this.wrapper.appframe = new wn.ui.AppFrame($(this.wrapper).find('.layout-appframe'), 'Profile Settings');
+ this.wrapper.appframe.add_button('Change Password', this.change_password);
+ this.wrapper.appframe.add_button('Change Background', this.change_background);
- this.tab = make_table($a(this.wrapper, 'div', '', {marginTop:'19px'}),
+ this.tab = make_table($a($(this.wrapper).find('.layout-main').get(0), 'div', '', {marginTop:'19px'}),
1, 2, '90%', ['50%', '50%'], {padding:'11px'})
this.img = $a($td(this.tab, 0, 0), 'img', '', {width: '120px', maxHeight:'200px'});
this.img.src = wn.user_info(user).image;
diff --git a/erpnext/home/page/profile_settings/profile_settings.py b/erpnext/home/page/profile_settings/profile_settings.py
index dc82812..631d22a 100644
--- a/erpnext/home/page/profile_settings/profile_settings.py
+++ b/erpnext/home/page/profile_settings/profile_settings.py
@@ -18,11 +18,19 @@
from webnotes.utils import load_json, cint, nowdate
+
+def check_demo():
+ demo_user = 'demo@webnotestech.com'
+ if webnotes.session['user']==demo_user:
+ webnotes.msgprint("Can't change in demo", raise_exception=1)
+
+
@webnotes.whitelist()
def change_password(arg):
"""
Change password
"""
+ check_demo()
arg = load_json(arg)
if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
@@ -44,6 +52,7 @@
"""
updates user details given in argument
"""
+ check_demo()
from webnotes.model.doc import Document
p = Document('Profile', webnotes.user.name)
@@ -59,6 +68,7 @@
"""
Set uploaded image as user image
"""
+ check_demo()
from webnotes.utils.file_manager import add_file_list, remove_file
user = webnotes.session['user']
@@ -76,6 +86,7 @@
"""
Set uploaded image as user image
"""
+ check_demo()
from webnotes.utils.file_manager import add_file_list, remove_file
user = webnotes.session['user']
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index 9d9e5a3..8002078 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -238,6 +238,11 @@
'description': 'Patch related to property setter cleanup'
},
{
+ 'patch_module': 'patches.april_2012',
+ 'patch_file': 'naming_series_patch',
+ 'description': 'Move naming series options into property setter'
+ },
+ {
'patch_module': 'patches.jan_mar_2012',
'patch_file': 'rename_dt',
'description': 'Rename DocType Patch'
@@ -269,11 +274,6 @@
},
{
'patch_module': 'patches.april_2012',
- 'patch_file': 'naming_series_patch',
- 'description': 'Move naming series options into property setter'
- },
- {
- 'patch_module': 'patches.april_2012',
'patch_file': 'after_sync_cleanup',
'description': 'cleanup after sync'
},
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index c58d378..a67a214 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -60,9 +60,9 @@
import webnotes.model.doc
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
+ bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
if webnotes.session['user']=='Guest':
- bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
bootinfo['website_menus'] = webnotes.conn.sql("""select label, url, custom_page,
parent_label, parentfield
from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js
index 321149c..455b850 100644
--- a/erpnext/startup/startup.js
+++ b/erpnext/startup/startup.js
@@ -72,10 +72,6 @@
// always allow apps
wn.boot.profile.allow_modules = wn.boot.profile.allow_modules.concat(
['To Do', 'Knowledge Base', 'Calendar', 'Activity', 'Messages'])
- // allow dashboard to accounts manager
- if(user_roles.indexOf('Accounts Manager')!=-1) {
- wn.boot.profile.allow_modules.push('Dashboard');
- }
// setup toolbar
erpnext.toolbar.setup();
@@ -85,8 +81,8 @@
// border to the body
// ------------------
- //$('footer').html('<div class="web-footer erpnext-footer">\
- // <a href="#!attributions">ERPNext | Attributions and License</a></div>');
+ $('footer').html('<div class="web-footer erpnext-footer">\
+ <a href="#!attributions">ERPNext | Attributions and License</a></div>');
// complete registration
if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) {
@@ -106,7 +102,7 @@
</div>', { expiry_string: expiry_string }));
} else if (diff < 0) {
$('header').append(repl('<div class="expiry-info"> \
- This ERPNext subscription <b>has expired</b> and should be deleted. \
+ This ERPNext subscription <b>has expired</b>. \
</div>', { expiry_string: expiry_string }));
}
}
diff --git a/erpnext/utilities/page/users/users.js b/erpnext/utilities/page/users/users.js
index 704682e..757b1a3 100644
--- a/erpnext/utilities/page/users/users.js
+++ b/erpnext/utilities/page/users/users.js
@@ -64,7 +64,8 @@
}
});
if(!$('.subscription-info').length && (wn.boot.max_users || wn.boot.expires_on)) {
- var $sub_info = $('<div class="subscription-info-box"><div>').insertAfter('.help');
+ var $sub_info = $('<div class="subscription-info-box"><div>')
+ .insertAfter($(wn.pages.users).find('.help'));
if(wn.boot.max_users) {
$sub_info.append(repl('\
<span class="subscription-info"> \
diff --git a/erpnext/utilities/page/users/users.py b/erpnext/utilities/page/users/users.py
index 819f7bb..7da8003 100644
--- a/erpnext/utilities/page/users/users.py
+++ b/erpnext/utilities/page/users/users.py
@@ -112,7 +112,7 @@
active_users = sql("""select count(*) from tabProfile
where ifnull(enabled, 0)=1 and docstatus<2
and name not in ('Administrator', 'Guest')""")[0][0]
- if active_users >= conf.max_users:
+ if active_users >= conf.max_users and conf.max_users:
# same message as in users.js
webnotes.msgprint("""Alas! <br />\
You already have <b>%(active_users)s</b> active users, \
diff --git a/erpnext/website/doctype/style_settings/custom_template.css b/erpnext/website/doctype/style_settings/custom_template.css
index 4866ac7..6fe8ce5 100644
--- a/erpnext/website/doctype/style_settings/custom_template.css
+++ b/erpnext/website/doctype/style_settings/custom_template.css
@@ -19,18 +19,6 @@
}
{% endif %}
-{% if doc.footer_font_color %}
-footer {
- color: {{ doc.footer_font_color }};
-}
-footer a, footer a:visited, footer a:hover {
- color: {{ doc.footer_font_color }};
-}
-.web-footer-menu ul li {
- border-right: 1px solid {{ doc.footer_font_color }};
-}
-{% endif %}
-
{% if doc.heading_font %}
h1, h2, h3, h4, h5 {
font-family: '{{ doc.heading_font}}', Arial, 'Helvetica Neue' !important;
diff --git a/erpnext/website/doctype/style_settings/style_settings.py b/erpnext/website/doctype/style_settings/style_settings.py
index db26a15..f47a427 100644
--- a/erpnext/website/doctype/style_settings/style_settings.py
+++ b/erpnext/website/doctype/style_settings/style_settings.py
@@ -25,6 +25,9 @@
with open('erpnext/website/doctype/style_settings/custom_template.css', 'r') as f:
temp = Template(f.read())
+ if not self.doc.font_size:
+ self.doc.font_size = '13px'
+
self.doc.small_font_size = str(int(self.doc.font_size[:-2])-2) + 'px'
self.doc.custom_css = temp.render(doc = self.doc)
diff --git a/erpnext/website/doctype/style_settings/style_settings.txt b/erpnext/website/doctype/style_settings/style_settings.txt
index dd962d5..d5a9e80 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-04-02 16:02:43',
'docstatus': 0,
- 'modified': '2012-04-25 10:00:35',
+ 'modified': '2012-05-01 15:58:16',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -23,7 +23,7 @@
'name': '__common__',
'section_style': u'Simple',
'show_in_menu': 0,
- 'version': 23
+ 'version': 1
},
# These values are common for all DocField
@@ -91,21 +91,8 @@
# DocField
{
- 'colour': u'White:FFF',
- 'description': u'Select a white footer foreground color if you have a dark background',
- 'doctype': u'DocField',
- 'fieldname': u'footer_font_color',
- 'fieldtype': u'Select',
- 'label': u'Footer Font Color',
- 'options': u'\nwhite',
- 'permlevel': 0
- },
-
- # DocField
- {
'doctype': u'DocField',
'fieldtype': u'Column Break',
- 'label': u'Fonts',
'permlevel': 0,
'width': u'50%'
},
@@ -143,6 +130,7 @@
# DocField
{
'doctype': u'DocField',
+ 'fieldname': u'css',
'fieldtype': u'Section Break',
'label': u'CSS',
'permlevel': 0
diff --git a/erpnext/website/js/topbar.js b/erpnext/website/js/topbar.js
index 8caf8dc..b004a6f 100644
--- a/erpnext/website/js/topbar.js
+++ b/erpnext/website/js/topbar.js
@@ -27,7 +27,7 @@
erpnext.navbar.Navbar = Class.extend({
init: function() {
this.make();
- $('.brand').html(wn.boot.website_settings.brand_html);
+ $('.brand').html(wn.boot.website_settings.brand_html || sys_defaults.company);
this.make_items();
$('.dropdown-toggle').dropdown();
},
@@ -54,9 +54,11 @@
for(var i=0;i<items.length;i++) {
var item = items[i];
if(!item.parent_label && item.parentfield=='top_bar_items') {
- item.route = item.url || item.custom_page;
+ console.log(item)
+ erpnext.header_link_settings(item);
+
$('header .nav:first').append(repl('<li data-label="%(label)s">\
- <a href="#!%(route)s">%(label)s</a></li>', item))
+ <a href="%(route)s" %(target)s>%(label)s</a></li>', item));
}
}
@@ -77,21 +79,26 @@
});
$parent_li.append('<ul class="dropdown-menu"></ul>');
}
- item.route = item.url || item.custom_page;
+ erpnext.header_link_settings(item);
$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
- <a href="#!%(route)s">%(label)s</a></li>', item))
+ <a href="%(route)s" %(target)s>%(label)s</a></li>', item))
}
}
}
});
-
// footer
erpnext.Footer = Class.extend({
init: function() {
+ if(!wn.boot.website_settings.copyright) {
+ wn.boot.website_settings.copyright = sys_defaults.company;
+ }
+ if(!wn.boot.website_settings.address) {
+ wn.boot.website_settings.address = '';
+ }
$('footer').html(repl('<div class="web-footer">\
<div class="web-footer-menu"><ul></ul></div>\
- <div class="web-footer-copyright">© %(copyright)s | %(address)s</div>\
+ <div class="web-footer-copyright">© %(copyright)s</div>\
<div class="web-footer-powered">Powered by \
<a href="https://erpnext.com">erpnext.com</a></div>\
</div>', wn.boot.website_settings));
@@ -102,14 +109,25 @@
for(var i=0;i<items.length;i++) {
var item = items[i];
if(!item.parent_label && item.parentfield=='footer_items') {
- item.route = item.url || item.custom_page;
- $('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
+ erpnext.header_link_settings(item);
+ $('.web-footer-menu ul').append(repl('<li><a href="%(route)s" %(target)s\
data-label="%(label)s">%(label)s</a></li>', item))
}
}
}
});
+// customize hard / soft links
+erpnext.header_link_settings = function(item) {
+ item.route = item.url || item.custom_page;
+ if(item.route.substr(0,4)=='http') {
+ item.target = 'target="_blank"';
+ } else {
+ item.target = '';
+ item.route = '#!' + item.route;
+ }
+}
+
$(document).bind('startup', function() {
erpnext.footer = new erpnext.Footer();
erpnext.navbar.navbar = new erpnext.navbar.Navbar();
diff --git a/erpnext/website/page/blog/blog.js b/erpnext/website/page/blog/blog.js
index 3836f90..184424b 100644
--- a/erpnext/website/page/blog/blog.js
+++ b/erpnext/website/page/blog/blog.js
@@ -21,7 +21,8 @@
query: 'select tabBlog.name, title, left(content, 1000) as content, tabBlog.modified, \
ifnull(first_name, "") as first_name, ifnull(last_name, "") as last_name \
from tabProfile, tabBlog\
- where ifnull(published,0)=1 and tabBlog.owner = tabProfile.name',
+ where ifnull(published,0)=1 and tabBlog.owner = tabProfile.name \
+ order by tabBlog.modified desc',
hide_refresh: true,
no_toolbar: true,
render_row: function(parent, data) {
diff --git a/images/erpnext1.png b/images/erpnext1.png
new file mode 100644
index 0000000..cfc3d84
--- /dev/null
+++ b/images/erpnext1.png
Binary files differ
diff --git a/js/all-app.js b/js/all-app.js
index 071cdf3..2526a05 100644
--- a/js/all-app.js
+++ b/js/all-app.js
@@ -516,7 +516,7 @@
*/
wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(opts){if(opts.btn)$(opts.btn).set_working();if(opts.show_spinner)set_loading();if(opts.freeze)freeze();if(!opts.args.cmd){console.log(opts)
throw"Incomplete Request";}}
-wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('wn.app.redirect_to_login()',3000);return;}
+wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session Expired. Logging you out');wn.app.logout();return;}
if(r.server_messages)msgprint(r.server_messages)
if(r.exc){console.log(r.exc);};if(r['403']){wn.container.change_to('403');}
if(r.docs)LocalDB.sync(r.docs);}
@@ -982,10 +982,11 @@
/*
* lib/js/wn/ui/appframe.js
*/
-wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
+wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
<span class="appframe-title"></span>\
<span class="close">×</span>\
- </div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
+ </div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})
+if(title)this.title(title);},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
this.buttons[label]=$(repl('<button class="btn btn-small">\
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}});wn.ui.make_app_page=function(opts){if(opts.single_column){$(opts.parent).html('<div class="layout-wrapper layout-wrapper-appframe">\
@@ -2219,8 +2220,7 @@
* js/app.js
*/
wn.provide('erpnext');erpnext.set_about=function(){wn.provide('wn.app');$.extend(wn.app,{name:'ERPNext',license:'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',source:'https://github.com/webnotes/erpnext',publisher:'Web Notes Technologies Pvt Ltd, Mumbai',copyright:'© Web Notes Technologies Pvt Ltd',version:'2'});}
-wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html('<b>erp</b>next\
- <i class="icon-home icon-white navbar-icon-home" ></i>').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});});
+wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html((wn.boot.website_settings.brand_html||'erpnext')+' <i class="icon-home icon-white navbar-icon-home" ></i>').css('max-width','200px').css('overflow','hidden').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});});
/*
* erpnext/startup/startup.js
*/
@@ -2230,14 +2230,14 @@
if(user=='Guest'){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;}
if(wn.boot.startup_code){eval(wn.boot.startup_code);}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages'])
-if(user_roles.indexOf('Accounts Manager')!=-1){wn.boot.profile.allow_modules.push('Dashboard');}
-erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();}
+erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
+ <a href="#!attributions">ERPNext | Attributions and License</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();}
if(wn.boot.expires_on&&in_list(user_roles,'System Manager')){var today=dateutil.str_to_obj(dateutil.get_today());var expires_on=dateutil.str_to_obj(wn.boot.expires_on);var diff=dateutil.get_diff(expires_on,today);if(0<=diff&&diff<=15){var expiry_string=diff==0?"today":repl("in %(diff)s day(s)",{diff:diff});$('header').append(repl('<div class="expiry-info"> \
Your ERPNext subscription will <b>expire %(expiry_string)s</b>. \
Please renew your subscription to continue using ERPNext \
(and remove this annoying banner). \
</div>',{expiry_string:expiry_string}));}else if(diff<0){$('header').append(repl('<div class="expiry-info"> \
- This ERPNext subscription <b>has expired</b> and should be deleted. \
+ This ERPNext subscription <b>has expired</b>. \
</div>',{expiry_string:expiry_string}));}}}
erpnext.set_about();$('#startup_div').toggle(false);}
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
diff --git a/js/all-web.js b/js/all-web.js
index 253ae70..a91934b 100644
--- a/js/all-web.js
+++ b/js/all-web.js
@@ -403,7 +403,7 @@
*/
wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(opts){if(opts.btn)$(opts.btn).set_working();if(opts.show_spinner)set_loading();if(opts.freeze)freeze();if(!opts.args.cmd){console.log(opts)
throw"Incomplete Request";}}
-wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('wn.app.redirect_to_login()',3000);return;}
+wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session Expired. Logging you out');wn.app.logout();return;}
if(r.server_messages)msgprint(r.server_messages)
if(r.exc){console.log(r.exc);};if(r['403']){wn.container.change_to('403');}
if(r.docs)LocalDB.sync(r.docs);}
@@ -642,10 +642,11 @@
/*
* lib/js/wn/ui/appframe.js
*/
-wn.ui.AppFrame=Class.extend({init:function(parent){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
+wn.ui.AppFrame=Class.extend({init:function(parent,title){this.buttons={};this.$w=$('<div></div>').appendTo(parent);this.$titlebar=$('<div class="appframe-titlebar">\
<span class="appframe-title"></span>\
<span class="close">×</span>\
- </div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
+ </div>').appendTo(this.$w);this.$w.find('.close').click(function(){window.history.back();})
+if(title)this.title(title);},title:function(txt){this.$titlebar.find('.appframe-title').html(txt);},add_button:function(label,click,icon){if(!this.$w.find('.appframe-toolbar').length)
this.$w.append('<div class="appframe-toolbar"></div>');args={label:label,icon:''};if(icon){args.icon='<i class="'+icon+'"></i>';}
this.buttons[label]=$(repl('<button class="btn btn-small">\
%(icon)s %(label)s</button>',args)).click(click).appendTo(this.$w.find('.appframe-toolbar'));return this.buttons[label];},clear_buttons:function(){this.$w.find('.appframe-toolbar').empty();}});wn.ui.make_app_page=function(opts){if(opts.single_column){$(opts.parent).html('<div class="layout-wrapper layout-wrapper-appframe">\
@@ -830,8 +831,7 @@
* js/app.js
*/
wn.provide('erpnext');erpnext.set_about=function(){wn.provide('wn.app');$.extend(wn.app,{name:'ERPNext',license:'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',source:'https://github.com/webnotes/erpnext',publisher:'Web Notes Technologies Pvt Ltd, Mumbai',copyright:'© Web Notes Technologies Pvt Ltd',version:'2'});}
-wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html('<b>erp</b>next\
- <i class="icon-home icon-white navbar-icon-home" ></i>').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});});
+wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html((wn.boot.website_settings.brand_html||'erpnext')+' <i class="icon-home icon-white navbar-icon-home" ></i>').css('max-width','200px').css('overflow','hidden').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});});
/*
* erpnext/startup/startup.js
*/
@@ -841,14 +841,14 @@
if(user=='Guest'){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;}
if(wn.boot.startup_code){eval(wn.boot.startup_code);}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages'])
-if(user_roles.indexOf('Accounts Manager')!=-1){wn.boot.profile.allow_modules.push('Dashboard');}
-erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();}
+erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
+ <a href="#!attributions">ERPNext | Attributions and License</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup.show();}
if(wn.boot.expires_on&&in_list(user_roles,'System Manager')){var today=dateutil.str_to_obj(dateutil.get_today());var expires_on=dateutil.str_to_obj(wn.boot.expires_on);var diff=dateutil.get_diff(expires_on,today);if(0<=diff&&diff<=15){var expiry_string=diff==0?"today":repl("in %(diff)s day(s)",{diff:diff});$('header').append(repl('<div class="expiry-info"> \
Your ERPNext subscription will <b>expire %(expiry_string)s</b>. \
Please renew your subscription to continue using ERPNext \
(and remove this annoying banner). \
</div>',{expiry_string:expiry_string}));}else if(diff<0){$('header').append(repl('<div class="expiry-info"> \
- This ERPNext subscription <b>has expired</b> and should be deleted. \
+ This ERPNext subscription <b>has expired</b>. \
</div>',{expiry_string:expiry_string}));}}}
erpnext.set_about();$('#startup_div').toggle(false);}
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
@@ -869,7 +869,7 @@
/*
* erpnext/website/js/topbar.js
*/
-wn.provide('erpnext.navbar');erpnext.navbar.Navbar=Class.extend({init:function(){this.make();$('.brand').html(wn.boot.website_settings.brand_html);this.make_items();$('.dropdown-toggle').dropdown();},make:function(){$('header').append('<div class="navbar navbar-fixed-top">\
+wn.provide('erpnext.navbar');erpnext.navbar.Navbar=Class.extend({init:function(){this.make();$('.brand').html(wn.boot.website_settings.brand_html||sys_defaults.company);this.make_items();$('.dropdown-toggle').dropdown();},make:function(){$('header').append('<div class="navbar navbar-fixed-top">\
<div class="navbar-inner">\
<div class="container">\
<a class="brand">[brand]</a>\
@@ -881,15 +881,19 @@
</ul>\
</div>\
</div>\
- </div>');$('.brand').attr('href','#!'+(wn.boot.website_settings.home_page||'Login Page'))},make_items:function(){var items=wn.boot.website_menus;for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='top_bar_items'){item.route=item.url||item.custom_page;$('header .nav:first').append(repl('<li data-label="%(label)s">\
- <a href="#!%(route)s">%(label)s</a></li>',item))}}
+ </div>');$('.brand').attr('href','#!'+(wn.boot.website_settings.home_page||'Login Page'))},make_items:function(){var items=wn.boot.website_menus;for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='top_bar_items'){console.log(item)
+erpnext.header_link_settings(item);$('header .nav:first').append(repl('<li data-label="%(label)s">\
+ <a href="%(route)s" %(target)s>%(label)s</a></li>',item));}}
for(var i=0;i<items.length;i++){var item=items[i];if(item.parent_label&&item.parentfield=='top_bar_items'){$parent_li=$(repl('header li[data-label="%(parent_label)s"]',item));if(!$parent_li.hasClass('dropdown')){$parent_li.addClass('dropdown');$parent_li.find('a:first').addClass('dropdown-toggle').attr('data-toggle','dropdown').attr('href','').append('<b class="caret"></b>').click(function(){return false;});$parent_li.append('<ul class="dropdown-menu"></ul>');}
-item.route=item.url||item.custom_page;$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
- <a href="#!%(route)s">%(label)s</a></li>',item))}}}});erpnext.Footer=Class.extend({init:function(){$('footer').html(repl('<div class="web-footer">\
+erpnext.header_link_settings(item);$parent_li.find('.dropdown-menu').append(repl('<li data-label="%(label)s">\
+ <a href="%(route)s" %(target)s>%(label)s</a></li>',item))}}}});erpnext.Footer=Class.extend({init:function(){if(!wn.boot.website_settings.copyright){wn.boot.website_settings.copyright=sys_defaults.company;}
+if(!wn.boot.website_settings.address){wn.boot.website_settings.address='';}
+$('footer').html(repl('<div class="web-footer">\
<div class="web-footer-menu"><ul></ul></div>\
- <div class="web-footer-copyright">© %(copyright)s | %(address)s</div>\
+ <div class="web-footer-copyright">© %(copyright)s</div>\
<div class="web-footer-powered">Powered by \
<a href="https://erpnext.com">erpnext.com</a></div>\
</div>',wn.boot.website_settings));this.make_items();},make_items:function(){var items=wn.boot.website_menus
-for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='footer_items'){item.route=item.url||item.custom_page;$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
- data-label="%(label)s">%(label)s</a></li>',item))}}}});$(document).bind('startup',function(){erpnext.footer=new erpnext.Footer();erpnext.navbar.navbar=new erpnext.navbar.Navbar();})
\ No newline at end of file
+for(var i=0;i<items.length;i++){var item=items[i];if(!item.parent_label&&item.parentfield=='footer_items'){erpnext.header_link_settings(item);$('.web-footer-menu ul').append(repl('<li><a href="%(route)s" %(target)s\
+ data-label="%(label)s">%(label)s</a></li>',item))}}}});erpnext.header_link_settings=function(item){item.route=item.url||item.custom_page;if(item.route.substr(0,4)=='http'){item.target='target="_blank"';}else{item.target='';item.route='#!'+item.route;}}
+$(document).bind('startup',function(){erpnext.footer=new erpnext.Footer();erpnext.navbar.navbar=new erpnext.navbar.Navbar();})
\ No newline at end of file
diff --git a/js/app.js b/js/app.js
index 82dd17f..80efaf6 100644
--- a/js/app.js
+++ b/js/app.js
@@ -14,8 +14,9 @@
wn.modules_path = 'erpnext';
$(document).bind('toolbar_setup', function() {
- $('.brand').html('<b>erp</b>next\
- <i class="icon-home icon-white navbar-icon-home" ></i>')
+ $('.brand').html((wn.boot.website_settings.brand_html || 'erpnext') +
+ ' <i class="icon-home icon-white navbar-icon-home" ></i>')
+ .css('max-width', '200px').css('overflow', 'hidden')
.hover(function() {
$(this).find('.icon-home').addClass('navbar-icon-home-hover');
}, function() {