Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
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/js/topbar.js b/erpnext/website/js/topbar.js
index 8caf8dc..e6a6b59 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,18 +79,23 @@
});
$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>\
@@ -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/js/all-app.js b/js/all-app.js
index e071743..40608e7 100644
--- a/js/all-app.js
+++ b/js/all-app.js
@@ -2219,8 +2219,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.substr(0,15)||'erpnext'+' <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');});});
/*
* erpnext/startup/startup.js
*/
diff --git a/js/all-web.js b/js/all-web.js
index 888aca2..f271a36 100644
--- a/js/all-web.js
+++ b/js/all-web.js
@@ -830,8 +830,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.substr(0,15)||'erpnext'+' <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');});});
/*
* erpnext/startup/startup.js
*/
@@ -868,7 +867,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>\
@@ -880,15 +879,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-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..e994ccf 100644
--- a/js/app.js
+++ b/js/app.js
@@ -14,8 +14,8 @@
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.substr(0,15) || 'erpnext' +
+ ' <i class="icon-home icon-white navbar-icon-home" ></i>')
.hover(function() {
$(this).find('.icon-home').addClass('navbar-icon-home-hover');
}, function() {