lens @ a1f09d1f143012570a62bcb2a8fe51c439ad68fb

 1{% import "git.sr.ht/~gabrielgio/img/pkg/database/repository" %}
 2
 3{% code
 4type SettingsPage struct {
 5    Settings *repository.Settings
 6    Users    []*repository.User
 7}
 8%}
 9
10{% func (p *SettingsPage) Title() %}Settings{% endfunc %}
11
12{% func (p *SettingsPage) Content() %}
13<div class="columns">
14    <div class="column is-one-third">
15        <form action="/settings/", method="post">
16            <div class="field">
17                <div class="control">
18                    <label class="checkbox text-size-2">
19                        <input type="checkbox" id="showMode" name="showMode" {% if p.Settings.ShowMode %}checked{% endif %}>
20                        Show File Modes
21                    </label>
22                </div>
23            </div>
24            <div class="field">
25                <div class="control">
26                    <label class="checkbox text-size-2">
27                        <input type="checkbox" id="showOwner" name="showOwner" {% if p.Settings.ShowOwner %}checked{% endif %}>
28                        Show File Owner
29                    </label>
30                </div>
31            </div>
32            <div class="field">
33                <div class="control">
34                    <label class="checkbox text-size-2">
35                        <input type="checkbox" id="preloadVideoMetadata" name="preloadVideoMetadata" {% if p.Settings.PreloadVideoMetadata %}checked{% endif %}>
36                        Preload video metadata
37                    </label>
38                </div>
39            </div>
40            <div class="field">
41                <input class="button" value="save" type="submit">
42            </div>
43        </form>
44    </div>
45    <div class="column">
46    {% for _, user := range p.Users %}
47        <div class="panel-block field">
48            <div class="columns wide-column is-gapless is-mobile">
49                <div class="column text-size-2">
50                    {%s user.Username %}
51                </div>
52                <div class="column text-size-2">
53                    {%s user.Path %}
54                </div>
55                <div class="column  has-text-right"><a href="/users?userId={%s FromUInttoString(&user.ID) %}">Edit</a> <a href="/users/delete?userId={%s FromUInttoString(&user.ID) %}" class="is-danger">Delete</a></div>
56            </div>
57        </div>
58    {% endfor %}
59        <div class="field">
60            <a href="/users/" class="button">create</a>
61        </div>
62    </div>
63</div>
64{% endfunc %}
65
66{% func (p *SettingsPage) Script() %}
67{% endfunc %}