code.gitea.io/gitea@v1.22.3/templates/repo/release_tag_header.tmpl (about)

     1  {{$canReadReleases := $.Permission.CanRead ctx.Consts.RepoUnitTypeReleases}}
     2  {{$canReadCode := $.Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
     3  
     4  {{if $canReadReleases}}
     5  	<div class="tw-flex">
     6  		<div class="tw-flex-1 tw-flex tw-items-center">
     7  			<h2 class="ui compact small menu small-menu-items">
     8  				<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>
     9  				{{if $canReadCode}}
    10  					<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>
    11  				{{end}}
    12  			</h2>
    13  		</div>
    14  		{{if .EnableFeed}}
    15  			<a class="ui small button" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss">
    16  				{{svg "octicon-rss" 16}} {{ctx.Locale.Tr "rss_feed"}}
    17  			</a>
    18  		{{end}}
    19  		{{if and (not .PageIsTagList) .CanCreateRelease}}
    20  			<a class="ui small primary button" href="{{$.RepoLink}}/releases/new{{if .PageIsSingleTag}}?tag={{.TagName}}{{end}}">
    21  				{{ctx.Locale.Tr "repo.release.new_release"}}
    22  			</a>
    23  		{{end}}
    24  	</div>
    25  	<div class="divider"></div>
    26  {{else if $canReadCode}}
    27  	{{/* if the "repo.releases" unit is disabled, only show the "commits / branches / tags" sub menu */}}
    28  	{{template "repo/sub_menu" .}}
    29  {{end}}