filebrowser/templates/editor.tmpl

52 lines
1.7 KiB
Cheetah

{{ define "content" }}
<div class="editor {{ .Class }}">
<form method="POST" action="">
<div class="box scroll">
<main>
{{ if not (eq .Class "full") }}
<header>
<div class="content">
<h1>{{ .Name }}</h1>
</div>
</header>
{{ end }}
{{ if eq .Class "frontmatter-only" }}
<div class="sidebar">
<div class="content">
{{ template "frontmatter" .FrontMatter }}
</div>
</div>
{{ else if eq .Class "content-only" }}
<div class="container">
<div class="content">
<textarea id="content-area" name="content" class="scroll auto-size">{{ .Content }}</textarea>
<div id="preview-area" class="scroll hidden"></div>
</div>
</div>
{{ else }}
<div class="container">
<textarea id="content-area" name="content" class="scroll">{{ .Content }}</textarea>
<div id="preview-area" class="scroll hidden"></div>
</div>
<div class="sidebar scroll">
<h2>Metadata</h2>
{{ template "frontmatter" .FrontMatter }}
</div>
{{ end }}
</main>
</div>
<div class="action-bar">
{{ if or (eq .Extension "markdown") (eq .Extension "md") (eq .Class "full") }}
<button id="preview" class="left">Preview</button>
{{ else }}
<span class="left"></span>
{{ end }}
<input type="submit" data-message="Post saved." data-regenerate="false" value="Save">
<input type="submit" data-message="Post published successfully." data-regenerate="true" class="default" value="Publish">
</div>
</form>
</div>
{{ end }}