lens @ ff6b55491dec7ad1973dda37a35e2d9f47f75bcb

 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 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              {% if p.ShowMode %}{%s f.Info.Mode().String() %}&emsp;{% endif %}
26              {% if p.ShowOwner %}{%d f.GetGid() %}:{%d f.GetUid() %}&emsp;{% endif %}
27              {% if f.Info.IsDir() %}
28              <a href="/?path={%s f.UrlEncodedPath %}">{%s f.Info.Name() %}/</a>
29              {% else %}
30              {%s f.Info.Name() %}
31              {% endif %}
32          </div>
33          <div class="column  has-text-right">{%dl f.Info.Size() %} B</div>
34      </div>
35  </div>
36  {% endfor %}
37</div>
38{% endfunc %}
39
40{% func (p *FilePage) Script() %}
41{% endfunc %}