mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
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>
62 lines
2.0 KiB
Handlebars
62 lines
2.0 KiB
Handlebars
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "settings.manage_openid"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<div class="flex-divided-list items-with-main">
|
|
<div class="item">
|
|
{{ctx.Locale.Tr "settings.openid_desc"}}
|
|
</div>
|
|
{{range .OpenIDs}}
|
|
<div class="item tw-items-center">
|
|
<div class="item-leading">
|
|
{{svg "fontawesome-openid" 20}}
|
|
</div>
|
|
<div class="item-main">
|
|
<div class="item-title">{{.URI}}</div>
|
|
</div>
|
|
<div class="item-trailing">
|
|
<form action="{{AppSubUrl}}/user/settings/security/openid/toggle_visibility" method="post">
|
|
<input name="id" type="hidden" value="{{.ID}}">
|
|
{{if .Show}}
|
|
<button type="submit" class="ui tiny button">
|
|
{{svg "octicon-eye" 16 "icon"}}
|
|
{{ctx.Locale.Tr "settings.hide_openid"}}
|
|
</button>
|
|
{{else}}
|
|
<button type="submit" class="ui tiny button">
|
|
{{svg "octicon-eye-closed" 16 "icon"}}
|
|
{{ctx.Locale.Tr "settings.show_openid"}}
|
|
</button>
|
|
{{end}}
|
|
</form>
|
|
<button type="button" class="ui red tiny button link-action" data-modal-confirm="#delete-openid" data-url="{{AppSubUrl}}/user/settings/security/openid/delete?id={{.ID}}">
|
|
{{ctx.Locale.Tr "remove"}}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<div class="ui bottom attached segment">
|
|
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/openid" method="post">
|
|
<div class="required field {{if .Err_OpenID}}error{{end}}">
|
|
<label for="openid">{{ctx.Locale.Tr "settings.add_new_openid"}}</label>
|
|
<input id="openid" name="openid" type="text" required>
|
|
</div>
|
|
<button type="submit" class="ui primary button">
|
|
{{ctx.Locale.Tr "settings.add_openid"}}
|
|
</button>
|
|
</form>
|
|
|
|
<dialog class="modal-dialog" id="delete-openid">
|
|
<div class="header">
|
|
{{svg "octicon-trash"}}
|
|
{{ctx.Locale.Tr "settings.openid_deletion"}}
|
|
</div>
|
|
<div class="content">
|
|
<p>{{ctx.Locale.Tr "settings.openid_deletion_desc"}}</p>
|
|
</div>
|
|
{{template "base/modal_actions_confirm" .}}
|
|
</dialog>
|
|
</div>
|