Skip to content

Commit b4a32af

Browse files
authored
Display issue/comment role even if repo archived (#17907)
1 parent 98d903a commit b4a32af

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

templates/repo/issue/view_content.tmpl

+12-12
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@
4848
{{end}}
4949
</div>
5050
<div class="comment-header-right actions df ac">
51-
{{if not $.Repository.IsArchived}}
52-
{{if gt .Issue.ShowRole 0}}
53-
{{if (.Issue.ShowRole.HasRole "Writer")}}
54-
<div class="ui basic label">
55-
{{$.i18n.Tr "repo.issues.collaborator"}}
56-
</div>
57-
{{end}}
58-
{{if (.Issue.ShowRole.HasRole "Owner")}}
59-
<div class="ui basic label">
60-
{{$.i18n.Tr "repo.issues.owner"}}
61-
</div>
62-
{{end}}
51+
{{if gt .Issue.ShowRole 0}}
52+
{{if (.Issue.ShowRole.HasRole "Writer")}}
53+
<div class="ui basic label">
54+
{{$.i18n.Tr "repo.issues.collaborator"}}
55+
</div>
6356
{{end}}
57+
{{if (.Issue.ShowRole.HasRole "Owner")}}
58+
<div class="ui basic label">
59+
{{$.i18n.Tr "repo.issues.owner"}}
60+
</div>
61+
{{end}}
62+
{{end}}
63+
{{if not $.Repository.IsArchived}}
6464
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}}
6565
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}}
6666
{{end}}

templates/repo/issue/view_content/comments.tmpl

+19-17
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@
4343
{{end}}
4444
</div>
4545
<div class="comment-header-right actions df ac">
46+
{{if (.ShowRole.HasRole "Poster")}}
47+
<div class="ui basic label">
48+
{{$.i18n.Tr "repo.issues.poster"}}
49+
</div>
50+
{{end}}
51+
{{if (.ShowRole.HasRole "Writer")}}
52+
<div class="ui basic label">
53+
{{$.i18n.Tr "repo.issues.collaborator"}}
54+
</div>
55+
{{end}}
56+
{{if (.ShowRole.HasRole "Owner")}}
57+
<div class="ui basic label">
58+
{{$.i18n.Tr "repo.issues.owner"}}
59+
</div>
60+
{{end}}
4661
{{if not $.Repository.IsArchived}}
47-
{{if (.ShowRole.HasRole "Poster")}}
48-
<div class="ui basic label">
49-
{{$.i18n.Tr "repo.issues.poster"}}
50-
</div>
51-
{{end}}
52-
{{if (.ShowRole.HasRole "Writer")}}
53-
<div class="ui basic label">
54-
{{$.i18n.Tr "repo.issues.collaborator"}}
55-
</div>
56-
{{end}}
57-
{{if (.ShowRole.HasRole "Owner")}}
58-
<div class="ui basic label">
59-
{{$.i18n.Tr "repo.issues.owner"}}
60-
</div>
61-
{{end}}
6262
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
6363
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
6464
{{end}}
@@ -565,8 +565,10 @@
565565
{{$.i18n.Tr "repo.issues.owner"}}
566566
</div>
567567
{{end}}
568-
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
569-
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
568+
{{if not $.Repository.IsArchived}}
569+
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
570+
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
571+
{{end}}
570572
</div>
571573
</div>
572574
<div class="text comment-content">

0 commit comments

Comments
 (0)