Index added to menubar
This commit is contained in:
parent
f8cbb6ee4d
commit
fd5c50c662
@ -22,6 +22,7 @@ ATTACHMENT_UID = 'attachment'
|
|||||||
BACK_UID = 'back'
|
BACK_UID = 'back'
|
||||||
EDIT_UID = 'edit'
|
EDIT_UID = 'edit'
|
||||||
HELP_UID = 'help'
|
HELP_UID = 'help'
|
||||||
|
INDEX_UID = 'index'
|
||||||
NAVIGATION_ENTRY_UID = 'navigation-%s'
|
NAVIGATION_ENTRY_UID = 'navigation-%s'
|
||||||
|
|
||||||
|
|
||||||
@ -81,18 +82,30 @@ def navigation_entry_parameters(request, path):
|
|||||||
def menubar(context, request, caller_name, **kwargs):
|
def menubar(context, request, caller_name, **kwargs):
|
||||||
bar = context[context.MENUBAR]
|
bar = context[context.MENUBAR]
|
||||||
menubar_users(bar, request)
|
menubar_users(bar, request)
|
||||||
add_help_menu(request, bar)
|
add_help_menu(request, bar, "current_help_page" in kwargs)
|
||||||
|
add_index_menu(request, bar, kwargs.get("rel_path", ''))
|
||||||
finalise_bar(request, bar)
|
finalise_bar(request, bar)
|
||||||
|
|
||||||
|
|
||||||
def add_help_menu(request, bar):
|
def add_help_menu(request, bar, active):
|
||||||
bar.append_entry(
|
bar.append_entry(
|
||||||
HELP_UID, # uid
|
HELP_UID, # uid
|
||||||
_('Help'), # name
|
_('Help'), # name
|
||||||
color_icon_url(request, 'help.png'), # icon
|
color_icon_url(request, 'help.png'), # icon
|
||||||
pages.url_helpview(request, 'main'), # url
|
pages.url_helpview(request, 'main'), # url
|
||||||
True, # left
|
True, # left
|
||||||
False # active
|
active # active
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def add_index_menu(request, bar, rel_path):
|
||||||
|
bar.append_entry(
|
||||||
|
INDEX_UID, # uid
|
||||||
|
_('Index'), # name
|
||||||
|
color_icon_url(request, 'info.png'), # icon
|
||||||
|
pages.url_page(request, 'index'), # url
|
||||||
|
True, # left
|
||||||
|
request.path == "/page/index" # active
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user