Simple blogging system written in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.2 KiB

{{ define "title" }}
<title>{{ string .Blog.Lang "editor" }} - {{ .Blog.Title }}</title>
{{ end }}
{{ define "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">
<textarea name="content" class="monospace h400p formcache" id="create-input">---
status: draft
blog: {{ .BlogString }}
<input type="submit" value="{{ string .Blog.Lang "create" }}">
<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 }}">
<textarea name="content" class="monospace h400p">{{ .Data.UpdatePostContent }}</textarea>
{{ else }}
<input type="hidden" name="editoraction" value="loadupdate">
<input type="url" name="url" placeholder="URL">
{{ end }}
<input type="submit" value="{{ string .Blog.Lang "update" }}">
<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 }}">
<input type="submit" value="{{ string .Blog.Lang "confirmdelete" }}">
{{ else }}
<input type="hidden" name="editoraction" value="loaddelete">
<input type="url" name="url" placeholder="URL">
<input type="submit" value="{{ string .Blog.Lang "delete" }}">
{{ end }}
<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">
<input type="submit" value="{{ string .Blog.Lang "upload" }}">
{{ if .Data.Drafts }}
<h2>{{ string .Blog.Lang "drafts" }}</h2>
<form class="fw-form p" method="post">
<input type="hidden" name="editoraction" value="viewdraft">
<select name="url" class="fw">
{{ range $i, $draft := .Data.Drafts }}
<option value="{{ absolute $draft.Path }}">{{ with ($draft.Title) }}{{ . }}{{ else }}{{ $draft.Path }}{{ end }}</option>
{{ end }}
<input type="submit" value="{{ string .Blog.Lang "view" }}">
{{ end }}
<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>
<script defer src="{{ asset "js/geohelper.js" }}"></script>
<script defer src="{{ asset "js/formcache.js" }}"></script>
{{ end }}
{{ define "editor" }}
{{ template "base" . }}
{{ end }}