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

{{ define "content"}}
<section class="page-header">
    <h1>{{ t "page.users.title" }}</h1>
    {{ template "settings_menu" dict "user" .user }}
</section>

{{ if eq (len .users) 1 }}
    <p class="alert">{{ t "alert.no_user" }}</p>
{{ else }}
    <table>
        <tr>
            <th class="column-20">{{ t "page.users.username" }}</th>
            <th>{{ t "page.users.is_admin" }}</th>
            <th>{{ t "page.users.last_login" }}</th>
            <th>{{ t "page.users.actions" }}</th>
        </tr>
        {{ range .users }}
            {{ if ne .ID $.user.ID }}
            <tr>
                <td>{{ .Username }}</td>
                <td>{{ if eq .IsAdmin true }}{{ t "page.users.admin.yes" }}{{ else }}{{ t "page.users.admin.no" }}{{ end }}</td>
                <td>
                    {{ if .LastLoginAt }}
                        <time datetime="{{ isodate .LastLoginAt }}" title="{{ isodate .LastLoginAt }}">{{ elapsed $.user.Timezone .LastLoginAt }}</time>
                    {{ else }}
                        {{ t "page.users.never_logged" }}
                    {{ end }}
                </td>
                <td>
                    <a href="{{ route "editUser" "userID" .ID }}">{{ t "action.edit" }}</a>,
                    <a href="#"
                        data-confirm="true"
                        data-label-question="{{ t "confirm.question" }}"
                        data-label-yes="{{ t "confirm.yes" }}"
                        data-label-no="{{ t "confirm.no" }}"
                        data-label-loading="{{ t "confirm.loading" }}"
                        data-url="{{ route "removeUser" "userID" .ID }}">{{ t "action.remove" }}</a>
                </td>
            </tr>
            {{ end }}
        {{ end }}
    </table>
{{ end }}

{{ end }}