From b4a32afec1fa1989b0060ae31347e583cfb51c13 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 5 Dec 2021 23:04:02 +0800 Subject: Display issue/comment role even if repo archived (#17907) --- templates/repo/issue/view_content.tmpl | 24 ++++++++--------- templates/repo/issue/view_content/comments.tmpl | 36 +++++++++++++------------ 2 files changed, 31 insertions(+), 29 deletions(-) (limited to 'templates') diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 687f9133b1..86d9e6da84 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -48,19 +48,19 @@ {{end}}
- {{if not $.Repository.IsArchived}} - {{if gt .Issue.ShowRole 0}} - {{if (.Issue.ShowRole.HasRole "Writer")}} -
- {{$.i18n.Tr "repo.issues.collaborator"}} -
- {{end}} - {{if (.Issue.ShowRole.HasRole "Owner")}} -
- {{$.i18n.Tr "repo.issues.owner"}} -
- {{end}} + {{if gt .Issue.ShowRole 0}} + {{if (.Issue.ShowRole.HasRole "Writer")}} +
+ {{$.i18n.Tr "repo.issues.collaborator"}} +
{{end}} + {{if (.Issue.ShowRole.HasRole "Owner")}} +
+ {{$.i18n.Tr "repo.issues.owner"}} +
+ {{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}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 77925d8e29..c229028540 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -43,22 +43,22 @@ {{end}}
+ {{if (.ShowRole.HasRole "Poster")}} +
+ {{$.i18n.Tr "repo.issues.poster"}} +
+ {{end}} + {{if (.ShowRole.HasRole "Writer")}} +
+ {{$.i18n.Tr "repo.issues.collaborator"}} +
+ {{end}} + {{if (.ShowRole.HasRole "Owner")}} +
+ {{$.i18n.Tr "repo.issues.owner"}} +
+ {{end}} {{if not $.Repository.IsArchived}} - {{if (.ShowRole.HasRole "Poster")}} -
- {{$.i18n.Tr "repo.issues.poster"}} -
- {{end}} - {{if (.ShowRole.HasRole "Writer")}} -
- {{$.i18n.Tr "repo.issues.collaborator"}} -
- {{end}} - {{if (.ShowRole.HasRole "Owner")}} -
- {{$.i18n.Tr "repo.issues.owner"}} -
- {{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"}}
{{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}}
-- cgit v1.2.3