mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-10-22 08:59:01 +00:00
67659c5d46
Fix regression from https://github.com/go-gitea/gitea/pull/30033 These buttons had lost their border because `.ui.header` sets `none` but `.ui.menu` has it, after the migration, the order of styles changed and header won. I see no reason why those have the `header` class in first place, besides for semantic meaning. Before: <img width="491" alt="Screenshot 2024-03-25 at 00 39 27" src="https://github.com/go-gitea/gitea/assets/115237/fa1b7505-75cf-4854-a97f-db3c46f31e93"> After: <img width="496" alt="Screenshot 2024-03-25 at 00 39 14" src="https://github.com/go-gitea/gitea/assets/115237/8f6bdc07-9596-436b-8c82-9af283300004"> (cherry picked from commit 8717c1c2bef1afcc6b0bb2d84627b158b95836b0)
30 lines
1.3 KiB
Go HTML Template
30 lines
1.3 KiB
Go HTML Template
{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}}
|
|
{{$canReadCode := $.Permission.CanRead $.UnitTypeCode}}
|
|
|
|
{{if $canReadReleases}}
|
|
<div class="tw-flex">
|
|
<div class="tw-flex-1 tw-flex tw-items-center">
|
|
<h2 class="ui compact small menu small-menu-items">
|
|
<a class="{{if and .PageIsReleaseList (not .PageIsSingleTag)}}active {{end}}item" href="{{.RepoLink}}/releases">{{ctx.Locale.PrettyNumber .NumReleases}} {{ctx.Locale.TrN .NumReleases "repo.release" "repo.releases"}}</a>
|
|
{{if $canReadCode}}
|
|
<a class="{{if or .PageIsTagList .PageIsSingleTag}}active {{end}}item" href="{{.RepoLink}}/tags">{{ctx.Locale.PrettyNumber .NumTags}} {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
|
|
{{end}}
|
|
</h2>
|
|
</div>
|
|
{{if .EnableFeed}}
|
|
<a class="ui small button" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss">
|
|
{{svg "octicon-rss" 16}} {{ctx.Locale.Tr "rss_feed"}}
|
|
</a>
|
|
{{end}}
|
|
{{if and (not .PageIsTagList) .CanCreateRelease}}
|
|
<a class="ui small primary button" href="{{$.RepoLink}}/releases/new">
|
|
{{ctx.Locale.Tr "repo.release.new_release"}}
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
<div class="divider"></div>
|
|
{{else if $canReadCode}}
|
|
{{/* if the "repo.releases" unit is disabled, only show the "commits / branches / tags" sub menu */}}
|
|
{{template "repo/sub_menu" .}}
|
|
{{end}}
|