2023-05-10 18:27:02 -04:00
|
|
|
{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}}
|
|
|
|
{{$canReadCode := $.Permission.CanRead $.UnitTypeCode}}
|
|
|
|
|
|
|
|
{{if $canReadReleases}}
|
|
|
|
<div class="gt-df">
|
2023-06-14 12:40:15 -04:00
|
|
|
<div class="gt-f1 gt-df gt-ac">
|
2023-05-10 18:27:02 -04:00
|
|
|
<h2 class="ui compact small menu header small-menu-items">
|
2023-07-14 04:47:17 -04:00
|
|
|
<a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.PrettyNumber .NumReleases}} {{.locale.TrN .NumReleases "repo.release" "repo.releases"}}</a>
|
2023-05-10 18:27:02 -04:00
|
|
|
{{if $canReadCode}}
|
2023-07-05 00:11:42 -04:00
|
|
|
<a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.PrettyNumber .NumTags}} {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
|
2023-05-10 18:27:02 -04:00
|
|
|
{{end}}
|
|
|
|
</h2>
|
|
|
|
{{if .EnableFeed}}
|
2023-05-12 06:23:53 -04:00
|
|
|
<a class="rss-icon gt-mx-3" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
|
2023-05-10 18:27:02 -04:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{if and (not .PageIsTagList) .CanCreateRelease}}
|
2023-09-18 18:05:31 -04:00
|
|
|
<a class="ui small primary button" href="{{$.RepoLink}}/releases/new">
|
2023-05-10 18:27:02 -04:00
|
|
|
{{.locale.Tr "repo.release.new_release"}}
|
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2023-06-29 08:24:22 -04:00
|
|
|
<div class="divider"></div>
|
2023-05-10 18:27:02 -04:00
|
|
|
{{else if $canReadCode}}
|
|
|
|
{{/* if the "repo.releases" unit is disabled, only show the "commits / branches / tags" sub menu */}}
|
|
|
|
{{template "repo/sub_menu" .}}
|
|
|
|
{{end}}
|