filebrowser/templates/editor.tmpl

62 lines
2.5 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="">
2016-01-31 22:14:17 +00:00
<div class="container">
2015-09-18 15:49:53 +00:00
<main>
2015-09-19 21:17:38 +00:00
{{ if not (eq .Class "complete") }}
2016-01-31 22:14:17 +00:00
<h1>{{ .Name }}{{ if eq .Class "frontmatter-only" }}
<span class="actions">
<button class="add">&#43;</button>
</span>{{ end }}
</h1>
2015-09-19 21:17:38 +00:00
{{ end }} {{ if eq .Class "frontmatter-only" }}
2016-01-31 22:14:17 +00:00
<div class="frontmatter blocks">
{{ template "frontmatter" .FrontMatter }}
2015-09-18 15:49:53 +00:00
</div>
{{ else if eq .Class "content-only" }}
2016-01-31 22:14:17 +00:00
<textarea id="content-area" name="content" class="scroll" data-mode="{{ .Mode }}">{{ .Content }}</textarea>
<div id="preview-area" class="scroll hidden"></div>
2015-09-18 15:49:53 +00:00
{{ else }}
2016-01-31 22:14:17 +00:00
<div class="frontmatter">
<h1><textarea>{{ .Name }}</textarea></h1>
<div class="blocks">
2015-09-18 15:49:53 +00:00
{{ template "frontmatter" .FrontMatter }}
2016-01-31 22:14:17 +00:00
</div>
2016-02-01 22:30:29 +00:00
<p class="actions">
<button class="add">Add field</button>
</p>
2016-01-31 22:14:17 +00:00
</div>
<div class="content">
<nav>
<a id="see-source"><i class="fa fa-code"></i> Source</a>
<a id="see-preview"><i class="fa fa-eye"></i> Preview</a>
</nav>
<textarea id="source-area" name="content" data-mode="{{ .Mode }}">{{ .Content }}</textarea>
<div id="preview-area"></div>
2015-09-18 15:49:53 +00:00
</div>
2016-01-31 22:14:17 +00:00
2015-09-18 15:49:53 +00:00
{{ end }}
</main>
2016-02-01 22:30:29 +00:00
<p class="toolbar">
2016-01-31 22:14:17 +00:00
{{ if or (eq .Mode "markdown") (eq .Class "complete") }}
<button id="preview" class="left">Preview</button>
{{ else }}
<span class="left"></span>
{{ end }}
<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"> {{ if and (eq .Class "complete") ( .IsPost ) }}
<input type="submit" data-type="{{ .Class }}" data-message="Post scheduled." data-schedule="true" value="Schedule"> {{ end }}
<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">
2016-02-01 22:30:29 +00:00
</p>
2015-09-18 15:49:53 +00:00
</div>
</form>
</div>
{{ end }}