{{#unless editMode}}
	<div class="view-document">
		<div class="document-heading {{if canEdit 'cursor-pointer'}}" onclick={{if canEdit (action 'toggleEdit')}}>
			<h1 class="doc-title">
				{{#if document.template}}
					<span class="bg-warning p-1 pr-2 pl-2">Template</span>&nbsp;&nbsp;
				{{/if}}
				{{document.name}}
			</h1>
			<div class="doc-excerpt">{{document.excerpt}}</div>
		</div>
	</div>
{{else}}
	<form class="view-document" {{action "onSave" on="submit"}}>
		<div class="document-heading-edit">
			<div class="form-group">
				{{focus-input id="document-name" type="text" value=docName class=(if hasNameError 'form-control mousetrap is-invalid' 'form-control mousetrap') placeholder="Title" autocomplete="off"}}
			</div>
			<div class="form-group">
				{{textarea id="document-excerpt" rows="2" value=docExcerpt class=(if hasExcerptError 'form-control mousetrap is-invalid' 'form-control mousetrap') placeholder="Excerpt" autocomplete="off"}}
			</div>
			<button type="button" class="btn btn-outline-secondary" {{action "onCancel"}}>Cancel</button>
			<button type="submit" class="btn btn-success" {{action "onSave"}}>Save</button>
		</div>
	</form>
{{/unless}}
