aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/html/users.html
blob: 8bffc2f827b86d8bf61dd65b09870f8a3b437f51 (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
{{ define "title"}}{{ t "Users" }}{{ end }}

{{ define "content"}}
<section class="page-header">
    <h1>{{ t "Users" }}</h1>
    <ul>
        <li>
            <a href="{{ route "settings" }}">{{ t "Settings" }}</a>
        </li>
        <li>
            <a href="{{ route "integrations" }}">{{ t "Integrations" }}</a>
        </li>
        <li>
            <a href="{{ route "sessions" }}">{{ t "Sessions" }}</a>
        </li>
        <li>
            <a href="{{ route "createUser" }}">{{ t "Add user" }}</a>
        </li>
        <li>
            <a href="{{ route "about" }}">{{ t "About" }}</a>
        </li>
    </ul>
</section>

{{ if eq (len .users) 1 }}
    <p class="alert">{{ t "You are the only user." }}</p>
{{ else }}
    <table>
        <tr>
            <th class="column-20">{{ t "Username" }}</th>
            <th>{{ t "Administrator" }}</th>
            <th>{{ t "Last Login" }}</th>
            <th>{{ t "Actions" }}</th>
        </tr>
        {{ range .users }}
            {{ if ne .ID $.user.ID }}
            <tr>
                <td>{{ .Username }}</td>
                <td>{{ if eq .IsAdmin true }}{{ t "Yes" }}{{ else }}{{ t "No" }}{{ end }}</td>
                <td>
                    {{ if .LastLoginAt }}
                        <time datetime="{{ isodate .LastLoginAt }}" title="{{ isodate .LastLoginAt }}">{{ elapsed $.user.Timezone .LastLoginAt }}</time>
                    {{ else }}
                        {{ t "Never" }}
                    {{ end }}
                </td>
                <td>
                    <a href="{{ route "editUser" "userID" .ID }}">{{ t "Edit" }}</a>,
                    <a href="#"
                        data-confirm="true"
                        data-label-question="{{ t "Are you sure?" }}"
                        data-label-yes="{{ t "yes" }}"
                        data-label-no="{{ t "no" }}"
                        data-label-loading="{{ t "Work in progress..." }}"
                        data-url="{{ route "removeUser" "userID" .ID }}">{{ t "Remove" }}</a>
                </td>
            </tr>
            {{ end }}
        {{ end }}
    </table>
{{ end }}

{{ end }}