|
8 | 8 | {{range $idx, $release := .Releases}} |
9 | 9 | <li class="ui grid"> |
10 | 10 | <div class="ui four wide column meta"> |
11 | | - <a class="muted" href="{{if not .Sha1}}#{{else}}{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}{{end}}" rel="nofollow">{{svg "octicon-tag" 16 "gt-mr-2"}}{{.TagName}}</a> |
12 | | - {{if .Sha1}} |
| 11 | + <a class="muted" href="{{if not (and .Sha1 ($.Permission.CanRead $.UnitTypeCode))}}#{{else}}{{$.RepoLink}}/src/tag/{{.TagName | PathEscapeSegments}}{{end}}" rel="nofollow">{{svg "octicon-tag" 16 "gt-mr-2"}}{{.TagName}}</a> |
| 12 | + {{if and .Sha1 ($.Permission.CanRead $.UnitTypeCode)}} |
13 | 13 | <a class="muted gt-mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "gt-mr-2"}}{{ShortSha .Sha1}}</a> |
14 | 14 | {{template "repo/branch_dropdown" dict "root" $ "release" .}} |
15 | 15 | {{end}} |
|
22 | 22 | <span class="ui yellow label">{{ctx.Locale.Tr "repo.release.draft"}}</span> |
23 | 23 | {{else if .IsPrerelease}} |
24 | 24 | <span class="ui orange label">{{ctx.Locale.Tr "repo.release.prerelease"}}</span> |
25 | | - {{else if not .IsTag}} |
| 25 | + {{else}} |
26 | 26 | <span class="ui green label">{{ctx.Locale.Tr "repo.release.stable"}}</span> |
27 | 27 | {{end}} |
28 | 28 | </h4> |
29 | 29 | <div> |
30 | | - {{if and $.CanCreateRelease (not .IsTag)}} |
| 30 | + {{if $.CanCreateRelease}} |
31 | 31 | <a class="muted" data-tooltip-content="{{ctx.Locale.Tr "repo.release.edit"}}" href="{{$.RepoLink}}/releases/edit/{{.TagName | PathEscapeSegments}}" rel="nofollow"> |
32 | 32 | {{svg "octicon-pencil"}} |
33 | 33 | </a> |
34 | 34 | {{end}} |
35 | 35 | </div> |
36 | 36 | </div> |
37 | | - {{if .IsTag}} |
38 | | - <p class="text grey"> |
39 | | - {{if gt .Publisher.ID 0}} |
40 | | - <span class="author"> |
41 | | - {{ctx.AvatarUtils.Avatar .Publisher 20 "gt-mr-2"}} |
42 | | - <a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a> |
43 | | - </span> |
44 | | - <span class="released"> |
45 | | - {{ctx.Locale.Tr "repo.tagged_this"}} |
46 | | - </span> |
47 | | - {{if .CreatedUnix}} |
48 | | - <span class="time">{{TimeSinceUnix .CreatedUnix ctx.Locale}}</span> |
49 | | - {{end}} |
50 | | - | |
51 | | - {{end}} |
52 | | - <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{ctx.Locale.Tr "repo.tag.ahead.target" .TargetBehind}}</span> |
53 | | - </p> |
54 | | - {{else}} |
55 | 37 | <p class="text grey"> |
56 | 38 | <span class="author"> |
57 | 39 | {{if .OriginalAuthor}} |
|
69 | 51 | {{if .CreatedUnix}} |
70 | 52 | <span class="time">{{TimeSinceUnix .CreatedUnix ctx.Locale}}</span> |
71 | 53 | {{end}} |
72 | | - {{if not .IsDraft}} |
| 54 | + {{if and (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}} |
73 | 55 | | <span class="ahead"><a href="{{$.RepoLink}}/compare/{{.TagName | PathEscapeSegments}}...{{.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" .NumCommitsBehind | Str2html}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" .TargetBehind}}</span> |
74 | 56 | {{end}} |
75 | 57 | </p> |
76 | | - {{end}} |
77 | 58 | <div class="markup desc"> |
78 | 59 | {{Str2html .Note}} |
79 | 60 | </div> |
|
0 commit comments