Files
gitea/templates/user/settings/organization.tmpl
T
silverwindandwxiaoguang e645afbb3f refactor: replace Fomantic modal with native dialog (#39846)
Replace Fomantic's hard-forked jQuery modal with native `<dialog>`
elements, advancing https://github.com/go-gitea/gitea/issues/29849. The
UI is visually unchanged. Dialogs open with `show()` over an `inert`
page, so tooltips, popups and toasts mounted on `<body>` stay usable
above them, unlike with `showModal()`
(https://github.com/whatwg/html/issues/9936).

- Remove the Fomantic modal and dimmer, add `showModal` and `hideModal`
- Declare modals as `<dialog class="modal-dialog">`, shown inside a
`.modal-backdrop`, instead of `ui modal` with its unused size classes
- Remove two modals that could never be opened
- Block the page while a modal is open, close the topmost one on Escape
and restore focus to its opener
- Allow stacked modals, use a confirm modal instead of `window.confirm`
for deleting content history
- Hide popups and toasts when a modal opens or closes
- Keep the release notes modal open when generating notes fails

Fixes: https://github.com/go-gitea/gitea/issues/39643
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-10-20 12:32:27 +02:00

54 lines
1.8 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" .AsUser}}</div>
<div class="flex-text-body">
{{.Description}}
</div>
</div>
<div class="item-trailing">
<button type="button" class="ui red button show-modal" data-modal="#leave-organization"
data-modal-form.url="{{.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>
<dialog class="modal-dialog" id="leave-organization">
<div class="header">
{{ctx.Locale.Tr "org.members.leave"}}
</div>
<form class="form-fetch-action" method="post">
<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>
</dialog>
{{template "user/settings/layout_footer" .}}