Browse Source

Display issue/comment role even if repo archived (#17907)

tags/v1.16.0-rc1
Lunny Xiao 2 years ago
parent
commit
b4a32afec1
No account linked to committer's email address
2 changed files with 31 additions and 29 deletions
  1. 12
    12
      templates/repo/issue/view_content.tmpl
  2. 19
    17
      templates/repo/issue/view_content/comments.tmpl

+ 12
- 12
templates/repo/issue/view_content.tmpl View File

@@ -48,19 +48,19 @@
{{end}}
</div>
<div class="comment-header-right actions df ac">
{{if not $.Repository.IsArchived}}
{{if gt .Issue.ShowRole 0}}
{{if (.Issue.ShowRole.HasRole "Writer")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.collaborator"}}
</div>
{{end}}
{{if (.Issue.ShowRole.HasRole "Owner")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.owner"}}
</div>
{{end}}
{{if gt .Issue.ShowRole 0}}
{{if (.Issue.ShowRole.HasRole "Writer")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.collaborator"}}
</div>
{{end}}
{{if (.Issue.ShowRole.HasRole "Owner")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.owner"}}
</div>
{{end}}
{{end}}
{{if not $.Repository.IsArchived}}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}}
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}}
{{end}}

+ 19
- 17
templates/repo/issue/view_content/comments.tmpl View File

@@ -43,22 +43,22 @@
{{end}}
</div>
<div class="comment-header-right actions df ac">
{{if (.ShowRole.HasRole "Poster")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.poster"}}
</div>
{{end}}
{{if (.ShowRole.HasRole "Writer")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.collaborator"}}
</div>
{{end}}
{{if (.ShowRole.HasRole "Owner")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.owner"}}
</div>
{{end}}
{{if not $.Repository.IsArchived}}
{{if (.ShowRole.HasRole "Poster")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.poster"}}
</div>
{{end}}
{{if (.ShowRole.HasRole "Writer")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.collaborator"}}
</div>
{{end}}
{{if (.ShowRole.HasRole "Owner")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.owner"}}
</div>
{{end}}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
{{end}}
@@ -565,8 +565,10 @@
{{$.i18n.Tr "repo.issues.owner"}}
</div>
{{end}}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
{{if not $.Repository.IsArchived}}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
{{end}}
</div>
</div>
<div class="text comment-content">

Loading…
Cancel
Save