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