summaryrefslogtreecommitdiffstats
path: root/templates/user/settings/security_u2f.tmpl
blob: 8fe01d8c70156e9b1093648850851c01b239241f (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
<h4 class="ui top attached header">
{{.i18n.Tr "settings.u2f"}}
</h4>
<div class="ui attached segment">
	<p>{{.i18n.Tr "settings.u2f_desc" | Str2html}}</p>
	{{if .TwofaEnrolled}}
		<div class="ui key list">
			{{range .U2FRegistrations}}
				<div class="item">
					<div class="right floated content">
						<button class="ui red tiny button delete-button" data-modal-id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}">
						{{$.i18n.Tr "settings.delete_key"}}
						</button>
					</div>
					<div class="content">
						<strong>{{.Name}}</strong>
					</div>
				</div>
			{{end}}
		</div>
		<div class="ui form">
			{{.CsrfTokenHtml}}
			<div class="required field">
				<label for="nickname">{{.i18n.Tr "settings.u2f_nickname"}}</label>
				<input id="nickname" name="nickname" type="text" required>
			</div>
			<button id="register-security-key" class="ui green button">{{svg "octicon-key"}} {{.i18n.Tr "settings.u2f_register_key"}}</button>
		</div>
	{{else}}
		<b>{{.i18n.Tr "settings.u2f_require_twofa"}}</b>
	{{end}}
</div>

<div class="ui small modal" id="register-device">
	<div class="header">{{.i18n.Tr "settings.u2f_register_key"}}</div>
	<div class="content">
		<i class="notched spinner loading icon"></i> {{.i18n.Tr "settings.u2f_press_button"}}
	</div>
	<div class="actions">
		<div class="ui cancel button">{{.i18n.Tr "cancel"}}</div>
	</div>
</div>

{{template "user/auth/u2f_error" .}}

<div class="ui small basic delete modal" id="delete-registration">
	<div class="ui icon header">
		{{svg "octicon-trash"}}
	{{.i18n.Tr "settings.u2f_delete_key"}}
	</div>
	<div class="content">
		<p>{{.i18n.Tr "settings.u2f_delete_key_desc"}}</p>
	</div>
	{{template "base/delete_modal_actions" .}}
</div>