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.

143 lines
5.6 KiB

  1. <div class="ui stackable grid">
  2. {{if .Flash}}
  3. <div class="sixteen wide column">
  4. {{template "base/alert" .}}
  5. </div>
  6. {{end}}
  7. {{if not .Issue.IsPull}}
  8. {{template "repo/issue/view_title" .}}
  9. {{end}}
  10. {{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }}
  11. <div class="twelve wide column comment-list">
  12. <ui class="ui comments">
  13. <div class="comment">
  14. <a class="avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
  15. <img src="{{.Issue.Poster.RelAvatarLink}}">
  16. </a>
  17. <div class="content">
  18. <div class="ui top attached header">
  19. <span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
  20. <div class="ui right actions">
  21. {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }}
  22. {{if .IsIssueOwner}}
  23. <div class="item action">
  24. <a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a>
  25. </div>
  26. {{end}}
  27. </div>
  28. </div>
  29. <div class="ui attached segment">
  30. <div class="render-content markdown has-emoji">
  31. {{if .Issue.RenderedContent}}
  32. {{.Issue.RenderedContent|Str2html}}
  33. {{else}}
  34. <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
  35. {{end}}
  36. </div>
  37. <div class="raw-content hide">{{.Issue.Content}}</div>
  38. <div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}"></div>
  39. </div>
  40. {{$reactions := .Issue.Reactions.GroupByType}}
  41. {{if $reactions}}
  42. <div class="ui attached segment reactions">
  43. {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }}
  44. </div>
  45. {{end}}
  46. {{if .Issue.Attachments}}
  47. <div class="ui bottom attached segment">
  48. <div class="ui small images">
  49. {{range .Issue.Attachments}}
  50. <a target="_blank" rel="noopener noreferrer" href="{{AppSubUrl}}/attachments/{{.UUID}}">
  51. {{if FilenameIsImage .Name}}
  52. <img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
  53. {{else}}
  54. <span class="ui image octicon octicon-desktop-download" title='{{$.i18n.Tr "repo.issues.attachment.download" .Name}}'></span>
  55. {{end}}
  56. </a>
  57. {{end}}
  58. </div>
  59. </div>
  60. {{end}}
  61. </div>
  62. </div>
  63. {{ template "repo/issue/view_content/comments" . }}
  64. {{if .Issue.IsPull}}
  65. {{ template "repo/issue/view_content/pull". }}
  66. {{end}}
  67. {{if .IsSigned}}
  68. <div class="comment form">
  69. <a class="avatar" href="{{.SignedUser.HomeLink}}">
  70. <img src="{{.SignedUser.RelAvatarLink}}">
  71. </a>
  72. <div class="content">
  73. <form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
  74. {{template "repo/issue/comment_tab" .}}
  75. {{.CsrfTokenHtml}}
  76. <input id="status" name="status" type="hidden">
  77. <div class="text right">
  78. {{if and .IsIssueOwner (not .DisableStatusChange)}}
  79. {{if .Issue.IsClosed}}
  80. <div id="status-button" class="ui green basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen">
  81. {{.i18n.Tr "repo.issues.reopen_issue"}}
  82. </div>
  83. {{else}}
  84. <div id="status-button" class="ui red basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close">
  85. {{.i18n.Tr "repo.issues.close_issue"}}
  86. </div>
  87. {{end}}
  88. {{end}}
  89. <button class="ui green button" tabindex="5">
  90. {{.i18n.Tr "repo.issues.create_comment"}}
  91. </button>
  92. </div>
  93. </form>
  94. </div>
  95. </div>
  96. {{else}}
  97. <div class="ui warning message">
  98. {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}
  99. </div>
  100. {{end}}
  101. </ui>
  102. </div>
  103. {{ template "repo/issue/view_content/sidebar" . }}
  104. </div>
  105. <div class="hide" id="edit-content-form">
  106. <div class="ui comment form">
  107. <div class="ui top attached tabular menu">
  108. <a class="active write item">{{$.i18n.Tr "repo.release.write"}}</a>
  109. <a class="preview item" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "repo.release.preview"}}</a>
  110. </div>
  111. <div class="ui bottom attached active write tab segment">
  112. <textarea tabindex="1" id="content" name="content"></textarea>
  113. </div>
  114. <div class="ui bottom attached tab preview segment markdown">
  115. {{$.i18n.Tr "repo.release.loading"}}
  116. </div>
  117. <div class="text right edit buttons">
  118. <div class="ui basic blue cancel button" tabindex="3">{{.i18n.Tr "repo.issues.cancel"}}</div>
  119. <div class="ui green save button" tabindex="2">{{.i18n.Tr "repo.issues.save"}}</div>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="hide" id="no-content">
  124. <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
  125. </div>
  126. <div class="ui small basic delete modal">
  127. <div class="ui icon header">
  128. <i class="trash icon"></i>
  129. {{.i18n.Tr "repo.branch.delete" .HeadTarget }}
  130. </div>
  131. <div class="content">
  132. <p>{{.i18n.Tr "repo.branch.delete_desc" | Str2html}}</p>
  133. </div>
  134. {{template "base/delete_modal_actions" .}}
  135. </div>