summaryrefslogtreecommitdiffstats
path: root/templates/repo/release_tag_header.tmpl
blob: dafe9f2fa66694d9fce0d505218d0eeb424d629b (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
30
31
{{$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.TrN .NumReleases "repo.n_release_one" "repo.n_release_few" (ctx.Locale.PrettyNumber .NumReleases)}}</a>
				{{if $canReadCode}}
					<a class="{{if or .PageIsTagList .PageIsSingleTag}}active {{end}}item" href="{{.RepoLink}}/tags">{{ctx.Locale.TrN .NumTags "repo.n_tag_one" "repo.n_tag_few" (ctx.Locale.PrettyNumber .NumTags)}}</a>
				{{end}}
			</h2>
		</div>
		<div class="button-row">
			{{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>
	<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}}