<div id="nav-bar" class="nav-bar clearfix container-fluid">
	<div class="row no-gutters">
		<div class="col col-sm-9">
			{{#link-to "folders" class='nav-link' }}
				<div class="nav-title">{{appMeta.title}}</div>
				<div class="nav-msg text-truncate">{{appMeta.message}}</div>
			{{/link-to}}
		</div>
		<div class="col col-sm-3">
			<div class="nav-right">
				<div class="btn-group">
					{{#link-to "search" class="button-icon-white" }}
						<i class="material-icons">search</i>
					{{/link-to}}
				</div>

				{{#if session.authenticated}}
					{{#if hasPins}}
						<div class="button-icon-gap" />
						<div class="btn-group">
							<div class="button-icon-white" id="user-pins-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
								<i class="material-icons">star</i>
							</div>
							<div class="dropdown-menu dropdown-menu-right" aria-labelledby="user-pins-button">
								{{#if hasSpacePins}}
									<h6 class="dropdown-header">Spaces</h6>
									{{#each spacePins as |pin|}}
										<a class="dropdown-item" href="#" {{action 'jumpToPin' pin}} data-id= {{pin.id}} id="pin-{{pin.id}}">{{pin.pin}}</a>
									{{/each}}
								{{/if}}
								{{#if hasDocumentPins}}
									<h6 class="dropdown-header">Documents</h6>
									{{#each documentPins as |pin|}}
										<a class="dropdown-item" href="#" {{action 'jumpToPin' pin}} data-id= {{pin.id}} id="pin-{{pin.id}}">{{pin.pin}}</a>
									{{/each}}
								{{/if}}
							</div>
						</div>
					{{/if}}

					<div class="button-icon-gap" />
					<div class="btn-group">
						<div class="button-gravatar-white align-text-bottom" id="profile-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
							{{session.user.initials}}
							{{#if hasWhatsNew}}
								<div class="whats-new-dot" />
							{{/if}}
							{{#if session.isGlobalAdmin}}
								{{#if appMeta.updateAvailable}}
									<div class="update-available-dot" />
								{{/if}}
							{{/if}}
						</div>
						<div class="dropdown-menu dropdown-menu-right" aria-labelledby="profile-button">
							{{#link-to 'profile' class="dropdown-item" }}Profile{{/link-to}}
							{{#if session.isAdmin}}
								{{#link-to 'customize.general' class="dropdown-item" }}Settings{{/link-to}}
							{{/if}}
							<div class="dropdown-divider"></div>
							{{#if session.isGlobalAdmin}}
								{{#if appMeta.updateAvailable}}
									{{#link-to 'customize.license' class="dropdown-item font-weight-bold color-orange" }}Update available{{/link-to}}
								{{/if}}
							{{/if}}
							<a href="#" class="dropdown-item {{if hasWhatsNew 'color-whats-new font-weight-bold'}}" {{action 'onShowWhatsNewModal'}}>What's New</a>
							<a href="https://docs.documize.com" target="_blank" class="dropdown-item">Help</a>
							<a href="#" class="dropdown-item" data-toggle="modal" data-target="#about-documize-modal" data-backdrop="static">About</a>
							{{#if enableLogout}}
								<div class="dropdown-divider"></div>
								{{#link-to 'auth.logout' class="dropdown-item" }}Logout{{/link-to}}
							{{/if}}
						</div>
					</div>
				{{else}}
					<div class="button-icon-gap" />
					<div class="btn-group">
						{{#link-to 'auth.login' class="button-icon-white " }}
							<i class="material-icons">lock_open</i>
						{{/link-to}}
					</div>
				{{/if}}
			</div>
		</div>
	</div>
</div>

{{#if session.authenticated}}
	<div id="whats-new-modal" class="modal" tabindex="-1" role="dialog">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-header modal-header-white">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true" data-dismiss="modal" aria-label="Close">&times;</span>
				</button>
			</div>
			<div class="modal-content">
				<div class="modal-body">
					<div class="product-news">
						<h2>What's New</h2>

						{{{newsContent}}}

						<div class="action">
							Have an idea? Suggestion or feedback? <a href="mailto:support@documize.com">Get in touch!</a>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
				</div>
			</div>
		</div>
	</div>

	<div id="about-documize-modal" class="modal" tabindex="-1" role="dialog">
		<div class="modal-dialog modal-dialog-centered" role="document">
			<div class="modal-content">
				<div class="modal-body">
					<div class="product-about">
						<div class="edition">
							Documize {{appMeta.edition}} Edition
						</div>
						<div class="version">
							{{appMeta.version}}
						</div>
						<div class="dotcom">
							<a href="https://documize.com">https://documize.com</a>
						</div>
						{{#if (eq appMeta.edition 'Community')}}
							<div class="copyright">
								&copy; Documize Inc. All rights reserved.
							</div>
							<div class="license">
								<br/>
								<br/> This software (Documize Community Edition) is licensed under
								<a href="http://www.gnu.org/licenses/agpl-3.0.en.html">GNU AGPL v3</a>
								You can operate outside the AGPL restrictions by purchasing Documize Enterprise Edition and obtaining a commercial licenseby
								contacting
								<a href="mailto:sales@documize.com">sales@documize.com</a>
							</div>
						{{/if}}
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
				</div>
			</div>
		</div>
	</div>
{{/if}}