mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-03-02 23:43:13 +01:00
This PR introduces a new UI element type for Gitea called `flex-item`. It consists of a horizontal card with a leading, main and trailing part:  The idea behind it is that in Gitea UI, we have many cases where we use this kind of layout, but it is achieved in many different ways: - grid layout - `.ui.list` with additional hacky flexbox - `.ui.key.list` - looks to me like a style set originally created for ssh/gpg key list, was used in many other places - `.issue.list` - created for issue cards, used in many other places - ... This new style is based on `.issue.list`, specifically the refactoring of it done in #25750. In this PR, the new element is introduced and lots of templates are being refactored to use that style. This allows to remove a lot of page-specific css, makes many of the elements responsive or simply provides a cleaner/better-looking way to present information. A devtest section with the new style is also available. <details> <summary>Screenshots (left: before, right: after)</summary>                    </details> --------- Co-authored-by: Giteabot <teabot@gitea.io>
63 lines
2 KiB
Go HTML Template
63 lines
2 KiB
Go HTML Template
<h4 class="ui top attached header">
|
|
{{.locale.Tr "settings.manage_openid"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<div class="flex-list">
|
|
<div class="flex-item">
|
|
{{.locale.Tr "settings.openid_desc"}}
|
|
</div>
|
|
{{range .OpenIDs}}
|
|
<div class="flex-item flex-item-center">
|
|
<div class="flex-item-leading">
|
|
{{svg "fontawesome-openid" 20}}
|
|
</div>
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-title">{{.URI}}</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<form action="{{AppSubUrl}}/user/settings/security/openid/toggle_visibility" method="post">
|
|
{{$.CsrfTokenHtml}}
|
|
<input name="id" type="hidden" value="{{.ID}}">
|
|
{{if .Show}}
|
|
<button class="ui tiny button">
|
|
{{svg "octicon-eye" 16 "icon"}}
|
|
{{$.locale.Tr "settings.hide_openid"}}
|
|
</button>
|
|
{{else}}
|
|
<button class="ui tiny button">
|
|
{{svg "octicon-eye-closed" 16 "icon"}}
|
|
{{$.locale.Tr "settings.show_openid"}}
|
|
</button>
|
|
{{end}}
|
|
</form>
|
|
<button class="ui red tiny button delete-button" data-modal-id="delete-openid" data-url="{{AppSubUrl}}/user/settings/security/openid/delete" data-id="{{.ID}}">
|
|
{{$.locale.Tr "settings.delete_key"}}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<div class="ui attached bottom segment">
|
|
<form class="ui form" action="{{AppSubUrl}}/user/settings/security/openid" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<div class="required field {{if .Err_OpenID}}error{{end}}">
|
|
<label for="openid">{{.locale.Tr "settings.add_new_openid"}}</label>
|
|
<input id="openid" name="openid" type="text" required>
|
|
</div>
|
|
<button class="ui green button">
|
|
{{.locale.Tr "settings.add_openid"}}
|
|
</button>
|
|
</form>
|
|
|
|
<div class="ui g-modal-confirm delete modal" id="delete-openid">
|
|
<div class="header">
|
|
{{svg "octicon-trash"}}
|
|
{{.locale.Tr "settings.openid_deletion"}}
|
|
</div>
|
|
<div class="content">
|
|
<p>{{.locale.Tr "settings.openid_deletion_desc"}}</p>
|
|
</div>
|
|
{{template "base/modal_actions_confirm" .}}
|
|
</div>
|
|
</div>
|