2015-04-13 16:29:33 +09:00
|
|
|
<!--
|
2015-03-20 18:31:49 +09:00
|
|
|
|
2015-03-28 10:54:41 +09:00
|
|
|
Menu Component
|
2015-03-20 18:31:49 +09:00
|
|
|
|
2015-03-28 10:54:41 +09:00
|
|
|
menuName (String)
|
|
|
|
| The name of the menu
|
2015-03-20 18:31:49 +09:00
|
|
|
|
2015-03-28 10:54:41 +09:00
|
|
|
menuItems (Array)
|
|
|
|
| An array containing the contents of the menu
|
2015-03-20 18:31:49 +09:00
|
|
|
- route (String/Function) [optional]
|
|
|
|
- label (String/Function) [optional]
|
|
|
|
- description (String) [optional]
|
2015-03-25 18:19:22 +09:00
|
|
|
- itemClass (String) [optional]
|
|
|
|
| an optional CSS class
|
2015-03-21 17:52:15 +09:00
|
|
|
- adminOnly (Boolean) [optional]
|
2015-03-23 10:49:21 +09:00
|
|
|
| whether to only show the item to admins
|
2015-03-22 12:27:05 +09:00
|
|
|
- template (String) [optional]
|
2015-03-23 10:49:21 +09:00
|
|
|
| if a template is provided, it will override the route/label/description
|
2015-03-22 12:27:05 +09:00
|
|
|
- data (Object) [optional]
|
2015-03-23 10:49:21 +09:00
|
|
|
| data contexnt for the template
|
2015-03-20 18:31:49 +09:00
|
|
|
|
2015-03-28 10:54:41 +09:00
|
|
|
menuLabel (String) [optional]
|
2015-03-20 18:31:49 +09:00
|
|
|
|
2015-03-28 10:54:41 +09:00
|
|
|
menuClass (String) [optional]
|
|
|
|
| An optional default CSS class given to the menu
|
2015-03-23 10:32:56 +09:00
|
|
|
|
2015-04-08 11:57:53 +09:00
|
|
|
- menuCollapsed (Boolean) [optional]
|
|
|
|
| whether the menu should start out collapsed (only useful for accordion menus)
|
|
|
|
|
2015-03-28 10:54:41 +09:00
|
|
|
menuMode (String) [optional]
|
|
|
|
| "accordion", "dropdown", or "list" (defaults to "list")
|
2015-03-23 11:28:36 +09:00
|
|
|
|
2015-03-20 18:31:49 +09:00
|
|
|
-->
|
|
|
|
|
2015-03-28 10:54:41 +09:00
|
|
|
<template name="menuComponent">
|
|
|
|
<div class="menu {{menuClass}}">
|
|
|
|
<div class="menu-top-level" href="/">{{menuLabel}}</div>
|
|
|
|
<div class="menu-menu">
|
2015-04-08 09:30:57 +09:00
|
|
|
{{#with getMenuItems}}
|
2015-03-28 10:54:41 +09:00
|
|
|
<ul class="menu-contents" role="menu" aria-labelledby="dLabel">
|
2015-03-20 18:31:49 +09:00
|
|
|
{{#each this}}
|
2015-04-08 09:30:57 +09:00
|
|
|
{{#if hasTemplate}}
|
|
|
|
{{> Template.dynamic template=template data=data}}
|
|
|
|
{{else}}
|
|
|
|
<li class="menu-item {{itemClass}}">
|
|
|
|
<a class="menu-sub-level" href="{{itemRoute}}">
|
|
|
|
<span class="menu-label">{{itemLabel}}</span>
|
|
|
|
{{#if description}}<span class="menu-description">{{_ description}}</span>{{/if}}
|
|
|
|
</a>
|
|
|
|
</li>
|
2015-03-21 17:52:15 +09:00
|
|
|
{{/if}}
|
2015-03-20 18:31:49 +09:00
|
|
|
{{/each}}
|
2015-03-21 17:52:15 +09:00
|
|
|
</ul>
|
|
|
|
{{/with}}
|
2015-03-23 11:28:36 +09:00
|
|
|
<a class="show-more" href="#">
|
2015-03-24 13:13:04 +09:00
|
|
|
{{{icon "open"}}}
|
|
|
|
{{{icon "close"}}}
|
2015-03-23 11:28:36 +09:00
|
|
|
</a>
|
2015-03-20 18:31:49 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-04-13 16:29:33 +09:00
|
|
|
</template>
|