Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 43 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
35d0145
fix project column delete
HesterG Apr 13, 2023
11e133f
set default template
HesterG Apr 13, 2023
31162d8
remove todo
HesterG Apr 13, 2023
66700ff
rename variable
HesterG Apr 13, 2023
9037ed0
add variable
HesterG Apr 13, 2023
50d6b5a
revert set/unset col for now and test texts
HesterG Apr 13, 2023
e2613e2
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 13, 2023
f95fdde
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 13, 2023
5afbd76
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 14, 2023
c8fc357
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 14, 2023
df99562
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 14, 2023
6ac0e00
refactor and respect original button texts for project deletion
HesterG Apr 14, 2023
9946e42
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 17, 2023
4fb1eec
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 18, 2023
a982310
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 20, 2023
1df04ee
modify css and change button on default-project-board-modal
HesterG Apr 20, 2023
6651064
modify css for repo unset
HesterG Apr 20, 2023
566e1bb
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 20, 2023
5f92db8
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 20, 2023
f9430f7
use data- attributes to pass data
HesterG Apr 20, 2023
68824ff
try use template for set/unset columns and fix lint
HesterG Apr 20, 2023
844e752
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 20, 2023
c2e81e2
fix lint and change name to basic_modal_actions for now
HesterG Apr 20, 2023
f4c90fb
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 20, 2023
9e38f26
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 21, 2023
159e228
use template for delete pr
HesterG Apr 21, 2023
6ea509e
change to template and add TODOs
HesterG Apr 21, 2023
23adaa4
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 21, 2023
7545bca
use centerd style for buttons
HesterG Apr 21, 2023
ed7d191
move selector
HesterG Apr 21, 2023
ebe4479
revert
HesterG Apr 21, 2023
7a8d871
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 23, 2023
3415117
Merge branch 'main' into fix-project-column-deletion
wxiaoguang Apr 23, 2023
4ce5236
match Fomantic Modal defination
wxiaoguang Apr 23, 2023
bb7fcf7
temp
wxiaoguang Apr 23, 2023
246879b
replace basic modal => gitea-custom modal
wxiaoguang Apr 23, 2023
cbf3b16
reset actions alignment
wxiaoguang Apr 23, 2023
76813a4
reset header classes
wxiaoguang Apr 23, 2023
4918b76
fine tune
wxiaoguang Apr 23, 2023
c2c2442
fix incorrect replacements
wxiaoguang Apr 23, 2023
135ea31
fine tune
wxiaoguang Apr 23, 2023
736d34d
Merge branch 'main' into fix-project-column-deletion
HesterG Apr 23, 2023
9b843cf
unify some modal headers
HesterG Apr 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
6 changes: 3 additions & 3 deletions templates/admin/auth/edit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
8 changes: 4 additions & 4 deletions templates/admin/emails/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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>
Expand Down
7 changes: 3 additions & 4 deletions templates/admin/monitor.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
1 change: 0 additions & 1 deletion templates/admin/notice.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions templates/admin/packages/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
7 changes: 3 additions & 4 deletions templates/admin/queue.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
6 changes: 3 additions & 3 deletions templates/admin/repo/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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" .}}
10 changes: 4 additions & 6 deletions templates/admin/repo/unadopted.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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"}}
Expand All @@ -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>
Expand All @@ -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"}}
Expand Down
7 changes: 3 additions & 4 deletions templates/admin/stacktrace.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
6 changes: 3 additions & 3 deletions templates/admin/user/edit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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" .}}
10 changes: 0 additions & 10 deletions templates/base/delete_modal_actions.tmpl

This file was deleted.

21 changes: 21 additions & 0 deletions templates/base/modal_actions_confirm.tmpl
Original file line number Diff line number Diff line change
@@ -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>
14 changes: 6 additions & 8 deletions templates/org/member/members.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
6 changes: 3 additions & 3 deletions templates/org/settings/delete.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
7 changes: 3 additions & 4 deletions templates/org/team/members.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
6 changes: 3 additions & 3 deletions templates/org/team/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
12 changes: 6 additions & 6 deletions templates/org/team/repositories.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
7 changes: 3 additions & 4 deletions templates/org/team/sidebar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
7 changes: 3 additions & 4 deletions templates/org/team/teams.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" .}}
Loading