GoBlog/templates/editor.gohtml

62 lines
3.1 KiB
Plaintext
Raw Normal View History

{{ define "title" }}
2021-08-04 20:48:50 +00:00
<title>{{ string .Blog.Lang "editor" }} - {{ mdtext .Blog.Title }}</title>
{{ end }}
{{ define "main" }}
<main>
<h1>{{ string .Blog.Lang "editor" }}</h1>
<h2>{{ string .Blog.Lang "create" }}</h2>
2021-08-01 17:27:21 +00:00
{{ md (editorpostdesc .BlogString) }}
2021-07-22 11:41:52 +00:00
<form class="fw p" method="post">
<input type="hidden" name="h" value="entry">
2021-07-31 12:19:37 +00:00
<textarea name="content" class="monospace h400p formcache" id="create-input">{{ editortemplate .BlogString }}</textarea>
2021-06-18 14:35:48 +00:00
<input type="submit" value="{{ string .Blog.Lang "create" }}">
</form>
<h2 id="update">{{ string .Blog.Lang "update" }}</h2>
2021-07-22 11:41:52 +00:00
<form class="fw p" method="post" action="#update">
{{ if .Data.UpdatePostURL }}
<input type="hidden" name="editoraction" value="updatepost">
<input type="hidden" name="url" value="{{ .Data.UpdatePostURL }}">
2020-12-21 19:40:08 +00:00
<textarea name="content" class="monospace h400p">{{ .Data.UpdatePostContent }}</textarea>
{{ else }}
<input type="hidden" name="editoraction" value="loadupdate">
2020-12-13 10:01:19 +00:00
<input type="url" name="url" placeholder="URL">
{{ end }}
2021-06-18 14:35:48 +00:00
<input type="submit" value="{{ string .Blog.Lang "update" }}">
</form>
<h2 id="delete">{{ string .Blog.Lang "delete" }}</h2>
2021-07-22 11:41:52 +00:00
<form class="fw p" method="post" action="#delete">
{{ if .Data.DeleteURL }}
<input type="hidden" name="action" value="delete">
<input type="url" name="url" placeholder="URL" value="{{ .Data.DeleteURL }}">
2021-06-18 14:35:48 +00:00
<input type="submit" value="{{ string .Blog.Lang "confirmdelete" }}">
{{ else }}
<input type="hidden" name="editoraction" value="loaddelete">
<input type="url" name="url" placeholder="URL">
2021-06-18 14:35:48 +00:00
<input type="submit" value="{{ string .Blog.Lang "delete" }}">
{{ end }}
</form>
<h2>{{ string .Blog.Lang "posts" }}</h2>
<p><a href="{{ .Blog.RelativePath "/editor/drafts" }}">{{ string .Blog.Lang "drafts" }}</a></p>
<p><a href="{{ .Blog.RelativePath "/editor/private" }}">{{ string .Blog.Lang "privateposts" }}</a></p>
<p><a href="{{ .Blog.RelativePath "/editor/unlisted" }}">{{ string .Blog.Lang "unlistedposts" }}</a></p>
2020-12-13 10:28:46 +00:00
<h2>{{ string .Blog.Lang "upload" }}</h2>
2021-07-22 11:41:52 +00:00
<form class="fw p" method="post" enctype="multipart/form-data">
2020-12-13 10:28:46 +00:00
<input type="hidden" name="editoraction" value="upload">
<input type="file" name="file">
2021-06-18 14:35:48 +00:00
<input type="submit" value="{{ string .Blog.Lang "upload" }}">
2020-12-13 10:28:46 +00:00
</form>
<p><a href="{{ .Blog.RelativePath "/editor/files" }}">{{ string .Blog.Lang "mediafiles" }}</a></p>
2021-06-18 14:35:48 +00:00
<h2>{{ string .Blog.Lang "location" }}</h2>
2021-07-22 11:41:52 +00:00
<form class="fw p">
<input id="geobtn" type="button" value="{{ string .Blog.Lang "locationget" }}" data-failed="{{ string .Blog.Lang "locationfailed" }}" data-notsupported="{{ string .Blog.Lang "locationnotsupported" }}">
2021-06-18 14:35:48 +00:00
<input id="geostatus" type="text" class="hide" readonly>
</form>
<script defer src="{{ asset "js/geohelper.js" }}"></script>
2021-06-07 18:27:28 +00:00
<script defer src="{{ asset "js/formcache.js" }}"></script>
</main>
{{ end }}
{{ define "editor" }}
{{ template "base" . }}
{{ end }}