aboutsummaryrefslogtreecommitdiffstats
path: root/templates/org
diff options
context:
space:
mode:
authorHester Gong <hestergong@gmail.com>2023-04-23 17:24:19 +0800
committerGitHub <noreply@github.com>2023-04-23 17:24:19 +0800
commit476a043a5fb2b472e2aaced450ac2a0c9102854e (patch)
treefcbc301d7fca09eee292cdd039a6980a88aefa63 /templates/org
parent5e389228f61844c0d59d5bc5974483dae0aa1b8b (diff)
downloadgitea-476a043a5fb2b472e2aaced450ac2a0c9102854e.tar.gz
gitea-476a043a5fb2b472e2aaced450ac2a0c9102854e.zip
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](https://github.com/go-gitea/gitea/blob/4299c3b7db61f8741eca0ba3d663bb65745a4acc/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>
Diffstat (limited to 'templates/org')
-rw-r--r--templates/org/member/members.tmpl14
-rw-r--r--templates/org/settings/delete.tmpl6
-rw-r--r--templates/org/team/members.tmpl7
-rw-r--r--templates/org/team/new.tmpl6
-rw-r--r--templates/org/team/repositories.tmpl12
-rw-r--r--templates/org/team/sidebar.tmpl7
-rw-r--r--templates/org/team/teams.tmpl7
7 files changed, 27 insertions, 32 deletions
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" .}}