diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-19 20:24:19 +0200 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-07-19 21:00:27 +0200 |
commit | 52276ba99540d6c61195772ccdd50944e96f4959 (patch) | |
tree | 88f9ae39a76c063e99864bd8c4c84d63111ce3af /templates | |
parent | cd1fa849fb161d3bbc7c582aa2787315a1037db1 (diff) | |
download | lens-52276ba99540d6c61195772ccdd50944e96f4959.tar.gz lens-52276ba99540d6c61195772ccdd50944e96f4959.tar.bz2 lens-52276ba99540d6c61195772ccdd50944e96f4959.zip |
feat: Move settings from `html/template` to qtpl
Diffstat (limited to 'templates')
-rw-r--r-- | templates/settings.qtpl (renamed from templates/settings.html) | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/templates/settings.html b/templates/settings.qtpl index 8c08773..509cddd 100644 --- a/templates/settings.html +++ b/templates/settings.qtpl @@ -1,13 +1,22 @@ -{{template "layout.html" .}} -{{define "title"}} {{.Title}} {{end}} -{{define "content"}} +{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %} + +{% code +type SettingsPage struct { + Settings *repository.Settings + Users []*repository.User +} +%} + +{% func (p *SettingsPage) Title() %}Settings{% endfunc %} + +{% func (p *SettingsPage) Content() %} <div class="columns"> <div class="column is-one-third"> <form action="/settings/", method="post"> <div class="field"> <div class="control"> <label class="checkbox"> - <input type="checkbox" id="showMode" name="showMode" {{if .Data.Settings.ShowMode}}checked{{end}}> + <input type="checkbox" id="showMode" name="showMode" {% if p.Settings.ShowMode %}checked{% endif %}> Show File Modes </label> </div> @@ -15,7 +24,7 @@ <div class="field"> <div class="control"> <label class="checkbox"> - <input type="checkbox" id="showOwner" name="showOwner" {{if .Data.Settings.ShowOwner}}checked{{end}}> + <input type="checkbox" id="showOwner" name="showOwner" {% if p.Settings.ShowOwner %}checked{% endif %}> Show File Owner </label> </div> @@ -26,19 +35,22 @@ </form> </div> <div class="column"> - {{range .Data.Users}} + {% for _, user := range p.Users %} <div class="panel-block"> <div class="columns wide-column is-gapless is-mobile"> <div class="column"> - {{.Username}} + {%s user.Username %} </div> <div class="column"> - {{.Path}} + {%s user.Path %} </div> <div class="column has-text-right"><a href="#">Edit</a> / <a href="#" class="is-danger">Delete</a></div> </div> </div> - {{end}} + {% endfor %} </div> </div> -{{end}} +{% endfunc %} + +{% func (p *SettingsPage) Script() %} +{% endfunc %} |