diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-19 21:01:49 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-19 21:02:35 +0200 |
commit | b8b6d3037c524575f140650ac243c16df6a98a92 (patch) | |
tree | bf9dfb99481389b6714041bc36fd8f23a1db332b /templates/fs.qtpl | |
parent | fbcac585cf626917e2baf1d0065c7b632341ba01 (diff) | |
download | lens-b8b6d3037c524575f140650ac243c16df6a98a92.tar.gz lens-b8b6d3037c524575f140650ac243c16df6a98a92.tar.bz2 lens-b8b6d3037c524575f140650ac243c16df6a98a92.zip |
feat: Move last page to qtpl
Diffstat (limited to 'templates/fs.qtpl')
-rw-r--r-- | templates/fs.qtpl | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/templates/fs.qtpl b/templates/fs.qtpl new file mode 100644 index 0000000..489f79f --- /dev/null +++ b/templates/fs.qtpl @@ -0,0 +1,41 @@ +{% 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 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"> + {% if p.ShowMode %}{%s f.Info.Mode().String() %} {% endif %} + {% if p.ShowOwner %}{%d f.GetGid() %}:{%d f.GetUid() %} {% endif %} + {% if f.Info.IsDir() %} + <a href="/?path={%s f.UrlEncodedPath %}">{%s f.Info.Name() %}/</a> + {% else %} + {%s f.Info.Name() %} + {% endif %} + </div> + <div class="column has-text-right">{%dl f.Info.Size() %} B</div> + </div> + </div> + {% endfor %} +</div> +{% endfunc %} + +{% func (p *FilePage) Script() %} +{% endfunc %} |