You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

release_tag_header.tmpl 1.4KB

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