bugfix to topbar
diff --git a/erpnext/website/js/topbar.js b/erpnext/website/js/topbar.js
index 8a7870c..90e530d 100644
--- a/erpnext/website/js/topbar.js
+++ b/erpnext/website/js/topbar.js
@@ -37,7 +37,7 @@
for(var i=0;i<items.length;i++) {
var item = items[i];
if(!item.parent_label && item.parentfield=='top_bar_items') {
- item.route = item.std_page ? item.std_page.toLowerCase() : item.custom_page;
+ item.route = item.custom_page ? item.custom_page : item.std_page.toLowerCase();
$('header .nav:first').append(repl('<li><a href="#!%(route)s" \
data-label="%(label)s">%(label)s</a></li>', item))
}
@@ -64,7 +64,7 @@
for(var i=0;i<items.length;i++) {
var item = items[i];
if(!item.parent_label && item.parentfield=='footer_items') {
- item.route = item.std_page ? item.std_page.toLowerCase() : item.custom_page;
+ item.route = item.custom_page ? item.custom_page : item.std_page.toLowerCase();
$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
data-label="%(label)s">%(label)s</a></li>', item))
}
@@ -72,4 +72,4 @@
}
});
-erpnext.footer = new erpnext.Footer();
\ No newline at end of file
+erpnext.footer = new erpnext.Footer();
diff --git a/erpnext/website/utils.py b/erpnext/website/utils.py
index 330f7a3..66be4d2 100644
--- a/erpnext/website/utils.py
+++ b/erpnext/website/utils.py
@@ -25,7 +25,8 @@
def page_name(title):
"""make page name from title, and check that there is no duplicate"""
import re
- name = re.sub('[~!@#$%^&*()<>,."\']', '', title.lower())
+ name = title.lower()
+ name = re.sub('[~!@#$%^&*()<>,."\']', '', name)
return '-'.join(name.split()[:4])
def add_page(title):
@@ -50,4 +51,4 @@
d = Document('Page Role')
d.parent = page
d.role = 'Guest'
- d.save()
\ No newline at end of file
+ d.save()