blob: 3dc2c5ab5912b7c9241d8a7a49a1ad5a9cf6051d (
plain)
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 "git.sr.ht/~gabrielgio/img/pkg/service" %}
{% code
type FilePage struct {
Page *service.Page
ShowMode bool
ShowOwner bool
}%}
{% func (p *FilePage) Title() %}Files{% endfunc %}
{% func (p *FilePage) Content() %}
<div class="panel">
<div class="panel-block">
<div class="columns file-row is-gapless is-mobile">
<div id="path" class="container-fluid">
<small>{% for _, h := range p.Page.History %}<a class="text-size-2" href="/fs?path={%s h.UrlEncodedPath %}" >{%s h.Name %}/</a>{% endfor %}</small>
</div>
</div>
</div>
{% for _, f := range p.Page.Files %}
<div class="panel-block">
<div class="columns wide-column is-mono is-gapless is-mobile">
<div class="column">
<span class="text-size-2">
{% if p.ShowMode %}{%s f.Info.Mode().String() %} {% endif %}
{% if p.ShowOwner %}{%d f.GetGid() %}:{%d f.GetUid() %} {% endif %}
{% if f.Info.IsDir() %}
</span>
<a class="text-size-2" href="/?path={%s f.UrlEncodedPath %}">{%s f.Info.Name() %}/</a>
{% else %}
{%s f.Info.Name() %}
{% endif %}
</div>
<div class="column text-size-2 has-text-right">{%dl f.Info.Size() %} B</div>
</div>
</div>
{% endfor %}
</div>
{% endfunc %}
{% func (p *FilePage) Script() %}
{% endfunc %}
|