summaryrefslogtreecommitdiffstats
path: root/templates/admin/user/edit.tmpl
blob: 5975832f32fce10603657e455afcbbd2be9181a6 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{{template "base/head" .}}
{{template "base/navbar" .}}
<div id="body" class="container" data-page="admin">
    {{template "admin/nav" .}}
    <div id="admin-container" class="col-md-9">
        <div class="panel panel-default">
            <div class="panel-heading">
                Edit Account
            </div>

            <div class="panel-body">
            	<br/>
				<form action="/admin/users/{{.User.Id}}" method="post" class="form-horizontal">
				    {{.CsrfTokenHtml}}
				    {{template "base/alert" .}}
					<div class="form-group">
					    <label class="col-md-3 control-label">Auth Source: </label>
					    <div class="col-md-7">
						    <select name="logintype" class="form-control">
							    <option value="0-0">Local</option>
							    {{$tp := .User.LoginSource}}
							    {{range $key, $val := .LoginSources}}
			  					<option value="{{$val.Type}}-{{$val.Id}}"{{if eq $val.Id $tp}} selected{{end}}>{{$val.Name}}</option>
			  					{{end}}
							</select>
						</div>
					</div>

					<div class="form-group">
					    <label class="col-md-3 control-label">Auth Login Name: </label>
					    <div class="col-md-7">
							<input name="loginname" class="form-control" placeholder="Type auth login's username" value="{{.User.LoginName}}">
						</div>
					</div>

					<div class="form-group">
						<label class="col-md-3 control-label">Username: </label>
						<label class="control-label">{{.User.Name}}</label>
					</div>

					<div class="form-group {{if .Err_Email}}has-error has-feedback{{end}}">
						<label class="col-md-3 control-label">Email<strong class="text-danger">*</strong></label>
						<div class="col-md-7">
							<input name="email" class="form-control" placeholder="Type account's e-mail address" value="{{.User.Email}}" required="required">
						</div>
					</div>

					<div class="form-group">
						<label class="col-md-3 control-label">Password</label>
						<div class="col-md-7">
							<input name="passwd" type="password" class="form-control" placeholder="Type account's new password or leave unfilled">
						</div>
					</div>

	                <div class="form-group">
	                    <label class="col-md-3 control-label">Website</label>
	                    <div class="col-md-7">
	                        <input name="website" class="form-control" placeholder="Type account's website URL" value="{{.User.Website}}">
	                    </div>
	                </div>

	                <div class="form-group">
	                    <label class="col-md-3 control-label">Location</label>
	                    <div class="col-md-7">
	                        <input name="location" class="form-control" placeholder="Type account's current location" value="{{.User.Location}}">
	                    </div>
	                </div>

	                <div class="form-group {{if .Err_Avatar}}has-error has-feedback{{end}}">
	                    <label class="col-md-3 control-label">Gravatar Email<strong class="text-danger">*</strong></label>
	                    <div class="col-md-7">
	                        <input name="avatar" class="form-control" placeholder="Type account's Gravatar e-mail address" required="required" value="{{.User.AvatarEmail}}">
	                    </div>
	                </div>

	                <div class="form-group">
			            <div class="col-md-7 col-md-offset-3">
			                <div class="checkbox">
			                    <label>
			                        <input type="checkbox" name="active" {{if .User.IsActive}}checked{{end}}>
			                        <strong>This account is activated</strong>
			                    </label>
			                </div>
			            </div>
	                </div>

	                <div class="form-group">
			            <div class="col-md-7 col-md-offset-3">
			                <div class="checkbox">
			                    <label>
			                        <input type="checkbox" name="admin" {{if .User.IsAdmin}}checked{{end}}>
			                        <strong>This account has administrator permissions</strong>
			                    </label>
			                </div>
			            </div>
	                </div>
					<hr/>
					<div class="form-group">
					    <div class="col-md-offset-3 col-md-6">
					    	<button type="submit" class="btn btn-lg btn-primary btn-block">Update account profile</button>
					    	<a type="button" href="/admin/users/{{.User.Id}}/delete" class="btn btn-lg btn-danger btn-block">Delete this account</a>
					    </div>
					</div>
				</form>
            </div>
        </div>

	</div>
</div>
{{template "base/footer" .}}