aboutsummaryrefslogtreecommitdiff
path: root/templates/settings.qtpl
blob: 4207439c7d9d685f429ba3298ff3f23383a75581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{% 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 p.Settings.ShowMode %}checked{% endif %}>
                        Show File Modes
                    </label>
                </div>
            </div>
            <div class="field">
                <div class="control">
                    <label class="checkbox">
                        <input type="checkbox" id="showOwner" name="showOwner" {% if p.Settings.ShowOwner %}checked{% endif %}>
                        Show File Owner
                    </label>
                </div>
            </div>
            <div class="field">
                <div class="control">
                    <label class="checkbox">
                        <input type="checkbox" id="preloadVideoMetadata" name="preloadVideoMetadata" {% if p.Settings.PreloadVideoMetadata %}checked{% endif %}>
                        Preload video metadata
                    </label>
                </div>
            </div>
            <div class="field">
                <input class="button" value="save" type="submit">
            </div>
        </form>
    </div>
    <div class="column">
    {% for _, user := range p.Users %}
        <div class="panel-block">
            <div class="columns wide-column is-gapless is-mobile">
                <div class="column">
                    {%s user.Username %}
                </div>
                <div class="column">
                    {%s user.Path %}
                </div>
                <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>
            </div>
        </div>
    {% endfor %}
        <div class="field">
            <a href="/users/" class="button">Create</a>
        </div>
    </div>
</div>
{% endfunc %}

{% func (p *SettingsPage) Script() %}
{% endfunc %}