diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-24 19:08:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-24 07:08:59 -0400 |
commit | 75c62054a633fc9ae25887f72da1ec2d08a31e90 (patch) | |
tree | aa36b43874d7c556120c04b646175d52de5ee10d /templates/user | |
parent | 47748df9b38bdde4c39d7e55f4517536d9d2fa21 (diff) | |
download | gitea-75c62054a633fc9ae25887f72da1ec2d08a31e90.tar.gz gitea-75c62054a633fc9ae25887f72da1ec2d08a31e90.zip |
Improve some modal action buttons (#24289)
Follow #24097 and #24285
And add a devtest page for modal action button testing.
http://localhost:3000/devtest/fomantic-modal
Now the `modal_actions_confirm.tmpl` could support: green / blue /
yellow positive buttons, the negative button is "secondary".
ps: this PR is only a small improvement, there are still a lot of
buttons not having proper colors. In the future these buttons could be
improved by this approach.
These buttons could also be improved according to the conclusion of
#24285 in the future.
![image](https://user-images.githubusercontent.com/2114189/233847773-a6d6b29b-7b5c-490e-8425-40dfd0ad2529.png)
And add GitHub-like single danger button (context:
https://github.com/go-gitea/gitea/issues/24285#issuecomment-1519100312)
![image](https://user-images.githubusercontent.com/2114189/233891566-055d7611-894d-4d5a-baf5-f6369180bf8d.png)
---------
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'templates/user')
-rw-r--r-- | templates/user/settings/account.tmpl | 4 | ||||
-rw-r--r-- | templates/user/settings/applications.tmpl | 14 | ||||
-rw-r--r-- | templates/user/settings/applications_oauth2_list.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/organization.tmpl | 2 | ||||
-rw-r--r-- | templates/user/settings/repos.tmpl | 17 | ||||
-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/webauthn.tmpl | 2 |
13 files changed, 18 insertions, 37 deletions
diff --git a/templates/user/settings/account.tmpl b/templates/user/settings/account.tmpl index fe8e733219..451b0ca0e0 100644 --- a/templates/user/settings/account.tmpl +++ b/templates/user/settings/account.tmpl @@ -157,7 +157,7 @@ </div> </div> -<div class="ui gitea-confirm-modal delete modal" id="delete-email"> +<div class="ui g-modal-confirm delete modal" id="delete-email"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.email_deletion"}} @@ -168,7 +168,7 @@ {{template "base/modal_actions_confirm" .}} </div> -<div class="ui gitea-confirm-modal delete modal" id="delete-account"> +<div class="ui g-modal-confirm delete modal" id="delete-account"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.delete_account_title"}} diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index fb1154d0c8..142bfa0a2d 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -264,7 +264,7 @@ {{end}} </div> -<div class="ui gitea-confirm-modal delete modal" id="delete-token"> +<div class="ui g-modal-confirm delete modal" id="delete-token"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.access_token_deletion"}} @@ -272,17 +272,7 @@ <div class="content"> <p>{{.locale.Tr "settings.access_token_deletion_desc"}}</p> </div> - - <div class="actions">{{/* TODO: Convert to base/modal_actions_confirm.tmpl */}} - <button class="ui green basic inverted cancel button"> - {{svg "octicon-x"}} - {{.locale.Tr "settings.access_token_deletion_cancel_action"}} - </button> - <button class="ui red basic inverted ok button"> - {{svg "octicon-check"}} - {{.locale.Tr "settings.access_token_deletion_confirm_action"}} - </button> - </div> + {{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonColors" "yellow")}} </div> {{template "user/settings/layout_footer" .}} diff --git a/templates/user/settings/applications_oauth2_list.tmpl b/templates/user/settings/applications_oauth2_list.tmpl index 5a9554b030..ad38c60eb9 100644 --- a/templates/user/settings/applications_oauth2_list.tmpl +++ b/templates/user/settings/applications_oauth2_list.tmpl @@ -47,7 +47,7 @@ </form> </div> -<div class="ui gitea-confirm-modal delete modal" id="remove-gitea-oauth2-application"> +<div class="ui g-modal-confirm delete modal" id="remove-gitea-oauth2-application"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.remove_oauth2_application"}} diff --git a/templates/user/settings/grants_oauth2.tmpl b/templates/user/settings/grants_oauth2.tmpl index 3fe34a8727..a3b549722d 100644 --- a/templates/user/settings/grants_oauth2.tmpl +++ b/templates/user/settings/grants_oauth2.tmpl @@ -28,7 +28,7 @@ </div> </div> -<div class="ui gitea-confirm-modal delete modal" id="revoke-gitea-oauth2-grant"> +<div class="ui g-modal-confirm delete modal" id="revoke-gitea-oauth2-grant"> <div class="header"> {{svg "octicon-shield" 16 "gt-mr-2"}} {{.locale.Tr "settings.revoke_oauth2_grant"}} diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl index a488555404..d255760cd5 100644 --- a/templates/user/settings/keys_gpg.tmpl +++ b/templates/user/settings/keys_gpg.tmpl @@ -111,7 +111,7 @@ <br> <p>{{.locale.Tr "settings.gpg_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-commit-signature-verification#gpg-commit-signature-verification" | Str2html}}</p> -<div class="ui gitea-confirm-modal delete modal" id="delete-gpg"> +<div class="ui g-modal-confirm delete modal" id="delete-gpg"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.gpg_key_deletion"}} diff --git a/templates/user/settings/keys_principal.tmpl b/templates/user/settings/keys_principal.tmpl index 51009fdea1..7cde3e37af 100644 --- a/templates/user/settings/keys_principal.tmpl +++ b/templates/user/settings/keys_principal.tmpl @@ -54,7 +54,7 @@ </div> </div> - <div class="ui gitea-confirm-modal delete modal" id="delete-principal"> + <div class="ui g-modal-confirm delete modal" id="delete-principal"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.ssh_principal_deletion"}} diff --git a/templates/user/settings/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl index abe0624d96..bf2523f57b 100644 --- a/templates/user/settings/keys_ssh.tmpl +++ b/templates/user/settings/keys_ssh.tmpl @@ -100,7 +100,7 @@ <br> <p>{{.locale.Tr "settings.ssh_helper" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/connecting-to-github-with-ssh" "https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/troubleshooting-ssh" | Str2html}}</p> -<div class="ui gitea-confirm-modal delete modal" id="delete-ssh"> +<div class="ui g-modal-confirm delete modal" id="delete-ssh"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.ssh_key_deletion"}} diff --git a/templates/user/settings/organization.tmpl b/templates/user/settings/organization.tmpl index 088878e9cd..2e10588fd8 100644 --- a/templates/user/settings/organization.tmpl +++ b/templates/user/settings/organization.tmpl @@ -37,7 +37,7 @@ </div> </div> -<div class="ui gitea-confirm-modal delete modal" id="leave-organization"> +<div class="ui g-modal-confirm delete modal" id="leave-organization"> <div class="header"> {{$.locale.Tr "org.members.leave"}} </div> diff --git a/templates/user/settings/repos.tmpl b/templates/user/settings/repos.tmpl index 5e11f58988..3d9f4e5a80 100644 --- a/templates/user/settings/repos.tmpl +++ b/templates/user/settings/repos.tmpl @@ -35,7 +35,7 @@ <div class="right floated content"> {{if $.allowAdopt}} <button class="ui button submit tiny green adopt show-modal" data-modal="#adopt-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-plus"}}</span><span class="label">{{$.locale.Tr "repo.adopt_preexisting_label"}}</span></button> - <div class="ui gitea-confirm-modal modal" id="adopt-unadopted-modal-{{$dirI}}"> + <div class="ui g-modal-confirm modal" id="adopt-unadopted-modal-{{$dirI}}"> <div class="header"> <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> </div> @@ -46,22 +46,13 @@ {{$.CsrfTokenHtml}} <input type="hidden" name="id" value="{{$dir}}"> <input type="hidden" name="action" value="adopt"> - <div class="actions">{{/* TODO: Convert to base/modal_actions_confirm */}} - <button class="ui red basic inverted cancel button"> - {{svg "octicon-x"}} - {{$.locale.Tr "modal.no"}} - </button> - <button class="ui green basic inverted ok button"> - {{svg "octicon-check"}} - {{$.locale.Tr "modal.yes"}} - </button> - </div> + {{template "base/modal_actions_confirm" .}} </form> </div> {{end}} {{if $.allowDelete}} <button class="ui button submit tiny red delete show-modal" data-modal="#delete-unadopted-modal-{{$dirI}}"><span class="icon">{{svg "octicon-x"}}</span><span class="label">{{$.locale.Tr "repo.delete_preexisting_label"}}</span></button> - <div class="ui gitea-confirm-modal modal" id="delete-unadopted-modal-{{$dirI}}"> + <div class="ui g-modal-confirm modal" id="delete-unadopted-modal-{{$dirI}}"> <div class="header"> <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> </div> @@ -125,7 +116,7 @@ </div> </div> -<div class="ui gitea-confirm-modal delete modal"> +<div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.remove_account_link"}} diff --git a/templates/user/settings/security/accountlinks.tmpl b/templates/user/settings/security/accountlinks.tmpl index 196d07c56f..29fbe6832c 100644 --- a/templates/user/settings/security/accountlinks.tmpl +++ b/templates/user/settings/security/accountlinks.tmpl @@ -41,7 +41,7 @@ </div> </div> -<div class="ui gitea-confirm-modal delete modal" id="delete-account-link"> +<div class="ui g-modal-confirm delete modal" id="delete-account-link"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.remove_account_link"}} diff --git a/templates/user/settings/security/openid.tmpl b/templates/user/settings/security/openid.tmpl index 7a206a021a..2719b3b495 100644 --- a/templates/user/settings/security/openid.tmpl +++ b/templates/user/settings/security/openid.tmpl @@ -51,7 +51,7 @@ </form> </div> -<div class="ui gitea-confirm-modal delete modal" id="delete-openid"> +<div class="ui g-modal-confirm delete modal" id="delete-openid"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.openid_deletion"}} diff --git a/templates/user/settings/security/twofa.tmpl b/templates/user/settings/security/twofa.tmpl index f00651e7fc..43f324f40b 100644 --- a/templates/user/settings/security/twofa.tmpl +++ b/templates/user/settings/security/twofa.tmpl @@ -23,7 +23,7 @@ {{end}} </div> -<div class="ui gitea-confirm-modal delete modal" id="disable-twofa"> +<div class="ui g-modal-confirm delete modal" id="disable-twofa"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.twofa_disable"}} diff --git a/templates/user/settings/security/webauthn.tmpl b/templates/user/settings/security/webauthn.tmpl index 25b7f03fca..59022eb1c9 100644 --- a/templates/user/settings/security/webauthn.tmpl +++ b/templates/user/settings/security/webauthn.tmpl @@ -30,7 +30,7 @@ {{template "user/auth/webauthn_error" .}} -<div class="ui gitea-confirm-modal delete modal" id="delete-registration"> +<div class="ui g-modal-confirm delete modal" id="delete-registration"> <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.webauthn_delete_key"}} |