blog/root/admin/settings.gohtml

92 lines
3.0 KiB
Plaintext
Raw Normal View History

2017-11-15 14:55:15 +00:00
{{ define "title" }}Website Settings{{ end }}
{{ define "content" }}
<form action="/admin/settings" method="POST">
<input type="hidden" name="_csrf" value="{{ .CSRF }}">
2017-11-20 05:49:19 +00:00
<div class="card">
2017-11-15 14:55:15 +00:00
{{ with .Data.s }}
2017-11-20 05:49:19 +00:00
<div class="card-body">
2017-11-15 14:55:15 +00:00
<h3>The Basics</h3>
<div class="form-group">
<label for="title">Title</label>
<input type="text"
class="form-control"
2017-11-20 05:49:19 +00:00
name="title"
2017-11-15 14:55:15 +00:00
value="{{ .Site.Title }}"
placeholder="Website Title">
</div>
<div class="form-group">
<label for="admin-email">Admin Email</label>
<small class="text-muted">For getting notifications about comments, etc.</small>
2017-11-20 05:49:19 +00:00
<input type="text"
2017-11-15 14:55:15 +00:00
class="form-control"
2017-11-20 05:49:19 +00:00
name="admin-email"
2017-11-15 14:55:15 +00:00
value="{{ .Site.AdminEmail }}"
placeholder="name@domain.com">
</div>
<h3>Redis Cache</h3>
<p>
Using a <a href="https://redis.io/" target="_blank">Redis</a> cache can
boost the performance of the JSON database by caching documents in
memory instead of always reading from disk.
</p>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox"
class="form-check-input"
name="redis-enabled"
value="true"
{{ if .Redis.Enabled }}checked{{ end }}>
Enable Redis
</label>
</div>
<div class="form-group">
<label for="redis-host">Redis Host</label>
<input type="text"
class="form-control"
2017-11-20 05:49:19 +00:00
name="redis-host"
2017-11-15 14:55:15 +00:00
value="{{ .Redis.Host }}"
placeholder="localhost">
</div>
<div class="form-group">
<label for="redis-port">Port</label>
<input type="text"
class="form-control"
2017-11-20 05:49:19 +00:00
name="redis-port"
2017-11-15 14:55:15 +00:00
value="{{ .Redis.Port }}"
placeholder="6379">
</div>
<div class="form-group">
<label for="redis-db">DB Number</label>
<small class="text-muted">0-15</small>
<input type="text"
class="form-control"
2017-11-20 05:49:19 +00:00
name="redis-db"
2017-11-15 14:55:15 +00:00
value="{{ .Redis.DB }}"
placeholder="0">
</div>
<div class="form-group">
<label for="redis-prefix">Key Prefix</label>
<small class="text-muted">(optional)</small>
<input type="text"
class="form-control"
2017-11-20 05:49:19 +00:00
name="redis-prefix"
2017-11-15 14:55:15 +00:00
value="{{ .Redis.Prefix }}"
placeholder="blog:">
</div>
<div class="form-group">
2017-11-20 05:49:19 +00:00
<button type="submit" class="btn btn-primary">Save Settings</button>
<a href="/admin" class="btn btn-secondary">Cancel</a>
2017-11-15 14:55:15 +00:00
</div>
2017-11-20 05:49:19 +00:00
2017-11-15 14:55:15 +00:00
</div>
{{ end }}
</div>
</form>
{{ end }}