gitea源码

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. {{template "base/head" .}}
  2. <div role="main" aria-label="{{.Title}}" class="page-content repository releases">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. {{template "repo/release_tag_header" .}}
  7. <ul id="release-list">
  8. {{range $idx, $info := .Releases}}
  9. {{$release := $info.Release}}
  10. <li class="release-entry">
  11. <div class="meta">
  12. <a class="muted" href="{{if not (and $release.Sha1 ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode))}}#{{else}}{{$.RepoLink}}/src/tag/{{$release.TagName | PathEscapeSegments}}{{end}}" rel="nofollow">{{svg "octicon-tag" 16 "tw-mr-1"}}{{$release.TagName}}</a>
  13. {{if and $release.Sha1 ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
  14. <a class="muted tw-font-mono" href="{{$.RepoLink}}/src/commit/{{$release.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "tw-mr-1"}}{{ShortSha $release.Sha1}}</a>
  15. {{$compareTarget := ""}}
  16. {{if $release.IsDraft}}
  17. {{$compareTarget = $release.Target}}
  18. {{else if $release.TagName}}
  19. {{$compareTarget = $release.TagName}}
  20. {{else}}
  21. {{$compareTarget = $release.Sha1}}
  22. {{end}}
  23. {{template "repo/branch_dropdown" dict
  24. "ContainerClasses" "release-branch-tag-selector"
  25. "Repository" $.Repository
  26. "ShowTabTags" true
  27. "DropdownFixedText" (ctx.Locale.Tr "repo.release.compare")
  28. "RefLinkTemplate" (print "{RepoLink}/compare/{RefShortName}" "..." (PathEscapeSegments $compareTarget))
  29. }}
  30. {{end}}
  31. </div>
  32. <div class="ui segment detail">
  33. <div class="tw-flex tw-items-center tw-justify-between tw-flex-wrap tw-mb-2">
  34. <h4 class="release-list-title tw-break-anywhere">
  35. {{if $.PageIsSingleTag}}{{$release.Title}}{{else}}<a class="muted" href="{{$.RepoLink}}/releases/tag/{{$release.TagName | PathEscapeSegments}}">{{$release.Title}}</a>{{end}}
  36. {{template "repo/commit_statuses" dict "Status" $info.CommitStatus "Statuses" $info.CommitStatuses "AdditionalClasses" "tw-flex"}}
  37. {{template "repo/release/label" (dict "Release" $release)}}
  38. </h4>
  39. <div>
  40. {{if and $.CanCreateRelease (not $.PageIsSingleTag)}}
  41. <a class="muted" data-tooltip-content="{{ctx.Locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{$release.TagName | PathEscapeSegments}}" rel="nofollow">
  42. {{svg "octicon-pencil"}}
  43. </a>
  44. {{end}}
  45. </div>
  46. </div>
  47. <p class="text grey">
  48. <span class="author">
  49. {{if $release.OriginalAuthor}}
  50. {{svg (MigrationIcon $release.Repo.GetOriginalURLHostname) 20 "tw-mr-1"}}{{$release.OriginalAuthor}}
  51. {{else if $release.Publisher}}
  52. {{ctx.AvatarUtils.Avatar $release.Publisher 20 "tw-mr-1"}}
  53. {{if gt $release.PublisherID 0}}
  54. <a href="{{$release.Publisher.HomeLink}}">{{$release.Publisher.GetDisplayName}}</a>
  55. {{else}}
  56. {{$release.Publisher.GetDisplayName}}
  57. {{end}}
  58. {{else}}
  59. Ghost
  60. {{end}}
  61. </span>
  62. <span class="released">
  63. {{ctx.Locale.Tr "repo.released_this"}}
  64. </span>
  65. {{if $release.CreatedUnix}}
  66. <span class="time">{{DateUtils.TimeSince $release.CreatedUnix}}</span>
  67. {{end}}
  68. {{if and (gt $release.NumCommits 0) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
  69. | <span class="ahead"><a href="{{$.RepoLink}}/compare/{{$release.TagName | PathEscapeSegments}}...{{$release.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}}</span>
  70. {{end}}
  71. </p>
  72. <div class="render-content markup">
  73. {{$release.RenderedNote}}
  74. </div>
  75. <div class="divider"></div>
  76. <details class="download" {{if eq $idx 0}}open{{end}}>
  77. <summary>
  78. {{ctx.Locale.Tr "repo.release.downloads"}}
  79. </summary>
  80. <ul class="ui divided list attachment-list">
  81. {{if and (not $.DisableDownloadSourceArchives) (not $release.IsDraft) ($.Permission.CanRead ctx.Consts.RepoUnitTypeCode)}}
  82. <li class="item">
  83. <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.zip" rel="nofollow">
  84. <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (ZIP)</strong>
  85. </a>
  86. </li>
  87. <li class="item">
  88. <a class="archive-link" download href="{{$.RepoLink}}/archive/{{$release.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">
  89. <strong class="flex-text-inline">{{svg "octicon-file-zip" 16 "download-icon"}}{{ctx.Locale.Tr "repo.release.source_code"}} (TAR.GZ)</strong>
  90. </a>
  91. </li>
  92. {{end}}
  93. {{range $att := $release.Attachments}}
  94. <li class="item">
  95. <a target="_blank" class="tw-flex-1 gt-ellipsis" rel="nofollow" download href="{{$att.DownloadURL}}">
  96. <strong class="flex-text-inline">{{svg "octicon-package" 16 "download-icon"}}<span class="gt-ellipsis">{{$att.Name}}</span></strong>
  97. </a>
  98. <div class="attachment-right-info flex-text-inline">
  99. <span class="tw-pl-5">{{$att.Size | FileSize}}</span>
  100. <span class="flex-text-inline" data-tooltip-content="{{ctx.Locale.Tr "repo.release.download_count" (ctx.Locale.PrettyNumber $att.DownloadCount)}}">
  101. {{svg "octicon-info"}}
  102. </span>
  103. <div class="tw-flex-1"></div>
  104. {{DateUtils.TimeSince $att.CreatedUnix}}
  105. </div>
  106. </li>
  107. {{end}}
  108. </ul>
  109. </details>
  110. </div>
  111. </li>
  112. {{end}}
  113. </ul>
  114. {{template "base/paginate" .}}
  115. </div>
  116. </div>
  117. {{if (and ($.Permission.CanWrite ctx.Consts.RepoUnitTypeCode) .PageIsTagList)}}
  118. <div class="ui g-modal-confirm delete modal">
  119. <div class="header">
  120. {{svg "octicon-trash"}}
  121. {{ctx.Locale.Tr "repo.release.delete_tag"}}
  122. </div>
  123. <div class="content">
  124. <p>{{ctx.Locale.Tr "repo.release.deletion_tag_desc"}}</p>
  125. </div>
  126. {{template "base/modal_actions_confirm" .}}
  127. </div>
  128. {{end}}
  129. {{template "base/footer" .}}