2023-04-23 06:21:21 -04:00
{{ template "user/settings/layout_head" ( dict "ctxData" . "pageClass" "user settings account" ) }}
< div class = "user-setting-content" >
2018-05-15 06:07:32 -04:00
< h4 class = "ui top attached header" >
2024-02-22 12:33:22 -05:00
{{ ctx .Locale.Tr "settings.change_password" }}
2018-05-15 06:07:32 -04:00
< / h4 >
< div class = "ui attached segment" >
{{ if or ( .SignedUser.IsLocal ) ( .SignedUser.IsOAuth2 ) }}
2021-09-02 08:14:37 -04:00
< form class = "ui form ignore-dirty" action = " {{ AppSubUrl }} /user/settings/account" method = "post" >
2021-10-18 18:08:41 -04:00
{{ template "base/disable_form_autofill" }}
2018-05-15 06:07:32 -04:00
{{ .CsrfTokenHtml }}
{{ if .SignedUser.IsPasswordSet }}
< div class = "required field {{ if .Err_OldPassword }} error {{ end }} " >
2023-09-25 04:56:50 -04:00
< label for = "old_password" > {{ ctx .Locale.Tr "settings.old_password" }} </ label >
2020-10-09 03:32:30 -04:00
< input id = "old_password" name = "old_password" type = "password" autocomplete = "current-password" autofocus required >
2018-05-15 06:07:32 -04:00
< / div >
{{ end }}
< div class = "required field {{ if .Err_Password }} error {{ end }} " >
2023-09-25 04:56:50 -04:00
< label for = "password" > {{ ctx .Locale.Tr "settings.new_password" }} </ label >
2020-10-09 03:32:30 -04:00
< input id = "password" name = "password" type = "password" autocomplete = "new-password" required >
2018-05-15 06:07:32 -04:00
< / div >
< div class = "required field {{ if .Err_Password }} error {{ end }} " >
2023-09-25 04:56:50 -04:00
< label for = "retype" > {{ ctx .Locale.Tr "settings.retype_new_password" }} </ label >
2020-10-09 03:32:30 -04:00
< input id = "retype" name = "retype" type = "password" autocomplete = "new-password" required >
2018-05-15 06:07:32 -04:00
< / div >
< div class = "field" >
2024-02-22 12:33:22 -05:00
< button class = "ui primary button" > {{ ctx .Locale.Tr "settings.update_password" }} </ button >
2023-09-25 04:56:50 -04:00
< a href = " {{ AppSubUrl }} /user/forgot_password?email= {{ .Email }} " > {{ ctx .Locale.Tr "auth.forgot_password" }} </ a >
2018-05-15 06:07:32 -04:00
< / div >
< / form >
{{ else }}
< div class = "ui info message" >
2023-09-25 04:56:50 -04:00
< p class = "text left" > {{ ctx .Locale.Tr "settings.password_change_disabled" }} </ p >
2018-05-15 06:07:32 -04:00
< / div >
{{ end }}
< / div >
< h4 class = "ui top attached header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "settings.manage_emails" }}
2018-05-15 06:07:32 -04:00
< / h4 >
< div class = "ui attached segment" >
2023-07-03 16:38:06 -04:00
< div class = "ui list" >
2022-06-27 12:59:47 -04:00
{{ if $.EnableNotifyMail }}
2018-05-15 06:07:32 -04:00
< div class = "item" >
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 12:42:49 -04:00
< div class = "tw-mb-2" > {{ ctx .Locale.Tr "settings.email_desc" }} </ div >
2019-08-29 10:05:42 -04:00
< form action = " {{ AppSubUrl }} /user/settings/account/email" class = "ui form" method = "post" >
2023-07-03 16:38:06 -04:00
{{ $.CsrfTokenHtml }}
< input name = "_method" type = "hidden" value = "NOTIFICATION" >
2024-03-24 10:31:35 -04:00
< div class = "tw-flex tw-flex-wrap tw-gap-2" >
2023-07-03 16:38:06 -04:00
< div class = "ui selection dropdown" >
< input name = "preference" type = "hidden" value = " {{ .EmailNotificationsPreference }} " >
{{ svg "octicon-triangle-down" 14 "dropdown icon" }}
< div class = "text" > < / div >
< div class = "menu" >
2023-09-25 04:56:50 -04:00
< div data-value = "enabled" class = " {{ if eq .EmailNotificationsPreference "enabled" }} active selected {{ end }} item" > {{ ctx .Locale.Tr "settings.email_notifications.enable" }} </ div >
< div data-value = "andyourown" class = " {{ if eq .EmailNotificationsPreference "andyourown" }} active selected {{ end }} item" > {{ ctx .Locale.Tr "settings.email_notifications.andyourown" }} </ div >
< div data-value = "onmention" class = " {{ if eq .EmailNotificationsPreference "onmention" }} active selected {{ end }} item" > {{ ctx .Locale.Tr "settings.email_notifications.onmention" }} </ div >
< div data-value = "disabled" class = " {{ if eq .EmailNotificationsPreference "disabled" }} active selected {{ end }} item" > {{ ctx .Locale.Tr "settings.email_notifications.disable" }} </ div >
2019-08-29 10:05:42 -04:00
< / div >
< / div >
2023-09-25 04:56:50 -04:00
< button class = "ui primary button" > {{ ctx .Locale.Tr "settings.email_notifications.submit" }} </ button >
2019-08-29 10:05:42 -04:00
< / div >
< / form >
2018-05-15 06:07:32 -04:00
< / div >
2022-06-27 12:59:47 -04:00
{{ end }}
2018-05-15 06:07:32 -04:00
{{ range .Emails }}
< div class = "item" >
{{ if not .IsPrimary }}
< div class = "right floated content" >
2021-08-26 22:57:40 -04:00
< button class = "ui red tiny button delete-button" data-modal-id = "delete-email" data-url = " {{ AppSubUrl }} /user/settings/account/email/delete" data-id = " {{ .ID }} " >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "settings.delete_email" }}
2018-05-15 06:07:32 -04:00
< / button >
< / div >
2020-03-02 13:25:36 -05:00
{{ if .CanBePrimary }}
2018-05-15 06:07:32 -04:00
< div class = "right floated content" >
2018-05-18 21:02:04 -04:00
< form action = " {{ AppSubUrl }} /user/settings/account/email" method = "post" >
2018-05-15 06:07:32 -04:00
{{ $.CsrfTokenHtml }}
< input name = "_method" type = "hidden" value = "PRIMARY" >
< input name = "id" type = "hidden" value = " {{ .ID }} " >
2023-09-25 04:56:50 -04:00
< button class = "ui primary tiny button" > {{ ctx .Locale.Tr "settings.primary_email" }} </ button >
2018-05-15 06:07:32 -04:00
< / form >
< / div >
{{ end }}
{{ end }}
2020-03-02 13:25:36 -05:00
{{ 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" >
2021-07-13 16:59:27 -04:00
< input name = "id" type = "hidden" value = " {{ .ID }} " >
2020-03-02 13:25:36 -05:00
{{ if $.ActivationsPending }}
2023-09-25 04:56:50 -04:00
< button disabled class = "ui primary tiny button" > {{ ctx .Locale.Tr "settings.activations_pending" }} </ button >
2020-03-02 13:25:36 -05:00
{{ else }}
2023-09-25 04:56:50 -04:00
< button class = "ui primary tiny button" > {{ ctx .Locale.Tr "settings.activate_email" }} </ button >
2020-03-02 13:25:36 -05:00
{{ end }}
< / form >
< / div >
{{ end }}
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
(cherry picked from commit 68ec9b48592fe88765bcc3a73093d43c98b315de)
Conflicts:
routers/web/repo/view.go
templates/base/head_navbar.tmpl
templates/repo/code/recently_pushed_new_branches.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/compare.tmpl
templates/repo/diff/conversation.tmpl
templates/repo/header.tmpl
templates/repo/issue/filter_list.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/options.tmpl
templates/repo/view_file.tmpl
templates/shared/user/blocked_users.tmpl
templates/status/500.tmpl
web_src/js/components/DashboardRepoList.vue
resolved by prefering Forgejo version and applying the
commands to all files
2024-03-24 12:42:49 -04:00
< div class = "content tw-py-2" >
2018-05-15 06:07:32 -04:00
< strong > {{ .Email }} </ strong >
2020-03-02 13:25:36 -05:00
{{ if .IsPrimary }}
2023-09-25 04:56:50 -04:00
< div class = "ui primary label" > {{ ctx .Locale.Tr "settings.primary" }} </ div >
2020-03-02 13:25:36 -05:00
{{ end }}
{{ if .IsActivated }}
2023-09-25 04:56:50 -04:00
< div class = "ui green label" > {{ ctx .Locale.Tr "settings.activated" }} </ div >
2020-03-02 13:25:36 -05:00
{{ else }}
2023-09-25 04:56:50 -04:00
< div class = "ui label" > {{ ctx .Locale.Tr "settings.requires_activation" }} </ div >
2020-03-02 13:25:36 -05:00
{{ end }}
2018-05-15 06:07:32 -04:00
< / div >
< / div >
{{ end }}
< / div >
< / div >
< div class = "ui attached bottom segment" >
2018-05-18 21:02:04 -04:00
< form class = "ui form" action = " {{ AppSubUrl }} /user/settings/account/email" method = "post" >
2018-05-15 06:07:32 -04:00
{{ .CsrfTokenHtml }}
< div class = "required field {{ if .Err_Email }} error {{ end }} " >
2023-09-25 04:56:50 -04:00
< label for = "email" > {{ ctx .Locale.Tr "settings.add_new_email" }} </ label >
2020-03-02 13:25:36 -05:00
< input id = "email" name = "email" type = "email" required {{ if not .CanAddEmails }} disabled {{ end }} >
2018-05-15 06:07:32 -04:00
< / div >
2023-09-18 18:05:31 -04:00
< button class = "ui primary button" {{ if not .CanAddEmails }} disabled {{ end }} >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "settings.add_email" }}
2018-05-15 06:07:32 -04:00
< / button >
< / form >
2023-06-26 00:52:49 -04:00
{{/* if ActivationsPending is false, then CanAddEmails must be true, so if CanAddEmails is false, ActivationsPending must be true */}}
{{ if not .CanAddEmails }}
2023-09-25 04:56:50 -04:00
< div class = "ui warning message" > {{ ctx .Locale.Tr "settings.can_not_add_email_activations_pending" }} </ div >
2023-06-26 00:52:49 -04:00
{{ end }}
2018-05-15 06:07:32 -04:00
< / div >
2024-02-23 02:24:04 -05:00
{{ if not ( $.UserDisabledFeatures.Contains "deletion" ) }}
2020-10-04 16:54:22 -04:00
< h4 class = "ui top attached error header" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "settings.delete_account" }}
2018-05-15 06:07:32 -04:00
< / h4 >
2020-10-04 16:54:22 -04:00
< div class = "ui attached error segment" >
2018-05-15 06:07:32 -04:00
< div class = "ui red message" >
2024-03-10 04:51:19 -04:00
< p class = "text left" > {{ svg "octicon-alert" }} {{ ctx .Locale.Tr "settings.delete_prompt" }} </ p >
2022-08-31 11:58:54 -04:00
{{ if .UserDeleteWithComments }}
2024-03-23 14:45:11 -04:00
< p class = "text left tw-font-semibold" > {{ ctx .Locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime }} </ p >
2022-08-31 11:58:54 -04:00
{{ end }}
2018-05-15 06:07:32 -04:00
< / div >
2018-05-18 21:02:04 -04:00
< form class = "ui form ignore-dirty" id = "delete-form" action = " {{ AppSubUrl }} /user/settings/account/delete" method = "post" >
2021-10-18 18:08:41 -04:00
{{ template "base/disable_form_autofill" }}
2018-05-15 06:07:32 -04:00
{{ .CsrfTokenHtml }}
< div class = "required field {{ if .Err_Password }} error {{ end }} " >
2023-09-25 04:56:50 -04:00
< label for = "password-confirmation" > {{ ctx .Locale.Tr "password" }} </ label >
2020-10-09 03:32:30 -04:00
< input id = "password-confirmation" name = "password" type = "password" autocomplete = "off" required >
2018-05-15 06:07:32 -04:00
< / div >
< div class = "field" >
2023-03-13 23:34:09 -04:00
< button class = "ui red button delete-button" data-modal-id = "delete-account" data-type = "form" data-form = "#delete-form" >
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "settings.confirm_delete_account" }}
2023-03-13 23:34:09 -04:00
< / button >
2018-05-15 06:07:32 -04:00
< / div >
< / form >
2024-02-23 02:24:04 -05:00
< div class = "ui g-modal-confirm delete modal" id = "delete-account" >
< div class = "header" >
{{ svg "octicon-trash" }}
{{ ctx .Locale.Tr "settings.delete_account_title" }}
< / div >
< div class = "content" >
< p > {{ ctx .Locale.Tr "settings.delete_account_desc" }} </ p >
< / div >
{{ template "base/modal_actions_confirm" . }}
< / div >
2018-05-15 06:07:32 -04:00
< / div >
2024-02-23 02:24:04 -05:00
{{ end }}
2018-05-15 06:07:32 -04:00
< / div >
2023-04-24 07:08:59 -04:00
< div class = "ui g-modal-confirm delete modal" id = "delete-email" >
2023-04-23 05:24:19 -04:00
< div class = "header" >
2021-03-22 00:04:19 -04:00
{{ svg "octicon-trash" }}
2023-09-25 04:56:50 -04:00
{{ ctx .Locale.Tr "settings.email_deletion" }}
2018-05-15 06:07:32 -04:00
< / div >
< div class = "content" >
2023-09-25 04:56:50 -04:00
< p > {{ ctx .Locale.Tr "settings.email_deletion_desc" }} </ p >
2018-05-15 06:07:32 -04:00
< / div >
2023-04-23 05:24:19 -04:00
{{ template "base/modal_actions_confirm" . }}
2018-05-15 06:07:32 -04:00
< / div >
2023-04-23 06:21:21 -04:00
{{ template "user/settings/layout_footer" . }}