{{ui/ui-spacer size=300}}

<div class="title">label</div>
{{#if (eq space.labelId "")}}
	<div class="label">Unclassified</div>
{{else}}
	<div class="label" style={{{spaceLabel.bgColor}}}>{{spaceLabel.name}}</div>
{{/if}}

{{ui/ui-spacer size=200}}

<div class="title">filter</div>
<div class="list">
	<div class="item {{if (eq selectedFilter "space") "selected"}}" {{action "onDocumentFilter" "space" space.id}}>
		<i class={{concat "dicon " constants.Icon.Filter}} />
		<div class="name">All ({{documents.length}})</div>
	</div>
	{{#if hasCategories}}
		{{#if (gt rootDocCount 0)}}
			<div class="item {{if (eq selectedFilter "uncategorized") "selected"}}" {{action "onDocumentFilter" "uncategorized" space.id}}>
				<i class={{concat "dicon " constants.Icon.Filter}} />
				<div class="name">Uncategorized ({{rootDocCount}})</div>
			</div>
		{{/if}}
	{{/if}}
	{{#if permissions.documentTemplate}}
		<div class="item {{if (eq selectedFilter "template") "selected"}}" {{action "onDocumentFilter" "template" space.id}}>
			<i class={{concat "dicon " constants.Icon.Filter}} />
			<div class="name">Templates ({{templates.length}})</div>
		</div>
	{{/if}}
	{{#if permissions.documentLifecycle}}
		<div class="item {{if (eq selectedFilter "draft") "selected"}}" {{action "onDocumentFilter" "draft" space.id}}>
			<i class={{concat "dicon " constants.Icon.Filter}} />
			<div class="name">Drafts ({{documentsDraft.length}})</div>
		</div>
		<div class="item {{if (eq selectedFilter "live") "selected"}}" {{action "onDocumentFilter" "live" space.id}}>
			<i class={{concat "dicon " constants.Icon.Filter}} />
			<div class="name">Live ({{documentsLive.length}})</div>
		</div>
	{{/if}}
</div>

{{ui/ui-spacer size=200}}

<div class="title">category</div>
<div class="list">
	{{#if categories}}
		{{#each categories as |cat|}}
			<div class="item {{if cat.selected "selected"}}" {{action "onDocumentFilter" "category" cat.id}}>
				<i class={{concat "dicon " constants.Icon.Category}} />
				<div class="name">{{cat.category}} ({{cat.docCount}})</div>
			</div>
		{{/each}}
	{{else}}
	{{/if}}
</div>
