lens @ dd6dc669fa232716cce0e2dbc5c4f7bd32296d66

 1{% import "git.sr.ht/~gabrielgio/img/pkg/service" %}
 2
 3{% code
 4type FilePage struct {
 5		Page      *service.Page
 6		ShowMode  bool
 7		ShowOwner bool
 8	}%}
 9
10{% func (p *FilePage) Title() %}Files{% endfunc %}
11
12{% func (p *FilePage) Content() %}
13<div class="panel">
14  <div class="panel-block">
15      <div class="columns file-row is-gapless is-mobile">
16          <div id="path" class="container-fluid">
17              <small>{% for _, h := range p.Page.History %}<a class="text-size-2" href="/fs?path={%s h.UrlEncodedPath %}" >{%s h.Name %}/</a>{% endfor %}</small>
18          </div>
19      </div>
20  </div>
21  {% for _, f := range p.Page.Files %}
22  <div class="panel-block">
23      <div class="columns wide-column is-mono is-gapless is-mobile">
24          <div class="column">
25              <span class="text-size-2">
26              {% if p.ShowMode %}{%s f.Info.Mode().String() %}&emsp;{% endif %}
27              {% if p.ShowOwner %}{%d f.GetGid() %}:{%d f.GetUid() %}&emsp;{% endif %}
28              {% if f.Info.IsDir() %}
29              </span>
30              <a class="text-size-2" href="/?path={%s f.UrlEncodedPath %}">{%s f.Info.Name() %}/</a>
31              {% else %}
32              {%s f.Info.Name() %}
33              {% endif %}
34          </div>
35          <div class="column text-size-2 has-text-right">{%dl f.Info.Size() %} B</div>
36      </div>
37  </div>
38  {% endfor %}
39</div>
40{% endfunc %}
41
42{% func (p *FilePage) Script() %}
43{% endfunc %}