Task Engine

/views/vtask/List.html (1.2 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
{% import (
"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"
"{{{ .Package }}}/app/lib/task"
"{{{ .Package }}}/views/components"
"{{{ .Package }}}/views/layout"
) %}

{% code type List struct {
layout.Basic
Tasks task.Tasks
} %}

{% func (p *List) Body(as *app.State, ps *cutil.PageState) %}
<div class="card">
<h3>{%= components.SVGIcon(`task`, ps) %} Registered Tasks</h3>
<div class="overflow full-width">
<table class="mt expanded">
<thead>
<tr>
<th></th>
<th>Key</th>
<th>Title</th>
</tr>
</thead>
<tbody>
{%- if len(p.Tasks) == 0 -%}
<tr>
<td colspan="3"><em>no tasks available</em></td>
</tr>
{%- endif -%}
{%- for _, t := range p.Tasks -%}
<tr>
<td class="shrink"><a href="{%s t.WebPath() %}">{%= components.SVGInline(t.IconSafe(), 16, ps) %}</a></td>
<td class="shrink"><a href="{%s t.WebPath() %}">{%s t.Key %}</a></td>
<td>{%s t.TitleSafe() %}</td>
</tr>
{%- endfor -%}
</tbody>
</table>
</div>
</div>
{% endfunc %}