diff options
author | zeripath <art27@cantab.net> | 2021-08-27 03:57:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 22:57:40 -0400 |
commit | e37342db0c102ef12ae70072d9f4bbef89338085 (patch) | |
tree | 50598f0627960e60aec866568a29e3cffa378c5b /templates/user/settings | |
parent | 3289aceec2b760e690fe7505d22ff685950cd0e7 (diff) | |
download | gitea-e37342db0c102ef12ae70072d9f4bbef89338085.tar.gz gitea-e37342db0c102ef12ae70072d9f4bbef89338085.zip |
Add modals to Organization and Team remove/leave (#16471)
* Add modals to Organization and Team remove/leave
Add confirmation modals to Organization and Team remove and leave.
Fix #16215
Signed-off-by: Andrew Thornton <art27@cantab.net>
* avoid for-in
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Revert "avoid for-in"
This reverts commit 2af9a6f9d46ed31b6fc6e3a29e695577dcf09f75.
* Apply suggestions from code review
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/user/settings')
-rw-r--r-- | templates/user/settings/account.tmpl | 4 | ||||
-rw-r--r-- | templates/user/settings/applications.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/applications_oauth2.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/grants_oauth2.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/keys_gpg.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/keys_principal.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/keys_ssh.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/security_accountlinks.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/security_openid.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/security_twofa.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/security_u2f.tmpl | 2 |
11 files changed, 12 insertions, 12 deletions
diff --git a/templates/user/settings/account.tmpl b/templates/user/settings/account.tmpl index 2e1976aaa9..0468eb7e2a 100644 --- a/templates/user/settings/account.tmpl +++ b/templates/user/settings/account.tmpl @@ -72,7 +72,7 @@ <div class="item"> {{if not .IsPrimary}} <div class="right floated content"> - <button class="ui red tiny button delete-button" id="delete-email" data-url="{{AppSubUrl}}/user/settings/account/email/delete" data-id="{{.ID}}"> + <button class="ui red tiny button delete-button" data-modal-id="delete-email" data-url="{{AppSubUrl}}/user/settings/account/email/delete" data-id="{{.ID}}"> {{$.i18n.Tr "settings.delete_email"}} </button> </div> @@ -185,7 +185,7 @@ <input id="password-confirmation" name="password" type="password" autocomplete="off" required> </div> <div class="field"> - <div class="ui red button delete-button" id="delete-account" data-type="form" data-form="#delete-form"> + <div class="ui red button delete-button" data-modal-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> diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index 0455b5e221..811ce5d643 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -14,7 +14,7 @@ {{range .Tokens}} <div class="item"> <div class="right floated content"> - <button class="ui red tiny button delete-button" id="delete-token" data-url="{{$.Link}}/delete" data-id="{{.ID}}"> + <button class="ui red tiny button delete-button" data-modal-id="delete-token" data-url="{{$.Link}}/delete" data-id="{{.ID}}"> {{svg "octicon-trash" 16 "mr-2"}} {{$.i18n.Tr "settings.delete_token"}} </button> diff --git a/templates/user/settings/applications_oauth2.tmpl b/templates/user/settings/applications_oauth2.tmpl index 4de3f27ec3..8218674bce 100644 --- a/templates/user/settings/applications_oauth2.tmpl +++ b/templates/user/settings/applications_oauth2.tmpl @@ -13,7 +13,7 @@ {{svg "octicon-pencil" 16 "mr-2"}} {{$.i18n.Tr "settings.oauth2_application_edit"}} </a> - <button class="ui red tiny button delete-button" id="remove-gitea-oauth2-application" + <button class="ui red tiny button delete-button" data-modal-id="remove-gitea-oauth2-application" data-url="{{AppSubUrl}}/user/settings/applications/oauth2/delete" data-id="{{$app.ID}}"> {{svg "octicon-trash" 16 "mr-2"}} diff --git a/templates/user/settings/grants_oauth2.tmpl b/templates/user/settings/grants_oauth2.tmpl index cf24252ede..35a851ff36 100644 --- a/templates/user/settings/grants_oauth2.tmpl +++ b/templates/user/settings/grants_oauth2.tmpl @@ -9,7 +9,7 @@ {{range $grant := .Grants}} <div class="item"> <div class="right floated content"> - <button class="ui red tiny button delete-button" id="revoke-gitea-oauth2-grant" + <button class="ui red tiny button delete-button" data-modal-id="revoke-gitea-oauth2-grant" data-url="{{AppSubUrl}}/user/settings/applications/oauth2/revoke" data-id="{{$grant.ID}}"> {{$.i18n.Tr "settings.revoke_key"}} diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl index 2d80d48156..c840801e5a 100644 --- a/templates/user/settings/keys_gpg.tmpl +++ b/templates/user/settings/keys_gpg.tmpl @@ -12,7 +12,7 @@ {{range .GPGKeys}} <div class="item"> <div class="right floated content"> - <button class="ui red tiny button delete-button" id="delete-gpg" data-url="{{$.Link}}/delete?type=gpg" data-id="{{.ID}}"> + <button class="ui red tiny button delete-button" data-modal-id="delete-gpg" data-url="{{$.Link}}/delete?type=gpg" data-id="{{.ID}}"> {{$.i18n.Tr "settings.delete_key"}} </button> {{if and (not .Verified) (ne $.VerifyingID .KeyID)}} diff --git a/templates/user/settings/keys_principal.tmpl b/templates/user/settings/keys_principal.tmpl index e8057c7cf3..9d8ebab609 100644 --- a/templates/user/settings/keys_principal.tmpl +++ b/templates/user/settings/keys_principal.tmpl @@ -17,7 +17,7 @@ {{range .Principals}} <div class="item"> <div class="right floated content"> - <button class="ui red tiny button delete-button" id="delete-principal" data-url="{{$.Link}}/delete?type=principal" data-id="{{.ID}}"> + <button class="ui red tiny button delete-button" data-modal-id="delete-principal" data-url="{{$.Link}}/delete?type=principal" data-id="{{.ID}}"> {{$.i18n.Tr "settings.delete_key"}} </button> </div> diff --git a/templates/user/settings/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl index 62e697ad19..3d05578666 100644 --- a/templates/user/settings/keys_ssh.tmpl +++ b/templates/user/settings/keys_ssh.tmpl @@ -16,7 +16,7 @@ {{range $index, $key := .Keys}} <div class="item"> <div class="right floated content"> - <button class="ui red tiny button delete-button{{if index $.ExternalKeys $index}} disabled{{end}}" id="delete-ssh" data-url="{{$.Link}}/delete?type=ssh" data-id="{{.ID}}"{{if index $.ExternalKeys $index}} title="{{$.i18n.Tr "settings.ssh_externally_managed"}}"{{end}}> + <button class="ui red tiny button delete-button{{if index $.ExternalKeys $index}} disabled{{end}}" data-modal-id="delete-ssh" data-url="{{$.Link}}/delete?type=ssh" data-id="{{.ID}}"{{if index $.ExternalKeys $index}} title="{{$.i18n.Tr "settings.ssh_externally_managed"}}"{{end}}> {{$.i18n.Tr "settings.delete_key"}} </button> </div> diff --git a/templates/user/settings/security_accountlinks.tmpl b/templates/user/settings/security_accountlinks.tmpl index 5aa9282083..7a9935d031 100644 --- a/templates/user/settings/security_accountlinks.tmpl +++ b/templates/user/settings/security_accountlinks.tmpl @@ -10,7 +10,7 @@ {{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="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}"> + <button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}"> {{$.i18n.Tr "settings.delete_key"}} </button> </div> diff --git a/templates/user/settings/security_openid.tmpl b/templates/user/settings/security_openid.tmpl index 118f16203d..2a167a712b 100644 --- a/templates/user/settings/security_openid.tmpl +++ b/templates/user/settings/security_openid.tmpl @@ -9,7 +9,7 @@ {{range .OpenIDs}} <div class="item"> <div class="right floated content"> - <button class="ui red tiny button delete-button" id="delete-openid" data-url="{{AppSubUrl}}/user/settings/security/openid/delete" data-id="{{.ID}}"> + <button class="ui red tiny button delete-button" data-modal-id="delete-openid" data-url="{{AppSubUrl}}/user/settings/security/openid/delete" data-id="{{.ID}}"> {{$.i18n.Tr "settings.delete_key"}} </button> </div> diff --git a/templates/user/settings/security_twofa.tmpl b/templates/user/settings/security_twofa.tmpl index 860bfdf569..f48b2f4cb2 100644 --- a/templates/user/settings/security_twofa.tmpl +++ b/templates/user/settings/security_twofa.tmpl @@ -13,7 +13,7 @@ <form class="ui form" action="{{AppSubUrl}}/user/settings/security/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> + <div class="ui red button delete-button" data-modal-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> diff --git a/templates/user/settings/security_u2f.tmpl b/templates/user/settings/security_u2f.tmpl index dcc56d8729..8fe01d8c70 100644 --- a/templates/user/settings/security_u2f.tmpl +++ b/templates/user/settings/security_u2f.tmpl @@ -8,7 +8,7 @@ {{range .U2FRegistrations}} <div class="item"> <div class="right floated content"> - <button class="ui red tiny button delete-button" id="delete-registration" data-url="{{$.Link}}/u2f/delete" data-id="{{.ID}}"> + <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> |