0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-06-30 18:22:02 +02:00
gitea/templates/user/settings/organization.tmpl
silverwind de83393487
refactor: replace legacy delete-button with link-action (#38143)
Removes the legacy `delete-button` handler (`initGlobalDeleteButton`)
and migrates all remaining usages to `link-action` and `show-modal` /
`form-fetch-action`.

Two handlers are adjusted for the new request shape: webauthn key delete
reads `id` from the query, and account deletion returns `JSONError` on
validation failure.

A E2E test ist added to cover one of the use cases.

Suggested in
https://github.com/go-gitea/gitea/pull/38046#discussion_r3414936737.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: bircni <bircni@icloud.com>
2026-06-18 12:02:11 +00:00

52 lines
1.7 KiB
Handlebars

{{template "user/settings/layout_head" (dict "pageClass" "user settings organization")}}
<div class="user-setting-content">
<h4 class="ui top attached header">
{{ctx.Locale.Tr "settings.orgs"}}
{{if .SignedUser.CanCreateOrganization}}
<div class="ui right">
<a class="ui primary tiny button" href="{{AppSubUrl}}/org/create">{{ctx.Locale.Tr "admin.orgs.new_orga"}}</a>
</div>
{{end}}
</h4>
<div class="ui attached segment orgs">
{{if .Orgs}}
<div class="flex-divided-list items-with-main">
{{range .Orgs}}
<div class="item">
<div class="item-leading">
{{ctx.AvatarUtils.Avatar . 28 "mini"}}
</div>
<div class="item-main">
<div class="item-title">{{template "shared/user/name" .}}</div>
<div class="flex-text-body">
{{.Description}}
</div>
</div>
<div class="item-trailing">
<button class="ui red button show-modal" data-modal="#leave-organization"
data-modal-form.action="{{.OrganisationLink}}/members/action/leave?uid={{$.SignedUser.ID}}"
data-modal-organization-name="{{.DisplayName}}">{{ctx.Locale.Tr "org.members.leave"}}
</button>
</div>
</div>
{{end}}
</div>
{{template "base/paginate" .}}
{{else}}
{{ctx.Locale.Tr "settings.orgs_none"}}
{{end}}
</div>
</div>
<form class="ui small modal form-fetch-action" method="post" id="leave-organization">
<div class="header">
{{ctx.Locale.Tr "org.members.leave"}}
</div>
<div class="content">
<p>{{ctx.Locale.Tr "org.members.leave.detail" (HTMLFormat `<span class="%s"></span>` "organization-name")}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</form>
{{template "user/settings/layout_footer" .}}