mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
ui: change commentTag style (#11668)
* ui: change commentTag style * Add comment tag in first comment (issue content) * Show CommentTagPoster in other way Signed-off-by: a1012112796 <1012112796@qq.com> * Update routers/repo/issue.go Co-authored-by: Lauris BH <lauris@nix.lv> * fix lint * revert CommentTagPoster Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
5b10da241b
commit
4f8dad37f8
4 changed files with 24 additions and 5 deletions
|
@ -744,8 +744,6 @@ func commentTag(repo *models.Repository, poster *models.User, issue *models.Issu
|
|||
}
|
||||
if perm.IsOwner() {
|
||||
return models.CommentTagOwner, nil
|
||||
} else if poster.ID == issue.PosterID {
|
||||
return models.CommentTagPoster, nil
|
||||
} else if perm.CanWrite(models.UnitTypeCode) {
|
||||
return models.CommentTagWriter, nil
|
||||
}
|
||||
|
@ -999,6 +997,12 @@ func ViewIssue(ctx *context.Context) {
|
|||
// check if dependencies can be created across repositories
|
||||
ctx.Data["AllowCrossRepositoryDependencies"] = setting.Service.AllowCrossRepositoryDependencies
|
||||
|
||||
if issue.ShowTag, err = commentTag(repo, issue.Poster, issue); err != nil {
|
||||
ctx.ServerError("commentTag", err)
|
||||
return
|
||||
}
|
||||
marked[issue.PosterID] = issue.ShowTag
|
||||
|
||||
// Render comments and and fetch participants.
|
||||
participants[0] = issue.Poster
|
||||
for _, comment = range issue.Comments {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue