aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/release_tag_header.tmpl
blob: 12acf4bfebfc66718b812fefaef78c1d907da4d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{{$canReadReleases := $.Permission.CanRead ctx.Consts.RepoUnitTypeReleases}}
{{$canReadCode := $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}

{{if $canReadReleases}}
	<div class="flex-text-block">
		<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{{if .PageIsSingleTag}}?tag={{.SingleReleaseTagName}}{{end}}">
				{{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}}