Refactor User Settings (#3900)
* moved avatar to profile page * combined password change, email and account deletion into account settings page * combined totp, access tokens, linked accounts and openid into security settings page * move access tokens to applications settings page * small change to restart drone build * fix change avatar url on profile page * redirect old settings urls to new ones * enforce only one autofocus attribute on settings pages * set correct redirect status code * fmt fixtokarchuk/v1.17
parent
1546458f7d
commit
099372d76c
@ -0,0 +1,135 @@ |
||||
{{template "base/head" .}} |
||||
<div class="user settings account"> |
||||
{{template "user/settings/navbar" .}} |
||||
<div class="ui container"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.password"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
{{if or (.SignedUser.IsLocal) (.SignedUser.IsOAuth2)}} |
||||
<form class="ui form" action="{{.Link}}?tp=password" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
{{if .SignedUser.IsPasswordSet}} |
||||
<div class="required field {{if .Err_OldPassword}}error{{end}}"> |
||||
<label for="old_password">{{.i18n.Tr "settings.old_password"}}</label> |
||||
<input id="old_password" name="old_password" type="password" autocomplete="off" autofocus required> |
||||
</div> |
||||
{{end}} |
||||
<div class="required field {{if .Err_Password}}error{{end}}"> |
||||
<label for="password">{{.i18n.Tr "settings.new_password"}}</label> |
||||
<input id="password" name="password" type="password" autocomplete="off" required> |
||||
</div> |
||||
<div class="required field {{if .Err_Password}}error{{end}}"> |
||||
<label for="retype">{{.i18n.Tr "settings.retype_new_password"}}</label> |
||||
<input id="retype" name="retype" type="password" autocomplete="off" required> |
||||
</div> |
||||
|
||||
<div class="field"> |
||||
<button class="ui green button">{{$.i18n.Tr "settings.change_password"}}</button> |
||||
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.i18n.Tr "auth.forgot_password"}}</a> |
||||
</div> |
||||
</form> |
||||
{{else}} |
||||
<div class="ui info message"> |
||||
<p class="text left">{{$.i18n.Tr "settings.password_change_disabled"}}</p> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
|
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.manage_emails"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<div class="ui email list"> |
||||
<div class="item"> |
||||
{{.i18n.Tr "settings.email_desc"}} |
||||
</div> |
||||
{{range .Emails}} |
||||
<div class="item"> |
||||
{{if not .IsPrimary}} |
||||
<div class="right floated content"> |
||||
<button class="ui red tiny button delete-button" id="delete-email" data-url="{{$.Link}}/email/delete" data-id="{{.ID}}"> |
||||
{{$.i18n.Tr "settings.delete_email"}} |
||||
</button> |
||||
</div> |
||||
{{if .IsActivated}} |
||||
<div class="right floated content"> |
||||
<form action="{{$.Link}}/email" method="post"> |
||||
{{$.CsrfTokenHtml}} |
||||
<input name="_method" type="hidden" value="PRIMARY"> |
||||
<input name="id" type="hidden" value="{{.ID}}"> |
||||
<button class="ui blue tiny button">{{$.i18n.Tr "settings.primary_email"}}</button> |
||||
</form> |
||||
</div> |
||||
{{end}} |
||||
{{end}} |
||||
<div class="content"> |
||||
<strong>{{.Email}}</strong> |
||||
{{if .IsPrimary}}<span class="text red">{{$.i18n.Tr "settings.primary"}}</span>{{end}} |
||||
</div> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
<div class="ui attached bottom segment"> |
||||
<form class="ui form" action="{{.Link}}/email" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
<div class="required field {{if .Err_Email}}error{{end}}"> |
||||
<label for="email">{{.i18n.Tr "settings.add_new_email"}}</label> |
||||
<input id="email" name="email" type="email" required> |
||||
</div> |
||||
<button class="ui green button"> |
||||
{{.i18n.Tr "settings.add_email"}} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
|
||||
<h4 class="ui top attached warning header"> |
||||
{{.i18n.Tr "settings.delete_account"}} |
||||
</h4> |
||||
<div class="ui attached warning segment"> |
||||
<div class="ui red message"> |
||||
<p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "settings.delete_prompt" | Str2html}}</p> |
||||
</div> |
||||
<form class="ui form ignore-dirty" id="delete-form" action="{{.Link}}/delete" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
<input class="fake" type="password"> |
||||
<div class="required field {{if .Err_Password}}error{{end}}"> |
||||
<label for="password-confirmation">{{.i18n.Tr "password"}}</label> |
||||
<input id="password-confirmation" name="password" type="password" required> |
||||
</div> |
||||
<div class="field"> |
||||
<div class="ui red button delete-button" id="delete-account" data-type="form" data-form="#delete-form"> |
||||
{{.i18n.Tr "settings.confirm_delete_account"}} |
||||
</div> |
||||
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.i18n.Tr "auth.forgot_password"}}</a> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal" id="delete-email"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.email_deletion"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.email_deletion_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal" id="delete-account"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.delete_account_title"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.delete_account_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
||||
|
||||
{{template "base/footer" .}} |
@ -1,44 +0,0 @@ |
||||
{{template "base/head" .}} |
||||
<div class="user settings account_link"> |
||||
{{template "user/settings/navbar" .}} |
||||
<div class="ui container"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.manage_account_links"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<div class="ui key list"> |
||||
<div class="item"> |
||||
{{.i18n.Tr "settings.manage_account_links_desc"}} |
||||
</div> |
||||
{{if .AccountLinks}} |
||||
{{range $loginSource, $provider := .AccountLinks}} |
||||
<div class="item"> |
||||
<div class="right floated content"> |
||||
<button class="ui red tiny button delete-button" data-url="{{$.Link}}" data-id="{{$loginSource.ID}}"> |
||||
{{$.i18n.Tr "settings.delete_key"}} |
||||
</button> |
||||
</div> |
||||
<div class="content"> |
||||
<strong>{{$provider}}</strong> |
||||
{{if $loginSource.IsActived}}<span class="text red">{{$.i18n.Tr "settings.active"}}</span>{{end}} |
||||
</div> |
||||
</div> |
||||
{{end}} |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.remove_account_link"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.remove_account_link_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
||||
{{template "base/footer" .}} |
@ -1,46 +0,0 @@ |
||||
{{template "base/head" .}} |
||||
<div class="user settings avatar"> |
||||
{{template "user/settings/navbar" .}} |
||||
<div class="ui container"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.avatar"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
|
||||
<form class="ui form" action="{{.Link}}" method="post" enctype="multipart/form-data"> |
||||
{{.CsrfTokenHtml}} |
||||
{{if not DisableGravatar}} |
||||
<div class="inline field"> |
||||
<div class="ui radio checkbox"> |
||||
<input name="source" value="lookup" type="radio" {{if not .SignedUser.UseCustomAvatar}}checked{{end}}> |
||||
<label>{{.i18n.Tr "settings.lookup_avatar_by_mail"}}</label> |
||||
</div> |
||||
</div> |
||||
<div class="field {{if .Err_Gravatar}}error{{end}}"> |
||||
<label for="gravatar">Avatar {{.i18n.Tr "email"}}</label> |
||||
<input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}" /> |
||||
</div> |
||||
{{end}} |
||||
|
||||
<div class="inline field"> |
||||
<div class="ui radio checkbox"> |
||||
<input name="source" value="local" type="radio" {{if .SignedUser.UseCustomAvatar}}checked{{end}}> |
||||
<label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="inline field"> |
||||
<label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label> |
||||
<input name="avatar" type="file" > |
||||
</div> |
||||
|
||||
<div class="field"> |
||||
<button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button> |
||||
<a class="ui red button delete-post" data-request-url="{{.Link}}/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{{template "base/footer" .}} |
@ -1,41 +0,0 @@ |
||||
{{template "base/head" .}} |
||||
<div class="user settings delete"> |
||||
{{template "user/settings/navbar" .}} |
||||
<div class="ui container"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached warning header"> |
||||
{{.i18n.Tr "settings.delete_account"}} |
||||
</h4> |
||||
<div class="ui attached warning segment"> |
||||
<div class="ui red message"> |
||||
<p class="text left"><i class="octicon octicon-alert"></i> {{.i18n.Tr "settings.delete_prompt" | Str2html}}</p> |
||||
</div> |
||||
<form class="ui form ignore-dirty" id="delete-form" action="{{.Link}}" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
<input class="fake" type="password"> |
||||
<div class="required field {{if .Err_Password}}error{{end}}"> |
||||
<label for="password">{{.i18n.Tr "password"}}</label> |
||||
<input id="password" name="password" type="password" autofocus required> |
||||
</div> |
||||
<div class="field"> |
||||
<div class="ui red button delete-button" data-type="form" data-form="#delete-form"> |
||||
{{.i18n.Tr "settings.confirm_delete_account"}} |
||||
</div> |
||||
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.i18n.Tr "auth.forgot_password"}}</a> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.delete_account_title"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.delete_account_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
||||
{{template "base/footer" .}} |
@ -1,66 +0,0 @@ |
||||
{{template "base/head" .}} |
||||
<div class="user settings emails"> |
||||
{{template "user/settings/navbar" .}} |
||||
<div class="ui container"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.manage_emails"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<div class="ui email list"> |
||||
<div class="item"> |
||||
{{.i18n.Tr "settings.email_desc"}} |
||||
</div> |
||||
{{range .Emails}} |
||||
<div class="item"> |
||||
{{if not .IsPrimary}} |
||||
<div class="right floated content"> |
||||
<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"> |
||||
{{$.i18n.Tr "settings.delete_email"}} |
||||
</button> |
||||
</div> |
||||
{{if .IsActivated}} |
||||
<div class="right floated content"> |
||||
<form action="{{$.Link}}" method="post"> |
||||
{{$.CsrfTokenHtml}} |
||||
<input name="_method" type="hidden" value="PRIMARY"> |
||||
<input name="id" type="hidden" value="{{.ID}}"> |
||||
<button class="ui blue tiny button">{{$.i18n.Tr "settings.primary_email"}}</button> |
||||
</form> |
||||
</div> |
||||
{{end}} |
||||
{{end}} |
||||
<div class="content"> |
||||
<strong>{{.Email}}</strong> |
||||
{{if .IsPrimary}}<span class="text red">{{$.i18n.Tr "settings.primary"}}</span>{{end}} |
||||
</div> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
<div class="ui attached bottom segment"> |
||||
<form class="ui form" action="{{.Link}}" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
<div class="required field {{if .Err_Email}}error{{end}}"> |
||||
<label for="email">{{.i18n.Tr "settings.add_new_email"}}</label> |
||||
<input id="email" name="email" type="email" autofocus required> |
||||
</div> |
||||
<button class="ui green button"> |
||||
{{.i18n.Tr "settings.add_email"}} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.email_deletion"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.email_deletion_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
||||
{{template "base/footer" .}} |
@ -1,71 +0,0 @@ |
||||
{{template "base/head" .}} |
||||
<div class="user settings openid"> |
||||
{{template "user/settings/navbar" .}} |
||||
<div class="ui container"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.manage_openid"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<div class="ui openid list"> |
||||
<div class="item"> |
||||
{{.i18n.Tr "settings.openid_desc"}} |
||||
</div> |
||||
{{range .OpenIDs}} |
||||
<div class="item"> |
||||
<div class="right floated content"> |
||||
<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}"> |
||||
{{$.i18n.Tr "settings.delete_key"}} |
||||
</button> |
||||
</div> |
||||
<div class="right floated content"> |
||||
<form action="{{$.Link}}/toggle_visibility" method="post"> |
||||
{{$.CsrfTokenHtml}} |
||||
<input name="id" type="hidden" value="{{.ID}}"> |
||||
{{if .Show}} |
||||
<button class="ui tiny button"> |
||||
<i class="icon fa-eye"></i> |
||||
{{$.i18n.Tr "settings.hide_openid"}} |
||||
</button> |
||||
{{else}} |
||||
<button class="ui tiny button"> |
||||
<i class="icon fa-eye-slash"></i> |
||||
{{$.i18n.Tr "settings.show_openid"}} |
||||
</button> |
||||
{{end}} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
<div class="content"> |
||||
<strong>{{.URI}}</strong> |
||||
</div> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
<div class="ui attached bottom segment"> |
||||
<form class="ui form" action="{{.Link}}" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
<div class="required field {{if .Err_OpenID}}error{{end}}"> |
||||
<label for="openid">{{.i18n.Tr "settings.add_new_openid"}}</label> |
||||
<input id="openid" name="openid" type="text" autofocus required> |
||||
</div> |
||||
<button class="ui green button"> |
||||
{{.i18n.Tr "settings.add_openid"}} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.openid_deletion"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.openid_deletion_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
||||
{{template "base/footer" .}} |
@ -1,79 +1,14 @@ |
||||
{{template "base/head" .}} |
||||
<div class="user settings password"> |
||||
<div class="user settings security"> |
||||
{{template "user/settings/navbar" .}} |
||||
<div class="ui container"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.password"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
{{if or (.SignedUser.IsLocal) (.SignedUser.IsOAuth2)}} |
||||
<form class="ui form" action="{{.Link}}?tp=password" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
{{if .SignedUser.IsPasswordSet}} |
||||
<div class="required field {{if .Err_OldPassword}}error{{end}}"> |
||||
<label for="old_password">{{.i18n.Tr "settings.old_password"}}</label> |
||||
<input id="old_password" name="old_password" type="password" autocomplete="off" autofocus required> |
||||
</div> |
||||
{{end}} |
||||
<div class="required field {{if .Err_Password}}error{{end}}"> |
||||
<label for="password">{{.i18n.Tr "settings.new_password"}}</label> |
||||
<input id="password" name="password" type="password" autocomplete="off" required> |
||||
</div> |
||||
<div class="required field {{if .Err_Password}}error{{end}}"> |
||||
<label for="retype">{{.i18n.Tr "settings.retype_new_password"}}</label> |
||||
<input id="retype" name="retype" type="password" autocomplete="off" required> |
||||
</div> |
||||
|
||||
<div class="field"> |
||||
<button class="ui green button">{{$.i18n.Tr "settings.change_password"}}</button> |
||||
<a href="{{AppSubUrl}}/user/forgot_password?email={{.Email}}">{{.i18n.Tr "auth.forgot_password"}}</a> |
||||
</div> |
||||
</form> |
||||
{{else}} |
||||
<div class="ui info message"> |
||||
<p class="text left">{{$.i18n.Tr "settings.password_change_disabled"}}</p> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
<br/> |
||||
|
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.twofa"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<p>{{.i18n.Tr "settings.twofa_desc"}}</p> |
||||
{{if .TwofaEnrolled}} |
||||
<p>{{$.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}</p> |
||||
<form class="ui form" action="{{.Link}}/two_factor/regenerate_scratch" method="post" enctype="multipart/form-data"> |
||||
{{.CsrfTokenHtml}} |
||||
<p>{{.i18n.Tr "settings.regenerate_scratch_token_desc"}}</p> |
||||
<button class="ui blue button">{{$.i18n.Tr "settings.twofa_scratch_token_regenerate"}}</button> |
||||
</form> |
||||
<form class="ui form" action="{{.Link}}/two_factor/disable" method="post" enctype="multipart/form-data" id="disable-form"> |
||||
{{.CsrfTokenHtml}} |
||||
<p>{{.i18n.Tr "settings.twofa_disable_note"}}</p> |
||||
<div class="ui red button delete-button" data-type="form" data-form="#disable-form">{{$.i18n.Tr "settings.twofa_disable"}}</div> |
||||
</form> |
||||
{{else}} |
||||
<p>{{.i18n.Tr "settings.twofa_not_enrolled"}}</p> |
||||
<div class="inline field"> |
||||
<a class="ui green button" href="{{.Link}}/two_factor/enroll">{{$.i18n.Tr "settings.twofa_enroll"}}</a> |
||||
</div> |
||||
{{template "user/settings/security_twofa" .}} |
||||
{{template "user/settings/security_accountlinks" .}} |
||||
{{if .EnableOpenIDSignIn}} |
||||
{{template "user/settings/security_openid" .}} |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.twofa_disable"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.twofa_disable_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
||||
|
||||
{{template "base/footer" .}} |
||||
|
@ -0,0 +1,36 @@ |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.manage_account_links"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<div class="ui key list"> |
||||
<div class="item"> |
||||
{{.i18n.Tr "settings.manage_account_links_desc"}} |
||||
</div> |
||||
{{if .AccountLinks}} |
||||
{{range $loginSource, $provider := .AccountLinks}} |
||||
<div class="item"> |
||||
<div class="right floated content"> |
||||
<button class="ui red tiny button delete-button" id="delete-account-link" data-url="{{$.Link}}/account_link" data-id="{{$loginSource.ID}}"> |
||||
{{$.i18n.Tr "settings.delete_key"}} |
||||
</button> |
||||
</div> |
||||
<div class="content"> |
||||
<strong>{{$provider}}</strong> |
||||
{{if $loginSource.IsActived}}<span class="text red">{{$.i18n.Tr "settings.active"}}</span>{{end}} |
||||
</div> |
||||
</div> |
||||
{{end}} |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal" id="delete-account-link"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.remove_account_link"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.remove_account_link_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
@ -0,0 +1,63 @@ |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.manage_openid"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<div class="ui openid list"> |
||||
<div class="item"> |
||||
{{.i18n.Tr "settings.openid_desc"}} |
||||
</div> |
||||
{{range .OpenIDs}} |
||||
<div class="item"> |
||||
<div class="right floated content"> |
||||
<button class="ui red tiny button delete-button" id="delete-openid" data-url="{{$.Link}}/openid/delete" data-id="{{.ID}}"> |
||||
{{$.i18n.Tr "settings.delete_key"}} |
||||
</button> |
||||
</div> |
||||
<div class="right floated content"> |
||||
<form action="{{$.Link}}/openid/toggle_visibility" method="post"> |
||||
{{$.CsrfTokenHtml}} |
||||
<input name="id" type="hidden" value="{{.ID}}"> |
||||
{{if .Show}} |
||||
<button class="ui tiny button"> |
||||
<i class="icon fa-eye"></i> |
||||
{{$.i18n.Tr "settings.hide_openid"}} |
||||
</button> |
||||
{{else}} |
||||
<button class="ui tiny button"> |
||||
<i class="icon fa-eye-slash"></i> |
||||
{{$.i18n.Tr "settings.show_openid"}} |
||||
</button> |
||||
{{end}} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
<div class="content"> |
||||
<strong>{{.URI}}</strong> |
||||
</div> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
<div class="ui attached bottom segment"> |
||||
<form class="ui form" action="{{.Link}}/openid" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
<div class="required field {{if .Err_OpenID}}error{{end}}"> |
||||
<label for="openid">{{.i18n.Tr "settings.add_new_openid"}}</label> |
||||
<input id="openid" name="openid" type="text" autofocus required> |
||||
</div> |
||||
<button class="ui green button"> |
||||
{{.i18n.Tr "settings.add_openid"}} |
||||
</button> |
||||
</form> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal" id="delete-openid"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.openid_deletion"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.openid_deletion_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
@ -0,0 +1,35 @@ |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.twofa"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<p>{{.i18n.Tr "settings.twofa_desc"}}</p> |
||||
{{if .TwofaEnrolled}} |
||||
<p>{{$.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}</p> |
||||
<form class="ui form" action="{{.Link}}/two_factor/regenerate_scratch" method="post" enctype="multipart/form-data"> |
||||
{{.CsrfTokenHtml}} |
||||
<p>{{.i18n.Tr "settings.regenerate_scratch_token_desc"}}</p> |
||||
<button class="ui blue button">{{$.i18n.Tr "settings.twofa_scratch_token_regenerate"}}</button> |
||||
</form> |
||||
<form class="ui form" action="{{.Link}}/two_factor/disable" method="post" enctype="multipart/form-data" id="disable-form"> |
||||
{{.CsrfTokenHtml}} |
||||
<p>{{.i18n.Tr "settings.twofa_disable_note"}}</p> |
||||
<div class="ui red button delete-button" id="disable-twofa" data-type="form" data-form="#disable-form">{{$.i18n.Tr "settings.twofa_disable"}}</div> |
||||
</form> |
||||
{{else}} |
||||
<p>{{.i18n.Tr "settings.twofa_not_enrolled"}}</p> |
||||
<div class="inline field"> |
||||
<a class="ui green button" href="{{.Link}}/two_factor/enroll">{{$.i18n.Tr "settings.twofa_enroll"}}</a> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal" id="disable-twofa"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.twofa_disable"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.twofa_disable_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
@ -1,44 +0,0 @@ |
||||
{{template "base/head" .}} |
||||
<div class="user settings delete"> |
||||
{{template "user/settings/navbar" .}} |
||||
<div class="ui container"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "settings.twofa"}} |
||||
</h4> |
||||
<div class="ui attached segment"> |
||||
<p>{{.i18n.Tr "settings.twofa_desc"}}</p> |
||||
{{if .TwofaEnrolled}} |
||||
<p>{{$.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}</p> |
||||
<form class="ui form" action="{{.Link}}/regenerate_scratch" method="post" enctype="multipart/form-data"> |
||||
{{.CsrfTokenHtml}} |
||||
<p>{{.i18n.Tr "settings.regenerate_scratch_token_desc"}}</p> |
||||
<button class="ui blue button">{{$.i18n.Tr "settings.twofa_scratch_token_regenerate"}}</button> |
||||
</form> |
||||
<form class="ui form" action="{{.Link}}/disable" method="post" enctype="multipart/form-data" id="disable-form"> |
||||
{{.CsrfTokenHtml}} |
||||
<p>{{.i18n.Tr "settings.twofa_disable_note"}}</p> |
||||
<div class="ui red button delete-button" data-type="form" data-form="#disable-form">{{$.i18n.Tr "settings.twofa_disable"}}</div> |
||||
</form> |
||||
{{else}} |
||||
<p>{{.i18n.Tr "settings.twofa_not_enrolled"}}</p> |
||||
<div class="inline field"> |
||||
<a class="ui green button" href="{{.Link}}/enroll">{{$.i18n.Tr "settings.twofa_enroll"}}</a> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ui small basic delete modal"> |
||||
<div class="ui icon header"> |
||||
<i class="trash icon"></i> |
||||
{{.i18n.Tr "settings.twofa_disable"}} |
||||
</div> |
||||
<div class="content"> |
||||
<p>{{.i18n.Tr "settings.twofa_disable_desc"}}</p> |
||||
</div> |
||||
{{template "base/delete_modal_actions" .}} |
||||
</div> |
||||
|
||||
{{template "base/footer" .}} |
Loading…
Reference in new issue