diff options
63 files changed, 285 insertions, 286 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index c0e94d3b87..b4233d65d1 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -462,6 +462,8 @@ team_invite.text_3 = Note: This invitation was intended for %[1]s. If you were n [modal] yes = Yes no = No +confirm = Confirm +cancel = Cancel modify = Update [form] diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index 49007e572d..c3ff228ac0 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -440,14 +440,14 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "admin.auths.delete_auth_title"}} </div> <div class="content"> <p>{{.locale.Tr "admin.auths.delete_auth_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index d8fa986cff..61af571095 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -73,11 +73,11 @@ {{template "base/paginate" .}} - <div class="ui basic modal" id="change-email-modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="change-email-modal"> + <div class="header"> {{.locale.Tr "admin.emails.change_email_header"}} </div> - <div class="content center"> + <div class="content"> <p class="center">{{.locale.Tr "admin.emails.change_email_text"}}</p> <form class="ui form" id="email-action-form" action="{{AppSubUrl}}/admin/emails/activate" method="post"> @@ -94,7 +94,7 @@ <input type="hidden" id="form-activate" name="activate" value="" required> <div class="center"> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> </form> </div> diff --git a/templates/admin/monitor.tmpl b/templates/admin/monitor.tmpl index d53e9e18dc..4d66d3bfbb 100644 --- a/templates/admin/monitor.tmpl +++ b/templates/admin/monitor.tmpl @@ -37,15 +37,14 @@ {{template "admin/process" .}} </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{.locale.Tr "admin.monitor.process.cancel"}} </div> <div class="content"> <p>{{$.locale.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p> <p>{{$.locale.Tr "admin.monitor.process.cancel_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/admin/notice.tmpl b/templates/admin/notice.tmpl index dd17bde036..850b6333f2 100644 --- a/templates/admin/notice.tmpl +++ b/templates/admin/notice.tmpl @@ -72,7 +72,6 @@ </div> <div class="ui modal admin" id="detail-modal"> - {{svg "octicon-x" 16 "close inside"}} <div class="header">{{$.locale.Tr "admin.notices.view_detail_header"}}</div> <div class="content"> <div class="sub header"></div> diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index 121f575861..6b3480d427 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -80,14 +80,14 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "packages.settings.delete"}} </div> <div class="content"> {{.locale.Tr "packages.settings.delete.notice" `<span class="name"></span>` `<span class="dataVersion"></span>` | Safe}} </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/admin/queue.tmpl b/templates/admin/queue.tmpl index 767c235a38..10c35bd599 100644 --- a/templates/admin/queue.tmpl +++ b/templates/admin/queue.tmpl @@ -181,16 +181,15 @@ </div> </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{.locale.Tr "admin.monitor.queue.pool.cancel"}} </div> <div class="content"> <p>{{$.locale.Tr "admin.monitor.queue.pool.cancel_notices" `<span class="name"></span>` | Safe}}</p> <p>{{$.locale.Tr "admin.monitor.queue.pool.cancel_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index f8e2bbc844..1574a37668 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -95,8 +95,8 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.settings.delete"}} </div> @@ -105,6 +105,6 @@ {{.locale.Tr "repo.settings.delete_notices_2" `<span class="name"></span>` | Safe}}<br> {{.locale.Tr "repo.settings.delete_notices_fork_1"}}<br> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/admin/repo/unadopted.tmpl b/templates/admin/repo/unadopted.tmpl index a8e04850d0..fbb0bdf0e8 100644 --- a/templates/admin/repo/unadopted.tmpl +++ b/templates/admin/repo/unadopted.tmpl @@ -29,8 +29,7 @@ <span class="name">{{$dir}}</span> <div class="right floated content"> <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 basic modal" id="adopt-unadopted-modal-{{$dirI}}"> - {{svg "octicon-x" 16 "close inside"}} + <div class="ui gitea-confirm-modal modal" id="adopt-unadopted-modal-{{$dirI}}"> <div class="header"> <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> </div> @@ -43,7 +42,7 @@ <input type="hidden" name="action" value="adopt"> <input type="hidden" name="q" value="{{$.Keyword}}"> <input type="hidden" name="page" value="{{$.CurrentPage}}"> - <div class="actions"> + <div class="actions">{{/* TODO: Convert to base/modal_actions_confirm */}} <button class="ui red basic inverted cancel button"> {{svg "octicon-trash" 16 "gt-mr-2"}} {{$.locale.Tr "modal.no"}} @@ -56,8 +55,7 @@ </form> </div> <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 basic modal" id="delete-unadopted-modal-{{$dirI}}"> - {{svg "octicon-x" 16 "close inside"}} + <div class="ui gitea-confirm-modal modal" id="delete-unadopted-modal-{{$dirI}}"> <div class="header"> <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> </div> @@ -70,7 +68,7 @@ <input type="hidden" name="action" value="delete"> <input type="hidden" name="q" value="{{$.Keyword}}"> <input type="hidden" name="page" value="{{$.CurrentPage}}"> - <div class="actions"> + <div class="actions">{{/* TODO: Convert to base/modal_actions_confirm */}} <button class="ui red basic inverted cancel button"> {{svg "octicon-trash" 16 "gt-mr-2"}} {{$.locale.Tr "modal.no"}} diff --git a/templates/admin/stacktrace.tmpl b/templates/admin/stacktrace.tmpl index 4e16036ae3..2bef11fcf6 100644 --- a/templates/admin/stacktrace.tmpl +++ b/templates/admin/stacktrace.tmpl @@ -18,16 +18,15 @@ </div> </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{.locale.Tr "admin.monitor.process.cancel"}} </div> <div class="content"> <p>{{$.locale.Tr "admin.monitor.process.cancel_notices" `<span class="name"></span>` | Safe}}</p> <p>{{$.locale.Tr "admin.monitor.process.cancel_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl index 4fd0d892f2..6d916ae207 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -196,8 +196,8 @@ </div> </div> -<div class="ui small basic delete modal" id="delete-user-modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-user-modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.delete_account_title"}} </div> @@ -213,7 +213,7 @@ </div> <p class="help">{{.locale.Tr "admin.users.purge_help"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </form> </div> {{template "base/footer" .}} diff --git a/templates/base/delete_modal_actions.tmpl b/templates/base/delete_modal_actions.tmpl deleted file mode 100644 index 29bf5f92fd..0000000000 --- a/templates/base/delete_modal_actions.tmpl +++ /dev/null @@ -1,10 +0,0 @@ -<div class="actions"> - <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> diff --git a/templates/base/modal_actions_confirm.tmpl b/templates/base/modal_actions_confirm.tmpl new file mode 100644 index 0000000000..361f214466 --- /dev/null +++ b/templates/base/modal_actions_confirm.tmpl @@ -0,0 +1,21 @@ +{{/* +Template Attributes: +* locale +* ModalButtonStyle: "yes" (default) or "confirm" +* ModalButtonCancelText +* ModalButtonOkText + +The ".ok.button" and ".cancel.button" selectors are also used by Fomantic Modal internally +*/}} +<div class="actions"> + {{$textNegitive := .locale.Tr "modal.no"}} + {{$textPositive := .locale.Tr "modal.yes"}} + {{if eq .ModalButtonStyle "confirm"}} + {{$textNegitive = .locale.Tr "modal.cancel"}} + {{$textPositive = .locale.Tr "modal.confirm"}} + {{end}} + {{if .ModalButtonCancelText}}{{$textNegitive = .ModalButtonCancelText}}{{end}} + {{if .ModalButtonOkText}}{{$textPositive = .ModalButtonOkText}}{{end}} + <button class="ui red cancel button">{{svg "octicon-x"}} {{$textNegitive}}</button> + <button class="ui green ok button">{{svg "octicon-check"}} {{$textPositive}}</button> +</div> diff --git a/templates/org/member/members.tmpl b/templates/org/member/members.tmpl index 511d333c29..7b6c83cfcc 100644 --- a/templates/org/member/members.tmpl +++ b/templates/org/member/members.tmpl @@ -81,25 +81,23 @@ {{template "base/paginate" .}} </div> </div> -<div class="ui small basic delete modal" id="leave-organization"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal" id="leave-organization"> + <div class="header"> {{$.locale.Tr "org.members.leave"}} </div> <div class="content"> <p>{{$.locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> -<div class="ui small basic delete modal" id="remove-organization-member"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal" id="remove-organization-member"> + <div class="header"> {{$.locale.Tr "org.members.remove"}} </div> <div class="content"> <p>{{$.locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataOrganizationName"></span>` | Safe}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/org/settings/delete.tmpl b/templates/org/settings/delete.tmpl index 69e226f410..e8a8f5b185 100644 --- a/templates/org/settings/delete.tmpl +++ b/templates/org/settings/delete.tmpl @@ -29,14 +29,14 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "org.settings.delete_org_title"}} </div> <div class="content"> <p>{{.locale.Tr "org.settings.delete_org_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/org/team/members.tmpl b/templates/org/team/members.tmpl index bb975c0c4d..e387090b3b 100644 --- a/templates/org/team/members.tmpl +++ b/templates/org/team/members.tmpl @@ -64,14 +64,13 @@ </div> </div> </div> -<div class="ui small basic delete modal" id="remove-team-member"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal" id="remove-team-member"> + <div class="header"> {{$.locale.Tr "org.members.remove"}} </div> <div class="content"> <p>{{$.locale.Tr "org.members.remove.detail" `<span class="name"></span>` `<span class="dataTeamName"></span>` | Safe}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl index 2e65d63580..2860ea497b 100644 --- a/templates/org/team/new.tmpl +++ b/templates/org/team/new.tmpl @@ -148,14 +148,14 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "org.teams.delete_team_title"}} </div> <div class="content"> <p>{{.locale.Tr "org.teams.delete_team_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl index 0ffd50226f..41561da311 100644 --- a/templates/org/team/repositories.tmpl +++ b/templates/org/team/repositories.tmpl @@ -64,26 +64,26 @@ </div> </div> -<div class="ui small basic delete modal" id="org-team-remove-all-repo"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="org-team-remove-all-repo"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "org.teams.remove_all_repos_title"}} </div> <div class="content"> <p>{{.locale.Tr "org.teams.remove_all_repos_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> -<div class="ui small basic addall modal" id="org-team-add-all-repo"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal addall modal" id="org-team-add-all-repo"> + <div class="header"> {{svg "octicon-globe"}} {{.locale.Tr "org.teams.add_all_repos_title"}} </div> <div class="content"> <p>{{.locale.Tr "org.teams.add_all_repos_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl index cecd8ddee6..f265255256 100644 --- a/templates/org/team/sidebar.tmpl +++ b/templates/org/team/sidebar.tmpl @@ -83,13 +83,12 @@ </div> {{end}} </div> -<div class="ui small basic delete modal" id="leave-team-sidebar"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal" id="leave-team-sidebar"> + <div class="header"> {{$.locale.Tr "org.teams.leave"}} </div> <div class="content"> <p>{{$.locale.Tr "org.teams.leave.detail" `<span class="name"></span>` | Safe}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/org/team/teams.tmpl b/templates/org/team/teams.tmpl index 27bbe80a3c..c31b6caf1c 100644 --- a/templates/org/team/teams.tmpl +++ b/templates/org/team/teams.tmpl @@ -43,14 +43,13 @@ </div> </div> </div> -<div class="ui small basic delete modal" id="leave-team"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal" id="leave-team"> + <div class="header"> {{$.locale.Tr "org.teams.leave"}} </div> <div class="content"> <p>{{$.locale.Tr "org.teams.leave.detail" `<span class="name"></span>` | Safe}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/package/settings.tmpl b/templates/package/settings.tmpl index 875bf852bb..a443a8d27f 100644 --- a/templates/package/settings.tmpl +++ b/templates/package/settings.tmpl @@ -57,7 +57,7 @@ <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <input type="hidden" name="action" value="delete"> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </form> </div> </div> diff --git a/templates/projects/list.tmpl b/templates/projects/list.tmpl index ae9e3a0d11..bcb402601c 100644 --- a/templates/projects/list.tmpl +++ b/templates/projects/list.tmpl @@ -76,14 +76,14 @@ </div> {{if $.CanWriteProjects}} -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.projects.deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.projects.deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{end}} diff --git a/templates/projects/view.tmpl b/templates/projects/view.tmpl index 338524d153..34eaf93670 100644 --- a/templates/projects/view.tmpl +++ b/templates/projects/view.tmpl @@ -99,7 +99,6 @@ data-modal="#default-project-board-modal-{{.ID}}" data-modal-default-project-board-header="{{$.locale.Tr "repo.projects.column.set_default"}}" data-modal-default-project-board-content="{{$.locale.Tr "repo.projects.column.set_default_desc"}}" - data-modal-default-project-board-submit="{{$.locale.Tr "repo.projects.column.set_default"}}" data-url="{{$.Link}}/{{.ID}}/default"> {{svg "octicon-pin"}} {{$.locale.Tr "repo.projects.column.set_default"}} @@ -109,13 +108,15 @@ data-modal="#default-project-board-modal-{{.ID}}" data-modal-default-project-board-header="{{$.locale.Tr "repo.projects.column.unset_default"}}" data-modal-default-project-board-content="{{$.locale.Tr "repo.projects.column.unset_default_desc"}}" - data-modal-default-project-board-submit="{{$.locale.Tr "repo.projects.column.unset_default"}}" data-url="{{$.Link}}/{{.ID}}/unsetdefault"> {{svg "octicon-pin"}} {{$.locale.Tr "repo.projects.column.unset_default"}} </a> {{end}} - <a class="item show-modal button" data-modal="#delete-board-modal-{{.ID}}"> + <a class="item show-modal button show-delete-column-modal" + data-modal="#delete-board-modal-{{.ID}}" + data-url="{{$.Link}}/{{.ID}}" + > {{svg "octicon-trash"}} {{$.locale.Tr "repo.projects.column.delete"}} </a> @@ -149,32 +150,26 @@ </div> </div> - <div class="ui basic modal default-project-board-modal" id="default-project-board-modal-{{.ID}}"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal default-project-board-modal" id="default-project-board-modal-{{.ID}}"> + <div class="header"> <span id="default-project-board-header"></span> </div> - <div class="content center"> + <div class="content"> <label id="default-project-board-content"></label> </div> - <div class="text right actions"> - <button class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</button> - <button class="ui primary button default-project-board-button" id="default-project-board-submit"></button> - </div> + {{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonStyle" "confirm")}} </div> - <div class="ui basic modal" id="delete-board-modal-{{.ID}}"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="delete-board-modal-{{.ID}}"> + <div class="header"> {{$.locale.Tr "repo.projects.column.delete"}} </div> - <div class="content center"> + <div class="content"> <label> {{$.locale.Tr "repo.projects.column.deletion_desc"}} </label> </div> - <div class="text right actions">{{/* TODO: convert to base/delete_modal_actions.tmpl */}} - <button class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</button> - <button class="ui red button delete-project-board" data-url="{{$.Link}}/{{.ID}}">{{$.locale.Tr "repo.projects.column.delete"}}</button> - </div> + {{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonStyle" "confirm")}} </div> </div> </div> @@ -277,14 +272,14 @@ </div> {{if .CanWriteProjects}} - <div class="ui small basic delete modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.projects.deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.projects.deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{end}} diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 6dd6aecb37..98862bfd8e 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -147,15 +147,15 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.branch.delete_html"}} <span class="name"></span> </div> <div class="content"> <p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> <div class="ui small modal" id="create-branch-modal"> diff --git a/templates/repo/commit_page.tmpl b/templates/repo/commit_page.tmpl index 8d72cd1420..00e6220c3e 100644 --- a/templates/repo/commit_page.tmpl +++ b/templates/repo/commit_page.tmpl @@ -59,11 +59,11 @@ data-modal-cherry-pick-header="{{$.locale.Tr "repo.commit.cherry-pick-header" (ShortSha .CommitID)}}" data-modal-cherry-pick-content="{{$.locale.Tr "repo.commit.cherry-pick-content"}}" data-modal-cherry-pick-submit="{{.locale.Tr "repo.commit.cherry-pick"}}">{{.locale.Tr "repo.commit.cherry-pick"}}</div> - <div class="ui basic modal" id="cherry-pick-modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="cherry-pick-modal"> + <div class="header"> <span id="cherry-pick-header"></span> </div> - <div class="content center"> + <div class="content"> <p id="cherry-pick-content" class="branch-dropdown"></p> {{template "repo/branch_dropdown" dict "root" . "noTag" true "disableCreateBranch" true diff --git a/templates/repo/editor/edit.tmpl b/templates/repo/editor/edit.tmpl index 0ac6e93d49..1c0682f4d5 100644 --- a/templates/repo/editor/edit.tmpl +++ b/templates/repo/editor/edit.tmpl @@ -56,8 +56,8 @@ </div> - <div class="ui small basic modal" id="edit-empty-content-modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="edit-empty-content-modal"> + <div class="header"> {{svg "octicon-file"}} {{.locale.Tr "repo.editor.commit_empty_file_header"}} </div> diff --git a/templates/repo/editor/patch.tmpl b/templates/repo/editor/patch.tmpl index 97637027bb..a211187d06 100644 --- a/templates/repo/editor/patch.tmpl +++ b/templates/repo/editor/patch.tmpl @@ -36,8 +36,8 @@ </form> </div> - <div class="ui small basic modal" id="edit-empty-content-modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="edit-empty-content-modal"> + <div class="header"> {{svg "octicon-file"}} {{.locale.Tr "repo.editor.commit_empty_file_header"}} </div> diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index a999c73804..5f2e135b98 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -118,7 +118,6 @@ {{svg "octicon-repo-forked"}}{{$.locale.Tr "repo.fork"}} </a> <div class="ui small modal" id="fork-repo-modal"> - {{svg "octicon-x" 16 "close inside"}} <div class="header"> {{$.locale.Tr "repo.already_forked" .Name}} </div> diff --git a/templates/repo/issue/labels/edit_delete_label.tmpl b/templates/repo/issue/labels/edit_delete_label.tmpl index 52e586b783..32e5a140ae 100644 --- a/templates/repo/issue/labels/edit_delete_label.tmpl +++ b/templates/repo/issue/labels/edit_delete_label.tmpl @@ -1,12 +1,12 @@ -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.issues.label_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.issues.label_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> <div class="ui small edit-label modal"> diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index e54a72714a..c07232c759 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -116,15 +116,15 @@ </div> {{if or .CanWriteIssues .CanWritePulls}} - <div class="ui small basic delete modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.milestones.deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.milestones.deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{end}} {{template "base/footer" .}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 081b7d08c6..8112373f06 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -197,13 +197,13 @@ <span class="no-content">{{.locale.Tr "repo.issues.no_content"}}</span> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.branch.delete" .HeadTarget}} </div> <div class="content"> <p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/issue/view_content/comments_delete_time.tmpl b/templates/repo/issue/view_content/comments_delete_time.tmpl index a0d6b0ea05..d86cc52d3a 100644 --- a/templates/repo/issue/view_content/comments_delete_time.tmpl +++ b/templates/repo/issue/view_content/comments_delete_time.tmpl @@ -7,7 +7,7 @@ {{.ctxData.CsrfTokenHtml}} </form> <div class="header">{{.ctxData.locale.Tr "repo.issues.del_time"}}</div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> <button class="ui icon button compact mini issue-delete-time" data-id="{{.comment.Time.ID}}" data-tooltip-content="{{.ctxData.locale.Tr "repo.issues.del_time"}}"> {{svg "octicon-trash"}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 290488d9fb..bab9ff1936 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -542,8 +542,8 @@ {{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}} <input type="hidden" id="crossRepoSearch" value="{{.AllowCrossRepositoryDependencies}}"> - <div class="ui basic modal remove-dependency"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal remove-dependency"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.issues.dependency.remove_header"}} </div> @@ -559,16 +559,9 @@ {{.locale.Tr "repo.issues.dependency.issue_remove_text"}} {{end}}</p> </div> - <div class="actions"> - <button class="ui red cancel inverted button"> - {{svg "octicon-x"}} - {{.locale.Tr "repo.issues.dependency.cancel"}} - </button> - <button class="ui green ok inverted button"> - {{svg "octicon-check"}} - {{.locale.Tr "repo.issues.dependency.remove"}} - </button> - </div> + {{$ModalButtonCancelText := .locale.Tr "repo.issues.dependency.cancel"}} + {{$ModalButtonOkText := .locale.Tr "repo.issues.dependency.remove"}} + {{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}} </div> {{end}} {{end}} @@ -663,15 +656,15 @@ {{svg "octicon-trash"}} {{.locale.Tr "repo.issues.delete"}} </button> - <div class="ui basic modal" id="delete"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="delete"> + <div class="header"> {{if .Issue.IsPull}} {{.locale.Tr "repo.pulls.delete.title"}} {{else}} {{.locale.Tr "repo.issues.delete.title"}} {{end}} </div> - <div class="content center"> + <div class="content"> <p> {{if .Issue.IsPull}} {{.locale.Tr "repo.pulls.delete.text"}} @@ -682,10 +675,7 @@ </div> <form action="{{.Issue.Link}}/delete" method="post"> {{.CsrfTokenHtml}} - <div class="center actions"> - <button class="ui basic cancel inverted button">{{.locale.Tr "settings.cancel"}}</button> - <button class="ui basic red inverted button">{{.locale.Tr "modal.yes"}}</button> - </div> + {{template "base/modal_actions_confirm" .}} </form> </div> {{end}} diff --git a/templates/repo/projects/list.tmpl b/templates/repo/projects/list.tmpl index 8cf5d716f1..ebe6008bba 100644 --- a/templates/repo/projects/list.tmpl +++ b/templates/repo/projects/list.tmpl @@ -78,15 +78,15 @@ </div> {{if .CanWriteProjects}} -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.projects.deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.projects.deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{end}} {{template "base/footer" .}} diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index 2ad40d700a..cff78df70b 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -103,7 +103,6 @@ data-modal="#default-project-board-modal-{{.ID}}" data-modal-default-project-board-header="{{$.locale.Tr "repo.projects.column.set_default"}}" data-modal-default-project-board-content="{{$.locale.Tr "repo.projects.column.set_default_desc"}}" - data-modal-default-project-board-submit="{{$.locale.Tr "repo.projects.column.set_default"}}" data-type="set_default" data-url="{{$.Link}}/{{.ID}}/default"> {{svg "octicon-pin"}} @@ -114,14 +113,16 @@ data-modal="#default-project-board-modal-{{.ID}}" data-modal-default-project-board-header="{{$.locale.Tr "repo.projects.column.unset_default"}}" data-modal-default-project-board-content="{{$.locale.Tr "repo.projects.column.unset_default_desc"}}" - data-modal-default-project-board-submit="{{$.locale.Tr "repo.projects.column.unset_default"}}" data-type="unset_default" data-url="{{$.Link}}/{{.ID}}/unsetdefault"> {{svg "octicon-pin"}} {{$.locale.Tr "repo.projects.column.unset_default"}} </a> {{end}} - <a class="item show-modal button" data-modal="#delete-board-modal-{{.ID}}"> + <a class="item show-modal button show-delete-column-modal" + data-modal="#delete-board-modal-{{.ID}}" + data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}" + > {{svg "octicon-trash"}} {{$.locale.Tr "repo.projects.column.delete"}} </a> @@ -155,32 +156,26 @@ </div> </div> - <div class="ui basic modal default-project-board-modal" id="default-project-board-modal-{{.ID}}"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal default-project-board-modal" id="default-project-board-modal-{{.ID}}"> + <div class="header"> <span id="default-project-board-header"></span> </div> - <div class="content center"> + <div class="content"> <label id="default-project-board-content"></label> </div> - <div class="text right actions"> - <button class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</button> - <button class="ui primary button default-project-board-button" id="default-project-board-submit"></button> - </div> + {{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonStyle" "confirm")}} </div> - <div class="ui basic modal" id="delete-board-modal-{{.ID}}"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="delete-board-modal-{{.ID}}"> + <div class="header"> {{$.locale.Tr "repo.projects.column.delete"}} </div> - <div class="content center"> + <div class="content"> <label> {{$.locale.Tr "repo.projects.column.deletion_desc"}} </label> </div> - <div class="text right actions">{{/* TODO: Convert to base/delete_modal_actions.tmpl? */}} - <button class="ui cancel button">{{$.locale.Tr "settings.cancel"}}</button> - <button class="ui red button delete-project-board" data-url="{{$.RepoLink}}/projects/{{$.Project.ID}}/{{.ID}}">{{$.locale.Tr "repo.projects.column.delete"}}</button> - </div> + {{template "base/modal_actions_confirm" (dict "locale" $.locale "ModalButtonStyle" "confirm")}} </div> </div> </div> @@ -283,15 +278,15 @@ </div> {{if or .CanWriteIssues .CanWritePulls}} - <div class="ui small basic delete modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.projects.deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.projects.deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{end}} diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl index 8e1793a5ba..1ddb479317 100644 --- a/templates/repo/release/list.tmpl +++ b/templates/repo/release/list.tmpl @@ -184,15 +184,15 @@ </div> {{if (and ($.Permission.CanWrite $.UnitTypeCode) .PageIsTagList)}} - <div class="ui small basic delete modal"> - <div class="ui header"> - {{svg "octicon-trash" 16 "gt-mr-2"}} + <div class="ui gitea-confirm-modal delete modal"> + <div class="header"> + {{svg "octicon-trash"}} {{.locale.Tr "repo.release.delete_tag"}} </div> <div class="content"> <p>{{.locale.Tr "repo.release.deletion_tag_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{end}} diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index ddedfd6086..de5946fe68 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -138,15 +138,15 @@ </div> {{if .PageIsEditRelease}} - <div class="ui small basic delete modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.release.deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.release.deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{end}} {{template "base/footer" .}} diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl index 6e51fc7bb2..53e1b00f6f 100644 --- a/templates/repo/settings/branches.tmpl +++ b/templates/repo/settings/branches.tmpl @@ -96,15 +96,15 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui header"> - {{svg "octicon-trash" 16 "gt-mr-2"}} +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> + {{svg "octicon-trash"}} {{.locale.Tr "repo.settings.protected_branch_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.settings.protected_branch_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index 654bbba5d0..d9a415662e 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -112,14 +112,14 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.settings.collaborator_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.settings.collaborator_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl index 33f3937201..a0f802e49a 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -77,14 +77,14 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.settings.deploy_key_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.settings.deploy_key_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/repo/settings/lfs.tmpl b/templates/repo/settings/lfs.tmpl index 8be28ad9ed..b4ffa1894f 100644 --- a/templates/repo/settings/lfs.tmpl +++ b/templates/repo/settings/lfs.tmpl @@ -40,17 +40,17 @@ </table> {{template "base/paginate" .}} {{range .LFSFiles}} - <div class="ui basic modal" id="delete-{{.Oid}}"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="delete-{{.Oid}}"> + <div class="header"> {{$.locale.Tr "repo.settings.lfs_delete" .Oid}} </div> - <div class="content center"> + <div class="content"> <p> {{$.locale.Tr "repo.settings.lfs_delete_warning"}} </p> <form class="ui form" action="{{$.Link}}/delete/{{.Oid}}" method="post"> {{$.CsrfTokenHtml}} - <div class="center actions">{{/* TODO: Convert to base/delete_modal_actions */}} + <div class="actions">{{/* TODO: Convert to base/modal_actions_confirm */}} <button class="ui basic cancel inverted button">{{$.locale.Tr "settings.cancel"}}</button> <button class="ui basic inverted yellow button">{{$.locale.Tr "modal.yes"}}</button> </div> diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 81c1e4759e..70850a6ea4 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -967,15 +967,15 @@ {{end}} {{if not .Repository.IsMirror}} - <div class="ui basic modal" id="archive-repo-modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal modal" id="archive-repo-modal"> + <div class="header"> {{if .Repository.IsArchived}} {{.locale.Tr "repo.settings.unarchive.header"}} {{else}} {{.locale.Tr "repo.settings.archive.header"}} {{end}} </div> - <div class="content center"> + <div class="content"> <p> {{if .Repository.IsArchived}} {{.locale.Tr "repo.settings.unarchive.text"}} @@ -988,7 +988,7 @@ {{.CsrfTokenHtml}} <input type="hidden" name="action" value="{{if .Repository.IsArchived}}unarchive{{else}}archive{{end}}"> <input type="hidden" name="repo_id" value="{{.Repository.ID}}"> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </form> </div> {{end}} diff --git a/templates/repo/settings/webhook/delete_modal.tmpl b/templates/repo/settings/webhook/delete_modal.tmpl index f455899663..209e39a96b 100644 --- a/templates/repo/settings/webhook/delete_modal.tmpl +++ b/templates/repo/settings/webhook/delete_modal.tmpl @@ -1,10 +1,10 @@ -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.settings.webhook_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "repo.settings.webhook_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index 123511d011..74e4090b9a 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -99,15 +99,15 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "repo.wiki.delete_page_button"}} </div> <div class="content"> <p>{{.locale.Tr "repo.wiki.delete_page_notice_1" ($title|Escape) | Safe}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/shared/actions/runner_edit.tmpl b/templates/shared/actions/runner_edit.tmpl index 40b4924743..d92010ce11 100644 --- a/templates/shared/actions/runner_edit.tmpl +++ b/templates/shared/actions/runner_edit.tmpl @@ -89,14 +89,14 @@ </table> {{template "base/paginate" .}} </div> - <div class="ui small basic delete modal" id="runner-delete-modal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal delete modal" id="runner-delete-modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "actions.runners.delete_runner_header"}} </div> <div class="content"> <p>{{.locale.Tr "actions.runners.delete_runner_notice" | Safe}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> </div> diff --git a/templates/shared/secrets/add_list.tmpl b/templates/shared/secrets/add_list.tmpl index 4aa5f0ccd5..659836eadd 100644 --- a/templates/shared/secrets/add_list.tmpl +++ b/templates/shared/secrets/add_list.tmpl @@ -56,13 +56,13 @@ {{.locale.Tr "secrets.none"}} {{end}} </div> -<div class="ui small basic delete modal"> - <div class="ui header"> - {{svg "octicon-trash" 16 "gt-mr-2"}} +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> + {{svg "octicon-trash"}} {{.locale.Tr "secrets.deletion"}} </div> <div class="content"> <p>{{.locale.Tr "secrets.deletion.description"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/account.tmpl b/templates/user/settings/account.tmpl index 53f7d021e0..2ad3eb7af2 100644 --- a/templates/user/settings/account.tmpl +++ b/templates/user/settings/account.tmpl @@ -161,26 +161,26 @@ </div> </div> -<div class="ui small basic delete modal" id="delete-email"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-email"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.email_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "settings.email_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> -<div class="ui small basic delete modal" id="delete-account"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-account"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.delete_account_title"}} </div> <div class="content"> <p>{{.locale.Tr "settings.delete_account_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/user/settings/applications.tmpl b/templates/user/settings/applications.tmpl index 2694f5cad0..bb0fba8f4f 100644 --- a/templates/user/settings/applications.tmpl +++ b/templates/user/settings/applications.tmpl @@ -268,8 +268,8 @@ </div> </div> -<div class="ui small basic delete modal" id="delete-token"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-token"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.access_token_deletion"}} </div> @@ -277,7 +277,7 @@ <p>{{.locale.Tr "settings.access_token_deletion_desc"}}</p> </div> - <div class="actions">{{/* TODO: Convert to base/delete_modal_actions.tmpl */}} + <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"}} diff --git a/templates/user/settings/applications_oauth2_list.tmpl b/templates/user/settings/applications_oauth2_list.tmpl index 8ec3045324..5a9554b030 100644 --- a/templates/user/settings/applications_oauth2_list.tmpl +++ b/templates/user/settings/applications_oauth2_list.tmpl @@ -47,13 +47,13 @@ </form> </div> -<div class="ui small basic delete modal" id="remove-gitea-oauth2-application"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="remove-gitea-oauth2-application"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.remove_oauth2_application"}} </div> <div class="content"> <p>{{.locale.Tr "settings.oauth2_application_remove_description"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/grants_oauth2.tmpl b/templates/user/settings/grants_oauth2.tmpl index 3b92f35f37..205b374176 100644 --- a/templates/user/settings/grants_oauth2.tmpl +++ b/templates/user/settings/grants_oauth2.tmpl @@ -28,13 +28,13 @@ </div> </div> -<div class="ui small basic delete modal" id="revoke-gitea-oauth2-grant"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="revoke-gitea-oauth2-grant"> + <div class="header"> {{svg "octicon-shield" 16 "gt-mr-2"}} {{.locale.Tr "settings.revoke_oauth2_grant"}} </div> <div class="content"> <p>{{.locale.Tr "settings.revoke_oauth2_grant_description"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/keys_gpg.tmpl b/templates/user/settings/keys_gpg.tmpl index 9ba9199db7..46b60aafd8 100644 --- a/templates/user/settings/keys_gpg.tmpl +++ b/templates/user/settings/keys_gpg.tmpl @@ -111,13 +111,13 @@ <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 small basic delete modal" id="delete-gpg"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-gpg"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.gpg_key_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "settings.gpg_key_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/keys_principal.tmpl b/templates/user/settings/keys_principal.tmpl index 6194db13ab..5251e465fd 100644 --- a/templates/user/settings/keys_principal.tmpl +++ b/templates/user/settings/keys_principal.tmpl @@ -54,14 +54,14 @@ </div> </div> - <div class="ui small basic delete modal" id="delete-principal"> - <div class="ui icon header"> + <div class="ui gitea-confirm-modal delete modal" id="delete-principal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.ssh_principal_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "settings.ssh_principal_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{end}} diff --git a/templates/user/settings/keys_ssh.tmpl b/templates/user/settings/keys_ssh.tmpl index b60434cae4..d66b4ea528 100644 --- a/templates/user/settings/keys_ssh.tmpl +++ b/templates/user/settings/keys_ssh.tmpl @@ -100,13 +100,13 @@ <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 small basic delete modal" id="delete-ssh"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-ssh"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.ssh_key_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "settings.ssh_key_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/organization.tmpl b/templates/user/settings/organization.tmpl index cd513db249..97b5a6a0bc 100644 --- a/templates/user/settings/organization.tmpl +++ b/templates/user/settings/organization.tmpl @@ -40,14 +40,13 @@ </div> </div> </div> -<div class="ui small basic delete modal" id="leave-organization"> - <div class="ui icon header"> - {{svg "octicon-x" 16 "close inside"}} +<div class="ui gitea-confirm-modal delete modal" id="leave-organization"> + <div class="header"> {{$.locale.Tr "org.members.leave"}} </div> <div class="content"> <p>{{$.locale.Tr "org.members.leave.detail" `<span class="dataOrganizationName"></span>` | Safe}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/user/settings/repos.tmpl b/templates/user/settings/repos.tmpl index 95ea8d7d0d..7f0b106614 100644 --- a/templates/user/settings/repos.tmpl +++ b/templates/user/settings/repos.tmpl @@ -38,8 +38,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 basic modal" id="adopt-unadopted-modal-{{$dirI}}"> - {{svg "octicon-x" 16 "close inside"}} + <div class="ui gitea-confirm-modal modal" id="adopt-unadopted-modal-{{$dirI}}"> <div class="header"> <span class="label">{{$.locale.Tr "repo.adopt_preexisting"}}</span> </div> @@ -50,7 +49,7 @@ {{$.CsrfTokenHtml}} <input type="hidden" name="id" value="{{$dir}}"> <input type="hidden" name="action" value="adopt"> - <div class="actions"> + <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"}} @@ -65,8 +64,7 @@ {{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 basic modal" id="delete-unadopted-modal-{{$dirI}}"> - {{svg "octicon-x" 16 "close inside"}} + <div class="ui gitea-confirm-modal modal" id="delete-unadopted-modal-{{$dirI}}"> <div class="header"> <span class="label">{{$.locale.Tr "repo.delete_preexisting"}}</span> </div> @@ -77,7 +75,7 @@ {{$.CsrfTokenHtml}} <input type="hidden" name="id" value="{{$dir}}"> <input type="hidden" name="action" value="delete"> - {{template "base/delete_modal_actions" $}} + {{template "base/modal_actions_confirm" $}} </form> </div> {{end}} @@ -131,14 +129,14 @@ </div> </div> -<div class="ui small basic delete modal"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.remove_account_link"}} </div> <div class="content"> <p>{{.locale.Tr "settings.remove_account_link_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> {{template "base/footer" .}} diff --git a/templates/user/settings/security/accountlinks.tmpl b/templates/user/settings/security/accountlinks.tmpl index e8eed63294..196d07c56f 100644 --- a/templates/user/settings/security/accountlinks.tmpl +++ b/templates/user/settings/security/accountlinks.tmpl @@ -41,13 +41,13 @@ </div> </div> -<div class="ui small basic delete modal" id="delete-account-link"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-account-link"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.remove_account_link"}} </div> <div class="content"> <p>{{.locale.Tr "settings.remove_account_link_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/security/openid.tmpl b/templates/user/settings/security/openid.tmpl index 5d6c9cf8cd..7a206a021a 100644 --- a/templates/user/settings/security/openid.tmpl +++ b/templates/user/settings/security/openid.tmpl @@ -51,13 +51,13 @@ </form> </div> -<div class="ui small basic delete modal" id="delete-openid"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-openid"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.openid_deletion"}} </div> <div class="content"> <p>{{.locale.Tr "settings.openid_deletion_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/security/twofa.tmpl b/templates/user/settings/security/twofa.tmpl index 1a0a8a6432..f00651e7fc 100644 --- a/templates/user/settings/security/twofa.tmpl +++ b/templates/user/settings/security/twofa.tmpl @@ -23,13 +23,13 @@ {{end}} </div> -<div class="ui small basic delete modal" id="disable-twofa"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="disable-twofa"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.twofa_disable"}} </div> <div class="content"> <p>{{.locale.Tr "settings.twofa_disable_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/user/settings/security/webauthn.tmpl b/templates/user/settings/security/webauthn.tmpl index 2fea2843f6..25b7f03fca 100644 --- a/templates/user/settings/security/webauthn.tmpl +++ b/templates/user/settings/security/webauthn.tmpl @@ -30,13 +30,13 @@ {{template "user/auth/webauthn_error" .}} -<div class="ui small basic delete modal" id="delete-registration"> - <div class="ui icon header"> +<div class="ui gitea-confirm-modal delete modal" id="delete-registration"> + <div class="header"> {{svg "octicon-trash"}} {{.locale.Tr "settings.webauthn_delete_key"}} </div> <div class="content"> <p>{{.locale.Tr "settings.webauthn_delete_key_desc"}}</p> </div> - {{template "base/delete_modal_actions" .}} + {{template "base/modal_actions_confirm" .}} </div> diff --git a/web_src/css/base.css b/web_src/css/base.css index 7e510346b3..42263a974f 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -1140,32 +1140,6 @@ a.ui.card:hover { color: var(--color-text); } -.ui.modal { - background: var(--color-body); -} - -.ui.modal > .header { - color: var(--color-text-dark); - background: var(--color-secondary-bg); - border-color: var(--color-secondary); - border-top-left-radius: var(--border-radius); - border-top-right-radius: var(--border-radius); -} - -.ui.modal > .content { - background: var(--color-body); - text-align: left !important; -} - -.ui.modal > .actions { - background: var(--color-secondary-bg); - border-color: var(--color-secondary); -} - -.ui.modal > .close.inside { - color: var(--color-text); -} - .ui.basic.table > tbody > tr { border-color: var(--color-secondary); } diff --git a/web_src/css/index.css b/web_src/css/index.css index 2530830338..8282511804 100644 --- a/web_src/css/index.css +++ b/web_src/css/index.css @@ -10,6 +10,7 @@ @import "./features/codeeditor.css"; @import "./features/projects.css"; @import "./modules/tippy.css"; +@import "./modules/modal.css"; @import "./code/linebutton.css"; @import "./markup/content.css"; @import "./markup/codecopy.css"; diff --git a/web_src/css/modules/modal.css b/web_src/css/modules/modal.css new file mode 100644 index 0000000000..60d096dfbf --- /dev/null +++ b/web_src/css/modules/modal.css @@ -0,0 +1,47 @@ +.ui.modal.gitea-confirm-modal { + max-width: min(800px, 90vw); + width: fit-content; +} + +.ui.modal > .header { + /* can't use display:flex, because some headers have space-separated elements, eg: delete branch modal */ + color: var(--color-text-dark); + background: var(--color-body); + border-color: var(--color-secondary); + border-top-left-radius: var(--border-radius); + border-top-right-radius: var(--border-radius); + vertical-align: middle; +} + +.ui.modal > .header .svg { + vertical-align: middle; + display: inline-block; +} + +/* Gitea sometimes use a form in a modal dialog, then the "positive" button could submit the form directly */ + +.ui.modal > .content, +.ui.modal > form > .content { + background: var(--color-body); +} + +.ui.modal > .actions, +.ui.modal > form > .actions { + background: var(--color-secondary-bg); + border-color: var(--color-secondary); + + /* these styles are from Fomantic UI */ + padding: 1rem; + text-align: right; +} + +/* positive/negative action buttons */ +.ui.modal .actions > .ui.button { + display: inline-flex; + align-items: center; + padding: 10px 12px 10px 10px; +} + +.ui.modal .actions > .ui.button .svg { + margin-right: 5px; +} diff --git a/web_src/js/features/repo-projects.js b/web_src/js/features/repo-projects.js index 953671b41d..5d40096220 100644 --- a/web_src/js/features/repo-projects.js +++ b/web_src/js/features/repo-projects.js @@ -129,12 +129,7 @@ export function initRepoProject() { $('.default-project-board-modal').each(function () { const boardColumn = $(this).closest('.board-column'); const showButton = $(boardColumn).find('.default-project-board-show'); - const commitButton = $(this).find('.default-project-board-button'); - - if ($(showButton).data('type') === 'unset_default') { - $(commitButton).removeClass('primary'); - $(commitButton).addClass('red'); - } + const commitButton = $(this).find('.actions > .ok.button'); $(commitButton).on('click', (e) => { e.preventDefault(); @@ -152,12 +147,16 @@ export function initRepoProject() { }); }); - $('.delete-project-board').each(function () { - $(this).on('click', function (e) { + $('.show-delete-column-modal').each(function () { + const deleteColumnModal = $(`${$(this).attr('data-modal')}`); + const deleteColumnButton = deleteColumnModal.find('.actions > .ok.button'); + const deleteUrl = $(this).attr('data-url'); + + deleteColumnButton.on('click', (e) => { e.preventDefault(); $.ajax({ - url: $(this).data('url'), + url: deleteUrl, headers: { 'X-Csrf-Token': csrfToken, }, |