Core

/views/vtheme/Edit.html (1.6 KB)

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{% import (
"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"
"{{{ .Package }}}/app/lib/theme"
"{{{ .Package }}}/app/util"
"{{{ .Package }}}/views/components"
"{{{ .Package }}}/views/layout"
) %}

{% code type Edit struct {
layout.Basic
Theme *theme.Theme
Icon string
Exists bool
} %}

{% func (p *Edit) Body(as *app.State, ps *cutil.PageState) %}
<form action="/theme/save" method="post">
<input type="hidden" name="originalKey" value="{%s p.Theme.Key %}" />
<div class="card">
<div class="right">
{%- if p.Exists -%}
<a href="/theme/{%s p.Theme.Key %}/remove" class="link-confirm" data-message="Are you sure you wish to delete the [{%s p.Theme.Key %}] theme?"><button type="button">Remove</button></a>
{%- else -%}
<em>built-in</em>
{%- endif -%}
<a href="#modal-theme"><button type="button">JSON</button></a>
</div>
<h3>{% if p.Theme.Key == theme.KeyNew %}New Theme{% else %}Theme Edit{% endif %}</h3>
<div class="overflow full-width">
<table class="mt expanded">
<tbody>
{%= components.TableInput("key", "", "Key", p.Theme.Key, 5) %}
</tbody>
</table>
</div>
</div>
{%= Editor("Theme [" + p.Theme.Key + "]", util.AppName, p.Theme, p.Icon, as, ps) %}
<div class="card">
<button type="submit">Save All Changes</button>
<a href="/theme/{%u p.Theme.Key %}"><button type="button">Reset</button></a>
</div>
</form>
{%= components.JSONModal("theme", "Theme JSON", p.Theme, 1) %}
{% endfunc %}