0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-26 15:54:33 +01:00

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

This commit is contained in:
Lunny Xiao 2021-12-05 23:04:02 +08:00 committed by GitHub
parent 98d903a3c6
commit b4a32afec1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 29 deletions

View file

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

View file

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