summaryrefslogtreecommitdiffstats
path: root/templates/user/settings/security/u2f.tmpl
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-01-02 21:12:35 +0800
committerGitHub <noreply@github.com>2022-01-02 21:12:35 +0800
commitde8e3948a5e38f7eaf82d3c0cfd10e995bf68e92 (patch)
treebbcb011d264e0d614d49c734856b446360c5a4a3 /templates/user/settings/security/u2f.tmpl
parente61b390d545919244141b699b28e3fbc42adc66f (diff)
downloadgitea-de8e3948a5e38f7eaf82d3c0cfd10e995bf68e92.tar.gz
gitea-de8e3948a5e38f7eaf82d3c0cfd10e995bf68e92.zip
Refactor auth package (#17962)
Diffstat (limited to 'templates/user/settings/security/u2f.tmpl')
-rw-r--r--templates/user/settings/security/u2f.tmpl51
1 files changed, 51 insertions, 0 deletions
diff --git a/templates/user/settings/security/u2f.tmpl b/templates/user/settings/security/u2f.tmpl
new file mode 100644
index 0000000000..97e76b6da2
--- /dev/null
+++ b/templates/user/settings/security/u2f.tmpl
@@ -0,0 +1,51 @@
+<h4 class="ui top attached header">
+{{.i18n.Tr "settings.u2f"}}
+</h4>
+<div class="ui attached segment">
+ <p>{{.i18n.Tr "settings.u2f_desc" | Str2html}}</p>
+ <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>
+</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>