GoBlog/templates/editor.gohtml

77 lines
3.2 KiB
Plaintext
Raw Normal View History

{{ define "title" }}
<title>{{ string .Blog.Lang "editor" }} - {{ .Blog.Title }}</title>
{{ end }}
{{ define "main" }}
<main>
<h1>{{ string .Blog.Lang "editor" }}</h1>
<h2>{{ string .Blog.Lang "create" }}</h2>
<form class="fw-form p" method="post">
<input type="hidden" name="h" value="entry">
2021-06-07 18:27:28 +00:00
<textarea name="content" class="monospace h400p formcache" id="create-input">---
2021-01-17 11:53:07 +00:00
status: draft
blog: {{ .BlogString }}
2020-12-21 19:40:08 +00:00
section:
slug:
2021-01-17 11:53:07 +00:00
title:
tags:
-
2020-12-21 19:40:08 +00:00
---
</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>
<form class="fw-form 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>
<form class="fw-form 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>
2020-12-13 10:28:46 +00:00
<h2>{{ string .Blog.Lang "upload" }}</h2>
<form class="fw-form p" method="post" enctype="multipart/form-data">
<input type="hidden" name="editoraction" value="upload">
<input class="fw" 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>
2021-06-23 17:20:50 +00:00
{{ if .Data.Drafts }}
2021-01-15 20:56:46 +00:00
<h2>{{ string .Blog.Lang "drafts" }}</h2>
<form class="fw-form p" method="post">
2021-06-23 17:20:50 +00:00
<input type="hidden" name="editoraction" value="viewdraft">
2021-01-15 20:56:46 +00:00
<select name="url" class="fw">
{{ range $i, $draft := .Data.Drafts }}
<option value="{{ absolute $draft.Path }}">{{ with ($draft.Title) }}{{ . }}{{ else }}{{ $draft.Path }}{{ end }}</option>
2021-01-15 20:56:46 +00:00
{{ end }}
</select>
2021-06-23 17:20:50 +00:00
<input type="submit" value="{{ string .Blog.Lang "view" }}">
2021-01-15 20:56:46 +00:00
</form>
2021-06-23 17:20:50 +00:00
{{ end }}
2021-06-18 14:35:48 +00:00
<h2>{{ string .Blog.Lang "location" }}</h2>
<form class="fw-form p">
<input id="geobtn" type="button" class="fw" value="{{ string .Blog.Lang "locationget" }}" data-failed="{{ string .Blog.Lang "locationfailed" }}" data-notsupported="{{ string .Blog.Lang "locationnotsupported" }}">
<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 }}