You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

comments.tmpl 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {{range .comments}}
  2. {{$createdStr:= TimeSinceUnix .CreatedUnix $.root.locale}}
  3. <div class="comment" id="{{.HashTag}}">
  4. {{if .OriginalAuthor}}
  5. <span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
  6. {{else}}
  7. {{template "shared/user/avatarlink" Dict "Context" $.Context "user" .Poster}}
  8. {{end}}
  9. <div class="content comment-container">
  10. <div class="ui top attached header comment-header gt-df gt-ac gt-sb">
  11. <div class="comment-header-left gt-df gt-ac">
  12. {{if .OriginalAuthor}}
  13. <span class="text black gt-bold gt-mr-2">
  14. {{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
  15. {{.OriginalAuthor}}
  16. </span>
  17. <span class="text grey">
  18. {{$.root.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
  19. </span>
  20. <span class="text migrate">
  21. {{if $.root.Repository.OriginalURL}}
  22. ({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe}})
  23. {{end}}
  24. </span>
  25. {{else}}
  26. <span class="text grey">
  27. {{template "shared/user/namelink" .Poster}}
  28. {{$.root.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
  29. </span>
  30. {{end}}
  31. </div>
  32. <div class="comment-header-right actions gt-df gt-ac">
  33. {{if and .Review}}
  34. {{if eq .Review.Type 0}}
  35. <div class="ui label basic small yellow pending-label tooltip" data-content="{{$.root.locale.Tr "repo.issues.review.pending.tooltip" ($.root.locale.Tr "repo.diff.review") ($.root.locale.Tr "repo.diff.review.approve") ($.root.locale.Tr "repo.diff.review.comment") ($.root.locale.Tr "repo.diff.review.reject")}}">
  36. {{$.root.locale.Tr "repo.issues.review.pending"}}
  37. </div>
  38. {{else}}
  39. <div class="ui label basic small">
  40. {{$.root.locale.Tr "repo.issues.review.review"}}
  41. </div>
  42. {{end}}
  43. {{end}}
  44. {{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}}
  45. {{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
  46. </div>
  47. </div>
  48. <div class="ui attached segment comment-body">
  49. <div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}data-can-edit="true"{{end}}>
  50. {{if .RenderedContent}}
  51. {{.RenderedContent|Str2html}}
  52. {{else}}
  53. <span class="no-content">{{$.root.locale.Tr "repo.issues.no_content"}}</span>
  54. {{end}}
  55. </div>
  56. <div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div>
  57. <div class="edit-content-zone gt-hidden" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-context="{{$.root.RepoLink}}"></div>
  58. </div>
  59. {{$reactions := .Reactions.GroupByType}}
  60. {{if $reactions}}
  61. <div class="ui attached segment reactions">
  62. {{template "repo/issue/view_content/reactions" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
  63. </div>
  64. {{end}}
  65. </div>
  66. </div>
  67. {{end}}