0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 09:14:15 +01:00

Refactor delete_modal_actions template and use it for project column related actions (#24097)

Co-Author: @wxiaoguang 

This PR is to fix
https://github.com/go-gitea/gitea/issues/23318#issuecomment-1506275446 .
The way to fix this in this PR is to use `delete_modal_actions.tmpl`
here both to fix this issue and keep ui consistency (as suggested by
[TODO
here](4299c3b7db/templates/projects/view.tmpl (L161)))

And this PR also refactors `delete_modal_actions.tmpl` and its related
styles, and use the template for more modal actions:

1. Added template attributes:
* locale
* ModalButtonStyle: "yes" (default) or "confirm"
* ModalButtonCancelText
* ModalButtonOkText

2. Rename `delete_modal_actions.tmpl` template to
`modal_actions_confirm.tmpl` because it is not only used for action
modals deletion now.

3. Refactored css related to modals into `web_src/css/modules/modal.css`
and improved the styles.

4. Also use the template for PR deletion modal and remove issue
dependency modal.

5. Some modals should also use the template, but not sure how to open
them, so mark these modal actions by `{{/* TODO: Convert to
base/modal_actions_confirm */}}`

After (Also tested on arc green):

Hovering on the left buttons

<img width="711" alt="Screen Shot 2023-04-23 at 15 17 12"
src="https://user-images.githubusercontent.com/17645053/233825650-76307e65-9255-44bb-80e8-7062f58ead1b.png">

<img width="786" alt="Screen Shot 2023-04-23 at 15 17 21"
src="https://user-images.githubusercontent.com/17645053/233825652-4dc6f7d1-a180-49fb-a468-d60950eaee0d.png">

Test for functionalities:

https://user-images.githubusercontent.com/17645053/233826857-76376fda-022c-42d0-b0f3-339c17ca4e59.mov

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Hester Gong 2023-04-23 17:24:19 +08:00 committed by GitHub
parent 5e389228f6
commit 476a043a5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 285 additions and 286 deletions

View file

@ -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]

View file

@ -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" .}}

View file

@ -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>

View file

@ -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" .}}

View file

@ -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>

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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"}}

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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>

View file

@ -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>

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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>

View file

@ -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" .}}

View file

@ -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>

View file

@ -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}}

View file

@ -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}}

View file

@ -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">

View file

@ -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

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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">

View file

@ -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" .}}

View file

@ -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>

View file

@ -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"}}

View file

@ -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}}

View file

@ -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" .}}

View file

@ -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}}

View file

@ -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}}

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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>

View file

@ -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}}

View file

@ -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>

View file

@ -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" .}}

View file

@ -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>

View file

@ -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>

View file

@ -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" .}}

View file

@ -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"}}

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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}}

View file

@ -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>

View file

@ -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" .}}

View file

@ -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" .}}

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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);
}

View file

@ -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";

View file

@ -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;
}

View file

@ -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,
},