<div class="master-navbar">
	<div class="nav-content">
		<div class="nav-options">
			{{#unless hideNavigation}}
				{{#link-to "folders" class=(if (eq selectedItem "spaces") "option selected" "option")}}
					<i class={{concat "dicon " constants.Icon.Grid}}></i>
					<div class="name">spaces</div>
				{{/link-to}}
				{{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}}
					{{#if session.viewDashboard}}
						{{#link-to "action" class=(if (eq selectedItem "actions") "option selected" "option")}}
							<i class={{concat "dicon " constants.Icon.ListBullet}}></i>
							<div class="name">actions</div>
						{{/link-to}}
						{{#link-to "activity" class=(if (eq selectedItem "activity") "option selected" "option")}}
							<i class={{concat "dicon " constants.Icon.Pulse}}></i>
							<div class="name">activity</div>
						{{/link-to}}
					{{/if}}
					{{#if session.viewAnalytics}}
						{{#link-to "analytics" class=(if (eq selectedItem "analytics") "option selected" "option")}}
							<i class={{concat "dicon " constants.Icon.BarChart}}></i>
							<div class="name">reports</div>
						{{/link-to}}
					{{/if}}
				{{/if}}
				{{#if (and session.authenticated session.isAdmin)}}
					{{#link-to "customize.general" class=(if (eq selectedItem "settings") "option selected" "option")}}
						<i class={{concat "dicon " constants.Icon.Settings}}></i>
						<div class="name">Settings</div>
					{{/link-to}}
				{{/if}}
				{{#link-to "search" class=(if (eq selectedItem "search") "option selected" "option")}}
					<i class={{concat "dicon " constants.Icon.Search}}></i>
					<div class="name">search</div>
				{{/link-to}}
			{{/unless}}
		</div>

		<div class="meta">
			{{#if session.isAdmin}}
				{{#unless appMeta.valid}}
					<div class="invalid-plan" {{action "onBilling"}}>
						<i class={{concat "dicon " constants.Icon.Handshake}} />
						{{#attach-tooltip}}Invalid product plan{{/attach-tooltip}}
					</div>
				{{/unless}}
			{{/if}}
			{{#if session.authenticated}}
				{{#if hasPins}}
					<div class="bookmarks" id="user-pins-button">
						<i class={{concat "dicon " constants.Icon.BookmarkSolid}}></i>
						{{#attach-popover class="ember-attacher-popper" hideOn="clickout" showOn="click" isShown=false}}
							<div class="menu">
								{{#if hasSpacePins}}
									<li class="item header">Spaces</li>
									{{#each spacePins as |pin|}}
										<a class="item" href="#" {{action "jumpToPin" pin}} data-id= {{pin.id}} id="pin-{{pin.id}}">{{pin.pin}}</a>
									{{/each}}
								{{/if}}
								{{#if hasDocumentPins}}
									<li class="item header">Content</li>
									{{#each documentPins as |pin|}}
										<a class="item" href="#" {{action "jumpToPin" pin}} data-id= {{pin.id}} id="pin-{{pin.id}}">{{pin.pin}}</a>
									{{/each}}
								{{/if}}
							</div>
						{{/attach-popover}}
					</div>
				{{/if}}
				<div class="user-gravatar-container">
					<div class="user-gravatar align-text-bottom" id="profile-button">
						{{session.user.initials}}
						{{#if hasWhatsNew}}
							<div class="whats-new-dot" />
						{{/if}}
						{{#if session.isGlobalAdmin}}
							{{#if appMeta.updateAvailable}}
								<div class="update-available-dot" />
							{{/if}}
						{{/if}}
						{{#attach-popover class="ember-attacher-popper" hideOn="clickout" showOn="click" isShown=false}}
							<div class="menu">
								{{#link-to "profile" class="item"}}Profile{{/link-to}}
								{{#if session.isAdmin}}
									<div class="divider"></div>
									{{#link-to "customize.general" class="item"}}Settings{{/link-to}}
									{{#unless appMeta.valid}}
										{{#link-to "customize.billing" class="item bold red"}}Update Billing{{/link-to}}
									{{/unless}}
								{{/if}}
								{{#if session.isGlobalAdmin}}
									{{#if appMeta.updateAvailable}}
										{{#link-to "customize.product" class="item bold yellow"}}Update available{{/link-to}}
									{{/if}}
								{{/if}}
								<div class="divider"></div>
								<a class={{if hasWhatsNew "item bold green" "item"}} href="#" {{action "onNew"}}>What's New</a>
								<a href="https://docs.documize.com" target="_blank" class="item">Help</a>
								{{#if enableLogout}}
									<div class="divider"></div>
									{{#link-to "auth.logout" class="item" }}Logout{{/link-to}}
								{{/if}}
							</div>
						{{/attach-popover}}
					</div>
				</div>
			{{else}}
				{{#link-to "auth.login" class="login"}}
					<i class={{concat "dicon " constants.Icon.Unlocked}}>
						{{#attach-tooltip showDelay=1000}}Login{{/attach-tooltip}}
					</i>
				{{/link-to}}
			{{/if}}
			<a class="logo" href="https://documize.com?ref=app">
				<img src="/assets/img/icon-white-64x64.png">
				<div class="documize">Documize</div>
				{{#attach-tooltip showDelay=1000}}Documize {{appMeta.edition}} Edition {{appMeta.version}}{{/attach-tooltip}}
			</a>
		</div>
	</div>
</div>
<div class="master-sidebar">
	<div class="sidebar-content">
		{{yield}}
	</div>
</div>
