summaryrefslogtreecommitdiffstats
path: root/templates/user
diff options
context:
space:
mode:
author花墨 <shanee@live.com>2022-11-30 17:00:00 +0800
committerGitHub <noreply@github.com>2022-11-30 17:00:00 +0800
commit7020c4afb74756f60ae5381a05c6511dbf0d72ba (patch)
treeb43fff7c244a9ac5aeca17336adf7fecd3cb24ba /templates/user
parentfdfd77f478c40c83131b08b2ee27545790e454d0 (diff)
downloadgitea-7020c4afb74756f60ae5381a05c6511dbf0d72ba.tar.gz
gitea-7020c4afb74756f60ae5381a05c6511dbf0d72ba.zip
Fix leaving organization bug on user settings -> orgs (#21983)
Fix #21772 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/user')
-rw-r--r--templates/user/settings/organization.tmpl18
1 files changed, 16 insertions, 2 deletions
diff --git a/templates/user/settings/organization.tmpl b/templates/user/settings/organization.tmpl
index e25d5e7fa6..703ac8ad8e 100644
--- a/templates/user/settings/organization.tmpl
+++ b/templates/user/settings/organization.tmpl
@@ -17,9 +17,13 @@
{{range .Orgs}}
<div class="item">
<div class="right floated content">
- <form method="post" action="{{.OrganisationLink}}/members/action/leave">
+ <form>
{{$.CsrfTokenHtml}}
- <button type="submit" class="ui primary small button" name="uid" value="{{.ID}}">{{$.locale.Tr "org.members.leave"}}</button>
+ <button class="ui red button delete-button" data-modal-id="leave-organization"
+ data-url="{{.OrganisationLink}}/members/action/leave" data-datauid="{{$.SignedUser.ID}}"
+ data-name="{{$.SignedUser.DisplayName}}"
+ data-data-organization-name="{{.DisplayName}}">{{$.locale.Tr "org.members.leave"}}
+ </button>
</form>
</div>
{{avatar . 28 "mini"}}
@@ -36,4 +40,14 @@
</div>
</div>
</div>
+<div class="ui small basic delete modal" id="leave-organization">
+ <div class="ui icon header">
+ {{svg "octicon-x" 16 "close inside"}}
+ {{$.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" .}}
+</div>
{{template "base/footer" .}}