2019-04-06 19:23:22 +02:00
|
|
|
{{define "view-page"}}
|
|
|
|
{{template "header" .}}
|
2019-04-11 19:56:07 +02:00
|
|
|
<style>
|
|
|
|
label {
|
|
|
|
display: block;
|
|
|
|
margin-top: 1em;
|
|
|
|
padding: 0 0 1em;
|
|
|
|
color: #666;
|
|
|
|
}
|
|
|
|
.content-desc {
|
|
|
|
font-size: 0.95em;
|
|
|
|
}
|
|
|
|
.page-desc {
|
|
|
|
margin: 0 0 0.5em;
|
|
|
|
}
|
|
|
|
textarea + .content-desc {
|
|
|
|
margin: 0.5em 0 1em;
|
|
|
|
font-style: italic;
|
|
|
|
}
|
|
|
|
input[type=text] {
|
|
|
|
/* Match textarea color. TODO: y is it like this thooo */
|
|
|
|
border-color: #ccc;
|
|
|
|
}
|
|
|
|
</style>
|
2019-04-06 19:23:22 +02:00
|
|
|
<div class="snug content-container">
|
|
|
|
{{template "admin-header" .}}
|
|
|
|
|
2019-06-27 23:06:37 +02:00
|
|
|
<h2 id="posts-header">{{if eq .Content.ID "landing"}}Home page{{else}}{{.Content.ID}} page{{end}}</h2>
|
2019-04-06 19:23:22 +02:00
|
|
|
|
|
|
|
{{if eq .Content.ID "about"}}
|
2019-04-11 19:56:07 +02:00
|
|
|
<p class="page-desc content-desc">Describe what your instance is <a href="/about" target="page">about</a>.</p>
|
2023-09-22 18:37:15 +02:00
|
|
|
{{else if eq .Content.ID "contact"}}
|
|
|
|
<p class="page-desc content-desc">Tell your users and outside visitors how to <a href="/contact" target="page">contact</a> you.</p>
|
2019-04-06 19:23:22 +02:00
|
|
|
{{else if eq .Content.ID "privacy"}}
|
2019-04-11 19:56:07 +02:00
|
|
|
<p class="page-desc content-desc">Outline your <a href="/privacy" target="page">privacy policy</a>.</p>
|
2019-08-09 17:16:38 +02:00
|
|
|
{{else if eq .Content.ID "reader"}}
|
|
|
|
<p class="page-desc content-desc">Customize your <a href="/read" target="page">Reader</a> page.</p>
|
2019-06-27 23:06:37 +02:00
|
|
|
{{else if eq .Content.ID "landing"}}
|
2019-07-02 01:05:47 +02:00
|
|
|
<p class="page-desc content-desc">Customize your <a href="/?landing=1" target="page">home page</a>.</p>
|
2019-04-06 19:23:22 +02:00
|
|
|
{{end}}
|
|
|
|
|
2019-04-11 19:56:07 +02:00
|
|
|
{{if .Message}}<p>{{.Message}}</p>{{end}}
|
|
|
|
|
2019-04-06 19:23:22 +02:00
|
|
|
<form method="post" action="/admin/update/{{.Content.ID}}" onsubmit="savePage(this)">
|
2019-08-09 17:16:38 +02:00
|
|
|
{{if .Banner}}
|
2019-06-27 23:06:37 +02:00
|
|
|
<label for="banner">
|
|
|
|
Banner
|
|
|
|
</label>
|
|
|
|
<textarea id="banner" class="section codable norm edit-page" style="min-height: 5em; height: 5em;" name="banner">{{.Banner.Content}}</textarea>
|
|
|
|
<p class="content-desc">We suggest a header (e.g. <code># Welcome</code>), optionally followed by a small bit of text. Accepts Markdown and HTML.</p>
|
|
|
|
{{else}}
|
2019-04-11 19:56:07 +02:00
|
|
|
<label for="title">
|
|
|
|
Title
|
|
|
|
</label>
|
|
|
|
<input type="text" name="title" id="title" value="{{.Content.Title.String}}" />
|
2019-06-27 23:06:37 +02:00
|
|
|
{{end}}
|
2019-04-11 19:56:07 +02:00
|
|
|
<label for="content">
|
2019-06-27 23:06:37 +02:00
|
|
|
{{if .Banner}}Body{{else}}Content{{end}}
|
2019-04-11 19:56:07 +02:00
|
|
|
</label>
|
|
|
|
|
|
|
|
<textarea id="content" class="section codable norm edit-page" name="content">{{.Content.Content}}</textarea>
|
|
|
|
|
|
|
|
<p class="content-desc">Accepts Markdown and HTML.</p>
|
|
|
|
|
2019-04-06 19:23:22 +02:00
|
|
|
<input type="submit" value="Save" />
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function savePage(el) {
|
|
|
|
var $btn = el.querySelector('input[type=submit]');
|
|
|
|
$btn.value = 'Saving...';
|
|
|
|
$btn.disabled = true;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{{template "footer" .}}
|
|
|
|
{{end}}
|