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

{{ define "content"}}
<section class="page-header">
    <h1>{{ t "page.edit_user.title" .selected_user.Username }}</h1>
    <ul>
        <li>
            <a href="{{ route "settings" }}">{{ t "menu.settings" }}</a>
        </li>
        <li>
            <a href="{{ route "integrations" }}">{{ t "menu.integrations" }}</a>
        </li>
        <li>
            <a href="{{ route "sessions" }}">{{ t "menu.sessions" }}</a>
        </li>
        <li>
            <a href="{{ route "users" }}">{{ t "menu.users" }}</a>
        </li>
        <li>
            <a href="{{ route "createUser" }}">{{ t "menu.add_user" }}</a>
        </li>
        <li>
            <a href="{{ route "about" }}">{{ t "menu.about" }}</a>
        </li>
    </ul>
</section>

<form action="{{ route "updateUser" "userID" .selected_user.ID }}" method="post" autocomplete="off">
    <input type="hidden" name="csrf" value="{{ .csrf }}">

    {{ if .errorMessage }}
        <div class="alert alert-error">{{ t .errorMessage }}</div>
    {{ end }}

    <label for="form-username">{{ t "form.user.label.username" }}</label>
    <input type="text" name="username" id="form-username" value="{{ .form.Username }}" autocomplete="new-password" required autofocus>

    <label for="form-password">{{ t "form.user.label.password" }}</label>
    <input type="password" name="password" id="form-password" value="{{ .form.Password }}" autocomplete="new-password">

    <label for="form-confirmation">{{ t "form.user.label.confirmation" }}</label>
    <input type="password" name="confirmation" id="form-confirmation" value="{{ .form.Confirmation }}" autocomplete="new-password">

    <label><input type="checkbox" name="is_admin" value="1" {{ if .form.IsAdmin }}checked{{ end }}> {{ t "form.user.label.admin" }}</label>

    <div class="buttons">
        <button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.saving" }}">{{ t "action.update" }}</button> {{ t "action.or" }} <a href="{{ route "users" }}">{{ t "action.cancel" }}</a>
    </div>
</form>
{{ end }}