## -*- coding: utf-8; -*-
<%def name="make_simple_menu()">
% for topitem in menus:
${topitem.title}
% for subitem in topitem.items:
- ${h.link_to(subitem.title, subitem.url)}
% endfor
% endfor
## User Menu
% if request.user:
${request.user}${" ({})".format(inbox_count) if inbox_count else ''}
% if request.is_root:
- ${h.link_to("Stop being root", url('stop_root'))}
% elif request.is_admin:
- ${h.link_to("Become root", url('become_root'))}
% endif
- ${h.link_to("Messages{}".format(" ({})".format(inbox_count) if inbox_count else ''), url('messages.inbox'))}
- ${h.link_to("Change Password", url('change_password'))}
- ${h.link_to("Logout", url('logout'))}
% else:
${h.link_to("Login", url('login'))}
% endif
%def>
<%def name="main_menu_items()">
% if request.rattail_config.getbool('tailbone', 'menus.simple', default=False):
${self.make_simple_menu()}
% else:
% if request.has_any_perm('users.list', 'roles.list', 'settings.list', 'upgrades.list'):
Admin
% if request.has_perm('users.list'):
- ${h.link_to("Users", url('users'))}
% endif
% if request.has_perm('roles.list'):
- ${h.link_to("Roles", url('roles'))}
% endif
% if request.has_perm('settings.list'):
- ${h.link_to("Raw Settings", url('settings'))}
% endif
% if request.has_perm('upgrades.list'):
- ${h.link_to("Rattail Demo Upgrades", url('upgrades'))}
% endif
% endif
% if request.user:
${request.user}${" ({})".format(inbox_count) if inbox_count else ''}
% if request.is_root:
- ${h.link_to("Stop being root", url('stop_root'))}
% elif request.is_admin:
- ${h.link_to("Become root", url('become_root'))}
% endif
- ${h.link_to("Messages{}".format(" ({})".format(inbox_count) if inbox_count else ''), url('messages.inbox'))}
- ${h.link_to("Change Password", url('change_password'))}
- ${h.link_to("Logout", url('logout'))}
% else:
${h.link_to("Login", url('login'))}
% endif
% endif
%def>