summaryrefslogtreecommitdiffstats
path: root/templates/user/settings
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2020-03-02 15:25:36 -0300
committerGitHub <noreply@github.com>2020-03-02 15:25:36 -0300
commit5e1438ba92fe5b4398ebf468e4ede21c7ef60409 (patch)
tree40096ee69a4ac5df46428a3cf1ae7ee3bee8078e /templates/user/settings
parentb5ecc82d6e22b5701bfadc1ebc430b9c7fef0cc8 (diff)
downloadgitea-5e1438ba92fe5b4398ebf468e4ede21c7ef60409.tar.gz
gitea-5e1438ba92fe5b4398ebf468e4ede21c7ef60409.zip
Admin page for managing user e-mail activation (#10557)
* Implement mail activation admin panel * Add export comments * Fix another export comment * again... * And again! * Apply suggestions by @lunny * Add UI for user activated emails * Make new activation UI work * Fix lint * Prevent admin from self-deactivate; add modal Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates/user/settings')
-rw-r--r--templates/user/settings/account.tmpl29
1 files changed, 25 insertions, 4 deletions
diff --git a/templates/user/settings/account.tmpl b/templates/user/settings/account.tmpl
index 59608a8f16..67036f66f5 100644
--- a/templates/user/settings/account.tmpl
+++ b/templates/user/settings/account.tmpl
@@ -76,7 +76,7 @@
{{$.i18n.Tr "settings.delete_email"}}
</button>
</div>
- {{if .IsActivated}}
+ {{if .CanBePrimary}}
<div class="right floated content">
<form action="{{AppSubUrl}}/user/settings/account/email" method="post">
{{$.CsrfTokenHtml}}
@@ -87,9 +87,30 @@
</div>
{{end}}
{{end}}
+ {{if not .IsActivated}}
+ <div class="right floated content">
+ <form action="{{AppSubUrl}}/user/settings/account/email" method="post">
+ {{$.CsrfTokenHtml}}
+ <input name="_method" type="hidden" value="SENDACTIVATION">
+ <input name="id" type="hidden" value="{{if .IsPrimary}}PRIMARY{{else}}}.ID{{end}}">
+ {{if $.ActivationsPending}}
+ <button disabled class="ui blue tiny button">{{$.i18n.Tr "settings.activations_pending"}}</button>
+ {{else}}
+ <button class="ui blue tiny button">{{$.i18n.Tr "settings.activate_email"}}</button>
+ {{end}}
+ </form>
+ </div>
+ {{end}}
<div class="content">
<strong>{{.Email}}</strong>
- {{if .IsPrimary}}<span class="text red">{{$.i18n.Tr "settings.primary"}}</span>{{end}}
+ {{if .IsPrimary}}
+ <div class="ui blue label">{{$.i18n.Tr "settings.primary"}}</div>
+ {{end}}
+ {{if .IsActivated}}
+ <div class="ui green label">{{$.i18n.Tr "settings.activated"}}</div>
+ {{else}}
+ <div class="ui label">{{$.i18n.Tr "settings.requires_activation"}}</div>
+ {{end}}
</div>
</div>
{{end}}
@@ -100,9 +121,9 @@
{{.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>
+ <input id="email" name="email" type="email" required {{if not .CanAddEmails}}disabled{{end}}>
</div>
- <button class="ui green button">
+ <button class="ui green button" {{if not .CanAddEmails}}disabled{{end}}>
{{.i18n.Tr "settings.add_email"}}
</button>
</form>