Scripting

/views/vscripting/List.html (1.1 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
{% import (
"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"
"{{{ .Package }}}/app/util"
"{{{ .Package }}}/views/components"
"{{{ .Package }}}/views/layout"
) %}

{% code type List struct {
layout.Basic
Scripts []string
Sizes map[string]int
} %}

{% func (p *List) Body(as *app.State, ps *cutil.PageState) %}
<div class="card">
<div class="right"><a href="/admin/scripting/new"><button>New</button></a></div>
<h3>{%= components.SVGRefIcon(`sitemap`, ps) %} Scripts</h3>
<div class="mt">
<div class="overflow full-width">
<table class="min-200">
<thead>
<tr>
<th class="shrink">Name</th>
<th class="text-align-right">Size</th>
</tr>
</thead>
<tbody>
{%- for _, x := range p.Scripts -%}
<tr>
<td><a href="/admin/scripting/{%s x %}">{%s x %}</a></td>
<td class="text-align-right">{%s util.ByteSizeSI(int64(p.Sizes[x])) %}</td>
</tr>
{%- endfor -%}
</tbody>
</table>
</div>
</div>
</div>
{% endfunc %}