Add menu for new 'bobcat' theme
This commit is contained in:
		
							parent
							
								
									71c60c58a1
								
							
						
					
					
						commit
						15c44196bc
					
				
					 2 changed files with 205 additions and 0 deletions
				
			
		
							
								
								
									
										7
									
								
								rattail_demo/web/templates/themes/bobcat/base.mako
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								rattail_demo/web/templates/themes/bobcat/base.mako
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| ## -*- coding: utf-8; -*- | ||||
| <%inherit file="tailbone:templates/themes/bobcat/base.mako" /> | ||||
| 
 | ||||
| ## NOTE: we must define this base template even though we just | ||||
| ## inherit from upstream bobcat! | ||||
| 
 | ||||
| ${parent.body()} | ||||
							
								
								
									
										198
									
								
								rattail_demo/web/templates/themes/bobcat/menu.mako
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								rattail_demo/web/templates/themes/bobcat/menu.mako
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,198 @@ | |||
| ## -*- coding: utf-8; -*- | ||||
| 
 | ||||
| <%def name="main_menu_items()"> | ||||
| 
 | ||||
|   <div class="navbar-start"> | ||||
| 
 | ||||
|     ## Time Clock | ||||
|     % if request.has_any_perm('schedule.view', 'schedule.viewall', 'schedule.edit', 'scheduledshifts.list'): | ||||
|         <div class="navbar-item has-dropdown is-hoverable"> | ||||
|           <a class="navbar-link">Time Clock</a> | ||||
|           <div class="navbar-dropdown"> | ||||
|             % if request.has_perm('schedule.view'): | ||||
|                 ${h.link_to("Personal Schedule", url('schedule.employee'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('schedule.viewall'): | ||||
|                 ${h.link_to("Full Schedule", url('schedule'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('schedule.edit'): | ||||
|                 ${h.link_to("Edit Schedule", url('schedule.edit'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('scheduledshifts.list'): | ||||
|                 ${h.link_to("Raw Scheduled Shifts", url('scheduledshifts'), class_='navbar-item')} | ||||
|             % endif | ||||
|           </div> | ||||
|         </div> | ||||
|     % endif | ||||
| 
 | ||||
|     ## Products | ||||
|     % if request.has_any_perm('products.list', 'vendors.list', 'departments.list', 'subdepartments.list', 'brands.list', 'families.list', 'reportcodes.list'): | ||||
|         <div class="navbar-item has-dropdown is-hoverable"> | ||||
|           <a class="navbar-link">Products</a> | ||||
|           <div class="navbar-dropdown"> | ||||
|             % if request.has_perm('products.list'): | ||||
|                 ${h.link_to("Products", url('products'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('vendors.list'): | ||||
|                 ${h.link_to("Vendors", url('vendors'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('departments.list'): | ||||
|                 ${h.link_to("Departments", url('departments'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('subdepartments.list'): | ||||
|                 ${h.link_to("Subdepartments", url('subdepartments'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('brands.list'): | ||||
|                 ${h.link_to("Brands", url('brands'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('families.list'): | ||||
|                 ${h.link_to("Families", url('families'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('reportcodes.list'): | ||||
|                 ${h.link_to("Report Codes", url('reportcodes'), class_='navbar-item')} | ||||
|             % endif | ||||
|           </div> | ||||
|         </div> | ||||
|     % endif | ||||
| 
 | ||||
|     ## People | ||||
|     % if request.has_any_perm('people.list', 'customers.list', 'employees.list'): | ||||
|         <div class="navbar-item has-dropdown is-hoverable"> | ||||
|           <a class="navbar-link">People</a> | ||||
|           <div class="navbar-dropdown"> | ||||
|             % if request.has_perm('people.list'): | ||||
|                 ${h.link_to("All People", url('people'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('customers.list'): | ||||
|                 ${h.link_to("Customers", url('customers'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('employees.list'): | ||||
|                 ${h.link_to("Employees", url('employees'), class_='navbar-item')} | ||||
|             % endif | ||||
|           </div> | ||||
|         </div> | ||||
|     % endif | ||||
| 
 | ||||
|     ## CORE-POS | ||||
|     % if request.has_any_perm('corepos.departments.list', 'corepos.subdepartments.list', 'corepos.vendors.list', 'corepos.products.list', 'corepos.customers.list', 'corepos.employees.list', 'corepos.transaction_details.list'): | ||||
|         <div class="navbar-item has-dropdown is-hoverable"> | ||||
|           <a class="navbar-link">CORE-POS</a> | ||||
|           <div class="navbar-dropdown"> | ||||
|             % if request.has_perm('corepos.departments.list'): | ||||
|                 ${h.link_to("Departments", url('corepos.departments'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('corepos.subdepartments.list'): | ||||
|                 ${h.link_to("Subdepartments", url('corepos.subdepartments'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('corepos.vendors.list'): | ||||
|                 ${h.link_to("Vendors", url('corepos.vendors'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('corepos.products.list'): | ||||
|                 ${h.link_to("Products", url('corepos.products'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('corepos.customers.list'): | ||||
|                 ${h.link_to("Customers", url('corepos.customers'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('corepos.employees.list'): | ||||
|                 ${h.link_to("Employees", url('corepos.employees'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('corepos.transaction_details.list'): | ||||
|                 ${h.link_to("Transaction Details", url('corepos.transaction_details'), class_='navbar-item')} | ||||
|             % endif | ||||
|           </div> | ||||
|         </div> | ||||
|     % endif | ||||
| 
 | ||||
|     ## Batches | ||||
|     % if request.has_any_perm('batch.handheld.list', 'batch.inventory.list', 'batch.importer.list'): | ||||
|         <div class="navbar-item has-dropdown is-hoverable"> | ||||
|           <a class="navbar-link">Batches</a> | ||||
|           <div class="navbar-dropdown"> | ||||
|             % if request.has_perm('batch.handheld.list'): | ||||
|                 ${h.link_to("Handheld", url('batch.handheld'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('batch.inventory.list'): | ||||
|                 ${h.link_to("Inventory", url('batch.inventory'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('batch.importer.list'): | ||||
|                 ${h.link_to("Import / Export", url('batch.importer'), class_='navbar-item')} | ||||
|             % endif | ||||
|           </div> | ||||
|         </div> | ||||
|     % endif | ||||
| 
 | ||||
|     ## TempMon | ||||
|     % if request.has_any_perm('tempmon.clients.list', 'tempmon.probes.list', 'tempmon.readings.list'): | ||||
|         <div class="navbar-item has-dropdown is-hoverable"> | ||||
|           <a class="navbar-link">TempMon</a> | ||||
|           <div class="navbar-dropdown"> | ||||
|             % if request.has_perm('tempmon.clients.list'): | ||||
|                 ${h.link_to("Clients", url('tempmon.clients'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('tempmon.probes.list'): | ||||
|                 ${h.link_to("Probes", url('tempmon.probes'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('tempmon.readings.list'): | ||||
|                 ${h.link_to("Readings", url('tempmon.readings'), class_='navbar-item')} | ||||
|             % endif | ||||
|           </div> | ||||
|         </div> | ||||
|     % endif | ||||
| 
 | ||||
|     ## Admin | ||||
|     % if request.has_any_perm('stores.list', 'users.list', 'userevents.list', 'roles.list', 'emailprofiles.list', 'datasync.list', 'settings.list', 'upgrades.list'): | ||||
|         <div class="navbar-item has-dropdown is-hoverable"> | ||||
|           <a class="navbar-link">Admin</a> | ||||
|           <div class="navbar-dropdown"> | ||||
|             % if request.has_perm('stores.list'): | ||||
|                 ${h.link_to("Stores", url('stores'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('users.list'): | ||||
|                 ${h.link_to("Users", url('users'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('userevents.list'): | ||||
|                 ${h.link_to("User Events", url('userevents'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('roles.list'): | ||||
|                 ${h.link_to("Roles", url('roles'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('emailprofiles.list'): | ||||
|                 ${h.link_to("Email Settings", url('emailprofiles'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('settings.list'): | ||||
|                 ${h.link_to("Raw Settings", url('settings'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('datasync.list'): | ||||
|                 ${h.link_to("DataSync Changes", url('datasyncchanges'), class_='navbar-item')} | ||||
|             % endif | ||||
|             % if request.has_perm('upgrades.list'): | ||||
|                 ${h.link_to("Rattail Demo Upgrades", url('upgrades'), class_='navbar-item')} | ||||
|             % endif | ||||
|           </div> | ||||
|         </div> | ||||
|     % endif | ||||
| 
 | ||||
|   </div><!-- navbar-start --> | ||||
|   <div class="navbar-end"> | ||||
| 
 | ||||
|     ## User Menu | ||||
|     % if request.user: | ||||
|         <div class="navbar-item has-dropdown is-hoverable"> | ||||
|           <a class="navbar-link ${'root-user' if request.is_root else ''}">${request.user}${" ({})".format(inbox_count) if inbox_count else ''}</a> | ||||
|           <div class="navbar-dropdown"> | ||||
|             % if request.is_root: | ||||
|                 ${h.link_to("Stop being root", url('stop_root'), class_='navbar-item root-user')} | ||||
|             % elif request.is_admin: | ||||
|                 ${h.link_to("Become root", url('become_root'), class_='navbar-item root-user')} | ||||
|             % endif | ||||
|             ${h.link_to("Messages{}".format(" ({})".format(inbox_count) if inbox_count else ''), url('messages.inbox'), class_='navbar-item')} | ||||
|             ${h.link_to("Change Password", url('change_password'), class_='navbar-item')} | ||||
|             ${h.link_to("Logout", url('logout'), class_='navbar-item')} | ||||
|           </div> | ||||
|         </div> | ||||
|     % else: | ||||
|         ${h.link_to("Login", url('login'), class_='navbar-item')} | ||||
|     % endif | ||||
| 
 | ||||
|   </div><!-- navbar-end --> | ||||
| </%def> | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar