{{#layout/master-sidebar}}
	{{ui/ui-spacer size=300}}
	<div class="section">
		{{#link-to "document.index"}}
			{{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.ArrowLeft label="Document"}}
		{{/link-to}}

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

		<div class="title">Document Options</div>
		<div class="list">
			<div class="item {{if (eq tab "general") "selected"}}" {{action "onTab" "general"}}>
				<i class={{concat "dicon " constants.Icon.Settings}} />
				<div class="name">Content Settings</div>
			</div>
			<div class="item {{if (eq tab "category") "selected"}}" {{action "onTab" "category"}}>
				<i class={{concat "dicon " constants.Icon.Category}} />
				<div class="name">Categories</div>
			</div>
			<div class="item {{if (eq tab "tag") "selected"}}" {{action "onTab" "tag"}}>
				<i class={{concat "dicon " constants.Icon.Tag}} />
				<div class="name">Tags</div>
			</div>
			{{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}}
				{{#if model.permissions.documentApprove}}
					<div class="item {{if (eq tab "protection") "selected"}}" {{action "onTab" "protection"}}>
						<i class={{concat "dicon " constants.Icon.Locked}} />
						<div class="name">Change Control</div>
					</div>
				{{/if}}
				{{#if model.permissions.documentVersion}}
					<div class="item {{if (eq tab "versions") "selected"}}" {{action "onTab" "versions"}}>
						<i class={{concat "dicon " constants.Icon.Copy}} />
						<div class="name">Versions</div>
					</div>
				{{/if}}
			{{/if}}
		</div>
	</div>
{{/layout/master-sidebar}}

{{#layout/master-content}}
	{{#if (eq tab "general")}}
		{{document/settings-general
			space=model.folder
			document=model.document
			permissions=model.permissions
			onSaveDocument=(action "onSaveDocument")}}
	{{/if}}

	{{#if (eq tab "category")}}
		{{document/settings-category
			space=model.folder
			document=model.document
			permissions=model.permissions
			onSaveDocument=(action "onSaveDocument")}}
	{{/if}}

	{{#if (eq tab "tag")}}
		{{document/settings-tag
			space=model.folder
			document=model.document
			permissions=model.permissions
			onSaveDocument=(action "onSaveDocument")}}
	{{/if}}

	{{#if (eq tab "protection")}}
		{{document/settings-protection
			space=model.folder
			spaces=model.folders
			document=model.document
			permissions=model.permissions
			onRefresh=(action "onRefresh")
			onSaveDocument=(action "onSaveDocument")}}
	{{/if}}

	{{#if (eq tab "versions")}}
		{{enterprise/settings-version
			space=model.folder
			spaces=model.folders
			document=model.document
			permissions=model.permissions
			versions=model.versions
			onRefresh=(action "onRefresh")
			onSaveDocument=(action "onSaveDocument")}}
	{{/if}}
{{/layout/master-content}}
