mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-22 00:57:45 +00:00
8099238618
I think it's better if the primary actions have primary color instead of green which fits better into the overall single-color UI design. This PR currently replaces every green button with primary: <img width="141" alt="Screenshot 2023-09-16 at 14 07 59" src="https://github.com/go-gitea/gitea/assets/115237/843c1e50-4fb2-4ec6-84ba-0efb9472dcbe"> <img width="161" alt="Screenshot 2023-09-16 at 14 07 51" src="https://github.com/go-gitea/gitea/assets/115237/9442195a-a3b2-4a42-b262-8377d6f5c0d1"> Modal actions now use uncolored/primary instead of previous green/red colors. I also removed the box-shadow on all basic buttons: <img width="259" alt="Screenshot 2023-09-16 at 14 16 39" src="https://github.com/go-gitea/gitea/assets/115237/5beea529-127a-44b0-8d4c-afa7b034a490"> <img width="261" alt="Screenshot 2023-09-16 at 14 17 42" src="https://github.com/go-gitea/gitea/assets/115237/4757f7b2-4d46-49bc-a797-38bb28437b88"> The change currently includes the "Merge PR" button, for which we might want to make an exception to match the icon color there: <img width="442" alt="Screenshot 2023-09-16 at 14 33 53" src="https://github.com/go-gitea/gitea/assets/115237/993ac1a5-c94d-4895-b76c-0d872181a70b">
127 lines
4.9 KiB
Handlebars
127 lines
4.9 KiB
Handlebars
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings edit")}}
|
|
<div class="repo-setting-content">
|
|
{{if .Repository.IsArchived}}
|
|
<div class="ui warning message gt-text-center">
|
|
{{.locale.Tr "repo.settings.archive.tagsettings_unavailable"}}
|
|
</div>
|
|
{{else}}
|
|
<h4 class="ui top attached header">
|
|
{{.locale.Tr "repo.settings.tags.protection"}}
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
<div class="ui grid">
|
|
<div class="sixteen wide column">
|
|
<div class="ui segment">
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{.CsrfTokenHtml}}
|
|
<div class="field">
|
|
<label>{{.locale.Tr "repo.settings.tags.protection.pattern"}}</label>
|
|
<div id="search-tag-box" class="ui search">
|
|
<div class="ui input">
|
|
<input class="prompt" name="name_pattern" autocomplete="off" value="{{.name_pattern}}" placeholder="v*" autofocus required>
|
|
</div>
|
|
<div class="help">{{.locale.Tr "repo.settings.tags.protection.pattern.description" | Safe}}</div>
|
|
</div>
|
|
</div>
|
|
<div class="whitelist field">
|
|
<label>{{.locale.Tr "repo.settings.tags.protection.allowed.users"}}</label>
|
|
<div class="ui multiple search selection dropdown">
|
|
<input type="hidden" name="allowlist_users" value="{{.allowlist_users}}">
|
|
<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_users"}}</div>
|
|
<div class="menu">
|
|
{{range .Users}}
|
|
<div class="item" data-value="{{.ID}}">
|
|
{{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{if .Owner.IsOrganization}}
|
|
<div class="whitelist field">
|
|
<label>{{.locale.Tr "repo.settings.tags.protection.allowed.teams"}}</label>
|
|
<div class="ui multiple search selection dropdown">
|
|
<input type="hidden" name="allowlist_teams" value="{{.allowlist_teams}}">
|
|
<div class="default text">{{.locale.Tr "repo.settings.protect_whitelist_search_teams"}}</div>
|
|
<div class="menu">
|
|
{{range .Teams}}
|
|
<div class="item" data-value="{{.ID}}">
|
|
{{svg "octicon-people"}}
|
|
{{.Name}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<div class="field">
|
|
{{if .PageIsEditProtectedTag}}
|
|
<button class="ui primary button">
|
|
{{$.locale.Tr "save"}}
|
|
</button>
|
|
<a class="ui primary button" href="{{$.RepoLink}}/settings/tags">
|
|
{{$.locale.Tr "cancel"}}
|
|
</a>
|
|
{{else}}
|
|
<button class="ui primary button">
|
|
{{$.locale.Tr "repo.settings.tags.protection.create"}}
|
|
</button>
|
|
{{end}}
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="sixteen wide column">
|
|
<table class="ui single line table">
|
|
<thead>
|
|
<th>{{.locale.Tr "repo.settings.tags.protection.pattern"}}</th>
|
|
<th>{{.locale.Tr "repo.settings.tags.protection.allowed"}}</th>
|
|
<th></th>
|
|
</thead>
|
|
<tbody>
|
|
{{range .ProtectedTags}}
|
|
<tr>
|
|
<td><pre>{{.NamePattern}}</pre></td>
|
|
<td>
|
|
{{if or .AllowlistUserIDs (and $.Owner.IsOrganization .AllowlistTeamIDs)}}
|
|
{{$userIDs := .AllowlistUserIDs}}
|
|
{{range $.Users}}
|
|
{{if SliceUtils.Contains $userIDs .ID}}
|
|
<a class="ui basic label" href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 26}} {{.GetDisplayName}}</a>
|
|
{{end}}
|
|
{{end}}
|
|
{{if $.Owner.IsOrganization}}
|
|
{{$teamIDs := .AllowlistTeamIDs}}
|
|
{{range $.Teams}}
|
|
{{if SliceUtils.Contains $teamIDs .ID}}
|
|
<a class="ui basic label" href="{{$.Owner.OrganisationLink}}/teams/{{PathEscape .LowerName}}">{{.Name}}</a>
|
|
{{end}}
|
|
{{end}}
|
|
{{end}}
|
|
{{else}}
|
|
{{$.locale.Tr "repo.settings.tags.protection.allowed.noone"}}
|
|
{{end}}
|
|
</td>
|
|
<td class="right aligned">
|
|
<a class="ui tiny primary button" href="{{$.RepoLink}}/settings/tags/{{.ID}}">{{$.locale.Tr "edit"}}</a>
|
|
<form class="gt-dib" action="{{$.RepoLink}}/settings/tags/delete" method="post">
|
|
{{$.CsrfTokenHtml}}
|
|
<input type="hidden" name="id" value="{{.ID}}">
|
|
<button class="ui tiny red button">{{$.locale.Tr "remove"}}</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{{else}}
|
|
<tr class="center aligned"><td colspan="3">{{.locale.Tr "repo.settings.tags.protection.none"}}</td></tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{template "repo/settings/layout_footer" .}}
|