lens @ 752ee7db471f3d5368f30a5841d5286465a8d5ab

 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>
14    <h1 class="title text-size-1">Medias</h1>
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>
46    <h1 class="title text-size-1">Users</h1>
47    {% for _, user := range p.Users %}
48    <div class="panel-block field">
49        <div class="columns wide-column is-gapless is-mobile">
50            <div class="column text-size-2">
51                {%s user.Username %}
52            </div>
53            <div class="column text-size-2">
54                {%s user.Path %}
55            </div>
56            <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>
57        </div>
58    </div>
59    {% endfor %}
60    <div class="field">
61        <a href="/users/" class="button">create</a>
62    </div>
63</div>
64{% endfunc %}
65
66{% func (p *SettingsPage) Script() %}
67{% endfunc %}