From b8b6d3037c524575f140650ac243c16df6a98a92 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Wed, 19 Jul 2023 21:01:49 +0200 Subject: feat: Move last page to qtpl --- templates/fs.qtpl | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 templates/fs.qtpl (limited to 'templates/fs.qtpl') 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() %} +
+
+
+
+ {% for _, h := range p.Page.History %}{%s h.Name %}/{% endfor %} +
+
+
+ {% for _, f := range p.Page.Files %} +
+
+
+ {% if p.ShowMode %}{%s f.Info.Mode().String() %} {% endif %} + {% if p.ShowOwner %}{%d f.GetGid() %}:{%d f.GetUid() %} {% endif %} + {% if f.Info.IsDir() %} + {%s f.Info.Name() %}/ + {% else %} + {%s f.Info.Name() %} + {% endif %} +
+
{%dl f.Info.Size() %} B
+
+
+ {% endfor %} +
+{% endfunc %} + +{% func (p *FilePage) Script() %} +{% endfunc %} -- cgit v1.2.3