aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo/issue')
-rw-r--r--templates/repo/issue/view_content.tmpl15
-rw-r--r--templates/repo/issue/view_content/comments.tmpl48
2 files changed, 33 insertions, 30 deletions
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index 9ad6bee651..29c8626596 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -49,14 +49,17 @@
</div>
<div class="comment-header-right actions df ac">
{{if not $.Repository.IsArchived}}
- {{if gt .Issue.ShowTag 0}}
- <div class="ui basic label">
- {{if eq .Issue.ShowTag 2}}
+ {{if gt .Issue.ShowRole 0}}
+ {{if (.Issue.ShowRole.HasRole "Writer")}}
+ <div class="ui basic label">
{{$.i18n.Tr "repo.issues.collaborator"}}
- {{else if eq .Issue.ShowTag 3}}
+ </div>
+ {{end}}
+ {{if (.Issue.ShowRole.HasRole "Owner")}}
+ <div class="ui basic label">
{{$.i18n.Tr "repo.issues.owner"}}
- {{end}}
- </div>
+ </div>
+ {{end}}
{{end}}
{{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}}
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 51d1e093c8..57ec007bed 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -44,18 +44,19 @@
</div>
<div class="comment-header-right actions df ac">
{{if not $.Repository.IsArchived}}
- {{if or (and (eq .PosterID .Issue.PosterID) (eq .Issue.OriginalAuthorID 0)) (and (eq .Issue.OriginalAuthorID .OriginalAuthorID) (not (eq .OriginalAuthorID 0))) }}
+ {{if (.ShowRole.HasRole "Poster")}}
<div class="ui basic label">
{{$.i18n.Tr "repo.issues.poster"}}
</div>
{{end}}
- {{if gt .ShowTag 0}}
+ {{if (.ShowRole.HasRole "Writer")}}
<div class="ui basic label">
- {{if eq .ShowTag 2}}
- {{$.i18n.Tr "repo.issues.collaborator"}}
- {{else if eq .ShowTag 3}}
- {{$.i18n.Tr "repo.issues.owner"}}
- {{end}}
+ {{$.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)}}
@@ -549,24 +550,23 @@
</span>
</div>
<div class="comment-header-right actions df ac">
- {{if not $.Repository.IsArchived}}
- {{if or (and (eq .PosterID $.Issue.PosterID) (eq $.Issue.OriginalAuthorID 0)) (eq $.Issue.OriginalAuthorID .OriginalAuthorID) }}
- <div class="ui basic label">
- {{$.i18n.Tr "repo.issues.poster"}}
- </div>
- {{end}}
- {{if gt .ShowTag 0}}
- <div class="ui basic label">
- {{if eq .ShowTag 2}}
- {{$.i18n.Tr "repo.issues.collaborator"}}
- {{else if eq .ShowTag 3}}
- {{$.i18n.Tr "repo.issues.owner"}}
- {{end}}
- </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 (.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" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
</div>
</div>
<div class="text comment-content">