top bar to accept url
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index e3e7fa9..3c6281f 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -53,7 +53,7 @@
if webnotes.session['user']=='Guest':
bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
- bootinfo['website_menus'] = webnotes.conn.sql("""select label, std_page, custom_page,
+ 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)
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
diff --git a/erpnext/website/doctype/top_bar_item/top_bar_item.txt b/erpnext/website/doctype/top_bar_item/top_bar_item.txt
index 410352c..3ff23b3 100644
--- a/erpnext/website/doctype/top_bar_item/top_bar_item.txt
+++ b/erpnext/website/doctype/top_bar_item/top_bar_item.txt
@@ -5,70 +5,69 @@
{
'creation': '2012-01-24 10:24:19',
'docstatus': 0,
- 'modified': '2012-01-30 14:14:48',
- 'modified_by': 'Administrator',
- 'owner': 'Administrator'
+ 'modified': '2012-02-07 10:35:19',
+ 'modified_by': u'Administrator',
+ 'owner': u'Administrator'
},
# These values are common for all DocType
{
- 'colour': 'White:FFF',
+ 'colour': u'White:FFF',
'doctype': 'DocType',
'istable': 1,
- 'module': 'Website',
+ 'module': u'Website',
'name': '__common__',
- 'section_style': 'Simple',
+ 'section_style': u'Simple',
'show_in_menu': 0,
- 'version': 2
+ 'version': 4
},
# These values are common for all DocField
{
- 'doctype': 'DocField',
+ 'doctype': u'DocField',
'name': '__common__',
- 'parent': 'Top Bar Item',
- 'parentfield': 'fields',
- 'parenttype': 'DocType',
+ 'parent': u'Top Bar Item',
+ 'parentfield': u'fields',
+ 'parenttype': u'DocType',
'permlevel': 0
},
# DocType, Top Bar Item
{
'doctype': 'DocType',
- 'name': 'Top Bar Item'
+ 'name': u'Top Bar Item'
},
# DocField
{
- 'doctype': 'DocField',
- 'fieldname': 'label',
- 'fieldtype': 'Data',
- 'label': 'Label'
+ 'doctype': u'DocField',
+ 'fieldname': u'label',
+ 'fieldtype': u'Data',
+ 'label': u'Label'
},
# DocField
{
- 'doctype': 'DocField',
- 'fieldname': 'std_page',
- 'fieldtype': 'Select',
- 'label': 'Std Page',
- 'options': 'Home\nAbout\nContact\nProducts\nBlog\nCustom'
+ 'doctype': u'DocField',
+ 'fieldname': u'custom_page',
+ 'fieldtype': u'Link',
+ 'label': u'Page',
+ 'options': u'Page'
},
# DocField
{
- 'doctype': 'DocField',
- 'fieldname': 'custom_page',
- 'fieldtype': 'Link',
- 'label': 'Custom Page',
- 'options': 'Web Page'
+ 'doctype': u'DocField',
+ 'fieldname': u'url',
+ 'fieldtype': u'Data',
+ 'label': u'URL'
},
# DocField
{
- 'doctype': 'DocField',
- 'fieldname': 'parent_label',
- 'fieldtype': 'Select',
- 'label': 'Parent Label'
+ 'doctype': u'DocField',
+ 'fieldname': u'parent_label',
+ 'fieldtype': u'Select',
+ 'label': u'Parent Label'
}
]
\ No newline at end of file
diff --git a/erpnext/website/js/topbar.js b/erpnext/website/js/topbar.js
index 90e530d..cffc825 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.custom_page ? item.custom_page : item.std_page.toLowerCase();
+ item.route = item.url || item.custom_page;
$('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.custom_page ? item.custom_page : item.std_page.toLowerCase();
+ 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))
}