mirror of
https://github.com/writefreely/writefreely
synced 2025-03-04 14:37:12 +00:00
This adds a "Pages" section to the admin part of the site, and enables admins to edit the pre-defined About and Privacy pages there, instead of on the dashboard itself. It also restructures how these pages get sent around in the backend and lays the groundwork for dynamically adding static pages. The backend changes were made with more customization in mind, such as an instance-wide custom stylesheet (T563). Ref T566
34 lines
992 B
Cheetah
34 lines
992 B
Cheetah
{{define "view-page"}}
|
|
{{template "header" .}}
|
|
<div class="snug content-container">
|
|
{{template "admin-header" .}}
|
|
|
|
<h2 id="posts-header">{{.Content.ID}} page</h2>
|
|
|
|
{{if .Message}}<p>{{.Message}}</p>{{end}}
|
|
|
|
{{if eq .Content.ID "about"}}
|
|
<p>Describe what your instance is <a href="/about" target="page">about</a>. <em>Accepts Markdown</em>.</p>
|
|
{{else if eq .Content.ID "privacy"}}
|
|
<p>Outline your <a href="/privacy" target="page">privacy policy</a>. <em>Accepts Markdown</em>.</p>
|
|
{{else}}
|
|
<p><em>Accepts Markdown and HTML</em>.</p>
|
|
{{end}}
|
|
|
|
<form method="post" action="/admin/update/{{.Content.ID}}" onsubmit="savePage(this)">
|
|
<textarea id="about-editor" class="section codable norm edit-page" name="content">{{.Content.Content}}</textarea>
|
|
<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}}
|