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 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {{range .comments}}
  2. {{ $createdStr:= TimeSinceUnix .CreatedUnix $.root.Lang }}
  3. <div class="comment" id="{{.HashTag}}">
  4. <a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
  5. <img src="{{.Poster.RelAvatarLink}}">
  6. </a>
  7. <div class="content">
  8. <div class="ui top attached header">
  9. <span class="text grey"><a {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a> {{$.root.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
  10. <div class="ui right actions">
  11. {{if and .Review}}
  12. {{if eq .Review.Type 0}}
  13. <div class="item tag pending">
  14. {{$.root.i18n.Tr "repo.issues.review.pending"}}
  15. </div>
  16. {{else}}
  17. <div class="item tag">
  18. {{$.root.i18n.Tr "repo.issues.review.review"}}
  19. </div>
  20. {{end}}
  21. {{end}}
  22. {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
  23. {{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "diff" true }}
  24. </div>
  25. </div>
  26. <div class="ui attached segment">
  27. <div class="render-content markdown has-emoji">
  28. {{if .RenderedContent}}
  29. {{.RenderedContent|Str2html}}
  30. {{else}}
  31. <span class="no-content">{{$.root.i18n.Tr "repo.issues.no_content"}}</span>
  32. {{end}}
  33. </div>
  34. <div id="comment-{{.ID}}" class="raw-content hide">{{.Content}}</div>
  35. <div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-context="{{$.root.RepoLink}}"></div>
  36. </div>
  37. {{$reactions := .Reactions.GroupByType}}
  38. {{if $reactions}}
  39. <div class="ui attached segment reactions">
  40. {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions "AllowedReactions" $.AllowedReactions }}
  41. </div>
  42. {{end}}
  43. </div>
  44. </div>
  45. {{end}}