diff options
author | 赵智超 <1012112796@qq.com> | 2020-09-11 02:09:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 14:09:14 -0400 |
commit | 4f8dad37f834833012004bf5b158e5129af4b610 (patch) | |
tree | 0b3b81baa95540cda91294f4cf3027e949f6b2b5 /routers/repo | |
parent | 5b10da241b83dc1c9a5a745cd03edaaac900eab4 (diff) | |
download | gitea-4f8dad37f834833012004bf5b158e5129af4b610.tar.gz gitea-4f8dad37f834833012004bf5b158e5129af4b610.zip |
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>
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/issue.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 4fc83719fd..71c0488972 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -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 { |