top bar to accept url
This commit is contained in:
parent
0a45f96c48
commit
f35992f695
@ -53,7 +53,7 @@ def boot_session(bootinfo):
|
|||||||
|
|
||||||
if webnotes.session['user']=='Guest':
|
if webnotes.session['user']=='Guest':
|
||||||
bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
|
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
|
parent_label, parentfield
|
||||||
from `tabTop Bar Item` where parent='Website 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 ''
|
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
|
||||||
|
@ -5,70 +5,69 @@
|
|||||||
{
|
{
|
||||||
'creation': '2012-01-24 10:24:19',
|
'creation': '2012-01-24 10:24:19',
|
||||||
'docstatus': 0,
|
'docstatus': 0,
|
||||||
'modified': '2012-01-30 14:14:48',
|
'modified': '2012-02-07 10:35:19',
|
||||||
'modified_by': 'Administrator',
|
'modified_by': u'Administrator',
|
||||||
'owner': 'Administrator'
|
'owner': u'Administrator'
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocType
|
# These values are common for all DocType
|
||||||
{
|
{
|
||||||
'colour': 'White:FFF',
|
'colour': u'White:FFF',
|
||||||
'doctype': 'DocType',
|
'doctype': 'DocType',
|
||||||
'istable': 1,
|
'istable': 1,
|
||||||
'module': 'Website',
|
'module': u'Website',
|
||||||
'name': '__common__',
|
'name': '__common__',
|
||||||
'section_style': 'Simple',
|
'section_style': u'Simple',
|
||||||
'show_in_menu': 0,
|
'show_in_menu': 0,
|
||||||
'version': 2
|
'version': 4
|
||||||
},
|
},
|
||||||
|
|
||||||
# These values are common for all DocField
|
# These values are common for all DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'name': '__common__',
|
'name': '__common__',
|
||||||
'parent': 'Top Bar Item',
|
'parent': u'Top Bar Item',
|
||||||
'parentfield': 'fields',
|
'parentfield': u'fields',
|
||||||
'parenttype': 'DocType',
|
'parenttype': u'DocType',
|
||||||
'permlevel': 0
|
'permlevel': 0
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocType, Top Bar Item
|
# DocType, Top Bar Item
|
||||||
{
|
{
|
||||||
'doctype': 'DocType',
|
'doctype': 'DocType',
|
||||||
'name': 'Top Bar Item'
|
'name': u'Top Bar Item'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': 'label',
|
'fieldname': u'label',
|
||||||
'fieldtype': 'Data',
|
'fieldtype': u'Data',
|
||||||
'label': 'Label'
|
'label': u'Label'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': 'std_page',
|
'fieldname': u'custom_page',
|
||||||
'fieldtype': 'Select',
|
'fieldtype': u'Link',
|
||||||
'label': 'Std Page',
|
'label': u'Page',
|
||||||
'options': 'Home\nAbout\nContact\nProducts\nBlog\nCustom'
|
'options': u'Page'
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': 'custom_page',
|
'fieldname': u'url',
|
||||||
'fieldtype': 'Link',
|
'fieldtype': u'Data',
|
||||||
'label': 'Custom Page',
|
'label': u'URL'
|
||||||
'options': 'Web Page'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
# DocField
|
# DocField
|
||||||
{
|
{
|
||||||
'doctype': 'DocField',
|
'doctype': u'DocField',
|
||||||
'fieldname': 'parent_label',
|
'fieldname': u'parent_label',
|
||||||
'fieldtype': 'Select',
|
'fieldtype': u'Select',
|
||||||
'label': 'Parent Label'
|
'label': u'Parent Label'
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -37,7 +37,7 @@ erpnext.topbar.TopBar = Class.extend({
|
|||||||
for(var i=0;i<items.length;i++) {
|
for(var i=0;i<items.length;i++) {
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
if(!item.parent_label && item.parentfield=='top_bar_items') {
|
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" \
|
$('header .nav:first').append(repl('<li><a href="#!%(route)s" \
|
||||||
data-label="%(label)s">%(label)s</a></li>', item))
|
data-label="%(label)s">%(label)s</a></li>', item))
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ erpnext.Footer = Class.extend({
|
|||||||
for(var i=0;i<items.length;i++) {
|
for(var i=0;i<items.length;i++) {
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
if(!item.parent_label && item.parentfield=='footer_items') {
|
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" \
|
$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
|
||||||
data-label="%(label)s">%(label)s</a></li>', item))
|
data-label="%(label)s">%(label)s</a></li>', item))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user