rattail-demo/rattail_demo/web/templates/menu.mako
Lance Edgar e9998cb597 Add basic support for datasync views
Still no actual daemon wired up yet, but can fake it for UI with this
2016-12-11 21:21:44 -06:00

155 lines
5.8 KiB
Mako

## -*- coding: utf-8 -*-
<%def name="main_menu_items()">
% if request.has_any_perm('schedule.view', 'schedule.viewall', 'schedule.edit', 'scheduledshifts.list'):
<li>
<a>Time Clock</a>
<ul>
% if request.has_perm('schedule.view'):
<li>${h.link_to("Personal Schedule", url('schedule.employee'))}</li>
% endif
% if request.has_perm('schedule.viewall'):
<li>${h.link_to("Full Schedule", url('schedule'))}</li>
% endif
% if request.has_perm('schedule.edit'):
<li>${h.link_to("Edit Schedule", url('schedule.edit'))}</li>
% endif
% if request.has_perm('scheduledshifts.list'):
<li>${h.link_to("Raw Scheduled Shifts", url('scheduledshifts'))}</li>
% endif
</ul>
</li>
% endif
% if request.has_any_perm('products.list', 'vendors.list', 'brands.list', 'families.list', 'reportcodes.list'):
<li>
<a>Products</a>
<ul>
% if request.has_perm('products.list'):
<li>${h.link_to("Products", url('products'))}</li>
% endif
% if request.has_perm('vendors.list'):
<li>${h.link_to("Vendors", url('vendors'))}</li>
% endif
% if request.has_perm('brands.list'):
<li>${h.link_to("Brands", url('brands'))}</li>
% endif
% if request.has_perm('families.list'):
<li>${h.link_to("Families", url('families'))}</li>
% endif
% if request.has_perm('reportcodes.list'):
<li>${h.link_to("Report Codes", url('reportcodes'))}</li>
% endif
</ul>
</li>
% endif
% if request.has_any_perm('people.list', 'customers.list', 'employees.list'):
<li>
<a>People</a>
<ul>
% if request.has_perm('people.list'):
<li>${h.link_to("All People", url('people'))}</li>
% endif
% if request.has_perm('customers.list'):
<li>${h.link_to("Customers", url('customers'))}</li>
% endif
% if request.has_perm('employees.list'):
<li>${h.link_to("Employees", url('employees'))}</li>
% endif
</ul>
</li>
% endif
% if request.has_any_perm('stores.list', 'departments.list', 'subdepartments.list'):
<li>
<a>Company</a>
<ul>
% if request.has_perm('stores.list'):
<li>${h.link_to("Stores", url('stores'))}</li>
% endif
% if request.has_perm('departments.list'):
<li>${h.link_to("Departments", url('departments'))}</li>
% endif
% if request.has_perm('subdepartments.list'):
<li>${h.link_to("Subdepartments", url('subdepartments'))}</li>
% endif
</ul>
</li>
% endif
% if request.has_any_perm('batch.handheld.list', 'batch.inventory.list'):
<li>
<a>Batches</a>
<ul>
% if request.has_perm('batch.handheld.list'):
<li>${h.link_to("Handheld", url('batch.handheld'))}</li>
% endif
% if request.has_perm('batch.inventory.list'):
<li>${h.link_to("Inventory", url('batch.inventory'))}</li>
% endif
</ul>
</li>
% endif
% if request.has_any_perm('tempmon.clients.list', 'tempmon.probes.list', 'tempmon.readings.list'):
<li>
<a>TempMon</a>
<ul>
% if request.has_perm('tempmon.clients.list'):
<li>${h.link_to("Clients", url('tempmon.clients'))}</li>
% endif
% if request.has_perm('tempmon.probes.list'):
<li>${h.link_to("Probes", url('tempmon.probes'))}</li>
% endif
% if request.has_perm('tempmon.readings.list'):
<li>${h.link_to("Readings", url('tempmon.readings'))}</li>
% endif
</ul>
</li>
% endif
% if request.has_any_perm('users.list', 'roles.list', 'emailprofiles.list', 'datasync.list', 'settings.list'):
<li>
<a>Admin</a>
<ul>
% if request.has_perm('users.list'):
<li>${h.link_to("Users", url('users'))}</li>
% endif
% if request.has_perm('roles.list'):
<li>${h.link_to("Roles", url('roles'))}</li>
% endif
% if request.has_perm('emailprofiles.list'):
<li>${h.link_to("Email Profiles", url('emailprofiles'))}</li>
% endif
% if request.has_perm('datasync.list'):
<li>${h.link_to("DataSync Changes", url('datasyncchanges'))}</li>
% endif
% if request.has_perm('settings.list'):
<li>${h.link_to("Settings", url('settings'))}</li>
% endif
</ul>
</li>
% endif
% if request.user:
<li>
<a${' class="root-user"' if request.is_root else ''|n}>${request.user}${" ({})".format(inbox_count) if inbox_count else ''}</a>
<ul>
% if request.is_root:
<li class="root-user">${h.link_to("Stop being root", url('stop_root'))}</li>
% elif request.is_admin:
<li class="root-user">${h.link_to("Become root", url('become_root'))}</li>
% endif
<li>${h.link_to("Messages{}".format(" ({})".format(inbox_count) if inbox_count else ''), url('messages.inbox'))}</li>
<li>${h.link_to("Change Password", url('change_password'))}</li>
<li>${h.link_to("Logout", url('logout'))}</li>
</ul>
</li>
% else:
<li>${h.link_to("Login", url('login'))}</li>
% endif
</%def>