filebrowser/templates/editor.tmpl

53 lines
2.1 KiB
Cheetah
Raw Normal View History

2015-09-18 15:49:53 +00:00
{{ define "content" }}
2015-09-18 18:12:47 +00:00
2015-09-18 15:49:53 +00:00
<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">
2015-09-19 13:25:35 +00:00
<textarea id="content-area" name="content" class="scroll" data-extension="{{ .Extension }}">{{ .Content }}</textarea>
2015-09-18 15:49:53 +00:00
<div id="preview-area" class="scroll hidden"></div>
</div>
</div>
{{ else }}
<div class="container">
2015-09-19 13:25:35 +00:00
<textarea id="content-area" name="content" class="scroll" data-extension="{{ .Extension }}">{{ .Content }}</textarea>
2015-09-18 15:49:53 +00:00
<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 }}
2015-09-18 18:12:47 +00:00
<input type="submit" data-type="{{ .Class }}" data-message="{{ if eq .Class "frontmatter-only" }}The fields were put on their way.{{ else if eq .Class "content-only" }}Every byte was saved.{{ else }}Post saved with pomp and circumstance.{{ end }}" data-regenerate="false" value="Save">
<input type="submit" data-type="{{ .Class }}" data-message="{{ if eq .Class "frontmatter-only" }}Saved and regenerated.{{ else if eq .Class "content-only" }}Done. What do you want more?{{ else }}Post published. Go and share it!{{ end }}" data-regenerate="true" class="default" value="Publish">
2015-09-18 15:49:53 +00:00
</div>
</form>
</div>
{{ end }}