<template name="AdminSidebar">
	<aside class="main-sidebar">
		<div class="sidebar">
			<ul class="sidebar-menu">
				<li class="{{isActiveRoute 'adminDashboard'}}">
					<a href="{{pathFor 'adminDashboard'}}">
						<i class="fa fa-dashboard"></i> <span>Dashboard</span>
					</a>
				</li>
				{{#each admin_collections}}
					{{#unless $eq showInSideBar false}}
					<li class="treeview">
						<a href="#">
							<i class="fa fa-{{this.icon}}"></i>
							<span>{{this.label}}</span>
							<i class="fa fa-angle-left pull-right"></i>
						</a>
						<ul class="treeview-menu">
							<li class="{{isActivePath path=newPath}}"><a href="{{newPath}}"><i class="fa fa-angle-double-right"></i> New</a></li>
							<li class="{{isActivePath path=viewPath}}"><a href="{{viewPath}}"><i class="fa fa-angle-double-right"></i> View All</a></li>
							{{#each admin_collection_items}}
							<li class="{{isActivePath path=url}}"><a href="{{url}}"><i class="fa fa-angle-double-right"></i> {{title}}</a></li>
							{{/each}}
						</ul>
					</li>
					{{/unless}}
				{{/each}}
				{{#each admin_sidebar_items}}
					{{#if options.urls}}
						{{> adminSidebarItemTree}}
					{{else}}
						{{> adminSidebarItem}}
					{{/if}}
				{{/each}}
			</ul>
		</div>
	</aside>
</template>

<template name="adminSidebarItem">
	<li class="{{isActivePath path=url}}">
		<a href="{{url}}">
			{{#if options.icon}}
			<i class="fa fa-{{options.icon}}"></i>
			{{/if}}
			<span>{{title}}</span>
		</a>
	</li>
</template>

<template name="adminSidebarItemTree">
	<li class="treeview">
		<a href="#">
			{{#if options.icon}}
			<i class="fa fa-{{options.icon}}"></i>
			{{/if}}
			<span>{{title}}</span>
			<i class="fa fa-angle-left pull-right"></i>
		</a>
		<ul class="treeview-menu">
			{{#each options.urls}}
			<li class="{{isActivePath path=url}}"><a href="{{url}}"><i class="fa fa-angle-double-right"></i>{{title}}</a></li>
			{{/each}}
		</ul>
	</li>
</template>
