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.

138 lines
5.3 KiB

  1. <div class="ui 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:= TimeSince .Issue.Created $.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. {{if .IsIssueOwner}}
  22. <div class="item action">
  23. <a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a>
  24. </div>
  25. {{end}}
  26. </div>
  27. </div>
  28. <div class="ui attached segment">
  29. <div class="render-content markdown has-emoji">
  30. {{if .Issue.RenderedContent}}
  31. {{.Issue.RenderedContent|Str2html}}
  32. {{else}}
  33. <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
  34. {{end}}
  35. </div>
  36. <div class="raw-content hide">{{.Issue.Content}}</div>
  37. <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>
  38. </div>
  39. {{if .Issue.Attachments}}
  40. <div class="ui bottom attached segment">
  41. <div class="ui small images">
  42. {{range .Issue.Attachments}}
  43. <a target="_blank" rel="noopener" href="{{AppSubUrl}}/attachments/{{.UUID}}">
  44. {{if FilenameIsImage .Name}}
  45. <img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
  46. {{else}}
  47. <span class="ui image octicon octicon-desktop-download" title='{{$.i18n.Tr "repo.issues.attachment.download" .Name}}'></span>
  48. {{end}}
  49. </a>
  50. {{end}}
  51. </div>
  52. </div>
  53. {{end}}
  54. </div>
  55. </div>
  56. {{ template "repo/issue/view_content/comments" . }}
  57. {{if .Issue.IsPull}}
  58. {{ template "repo/issue/view_content/pull". }}
  59. {{end}}
  60. {{if .IsSigned}}
  61. <div class="comment form">
  62. <a class="avatar" href="{{.SignedUser.HomeLink}}">
  63. <img src="{{.SignedUser.RelAvatarLink}}">
  64. </a>
  65. <div class="content">
  66. <form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
  67. {{template "repo/issue/comment_tab" .}}
  68. {{.CsrfTokenHtml}}
  69. <input id="status" name="status" type="hidden">
  70. <div class="text right">
  71. {{if and .IsIssueOwner (not .DisableStatusChange)}}
  72. {{if .Issue.IsClosed}}
  73. <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">
  74. {{.i18n.Tr "repo.issues.reopen_issue"}}
  75. </div>
  76. {{else}}
  77. <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">
  78. {{.i18n.Tr "repo.issues.close_issue"}}
  79. </div>
  80. {{end}}
  81. {{end}}
  82. <button class="ui green button" tabindex="5">
  83. {{.i18n.Tr "repo.issues.create_comment"}}
  84. </button>
  85. </div>
  86. </form>
  87. </div>
  88. </div>
  89. {{else}}
  90. <div class="ui warning message">
  91. {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}
  92. </div>
  93. {{end}}
  94. </ui>
  95. </div>
  96. {{ template "repo/issue/view_content/sidebar" . }}
  97. </div>
  98. <div class="hide" id="edit-content-form">
  99. <div class="ui comment form">
  100. <div class="ui top attached tabular menu">
  101. <a class="active write item">{{$.i18n.Tr "repo.release.write"}}</a>
  102. <a class="preview item" data-url="{{AppSubUrl}}/api/v1/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "repo.release.preview"}}</a>
  103. </div>
  104. <div class="ui bottom attached active write tab segment">
  105. <textarea tabindex="1" id="content" name="content"></textarea>
  106. </div>
  107. <div class="ui bottom attached tab preview segment markdown">
  108. {{$.i18n.Tr "repo.release.loading"}}
  109. </div>
  110. <div class="text right edit buttons">
  111. <div class="ui basic blue cancel button" tabindex="3">{{.i18n.Tr "repo.issues.cancel"}}</div>
  112. <div class="ui green save button" tabindex="2">{{.i18n.Tr "repo.issues.save"}}</div>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="hide" id="no-content">
  117. <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
  118. </div>
  119. <div class="ui small basic delete modal">
  120. <div class="ui icon header">
  121. <i class="trash icon"></i>
  122. {{.i18n.Tr "repo.branch.delete" .HeadTarget | Safe}}
  123. </div>
  124. <div class="content">
  125. <p>{{.i18n.Tr "repo.branch.delete_desc" | Safe}}</p>
  126. {{.i18n.Tr "repo.branch.delete_notices_1" | Safe}}<br>
  127. {{.i18n.Tr "repo.branch.delete_notices_2" .HeadTarget | Safe}}<br>
  128. </div>
  129. {{template "base/delete_modal_actions" .}}
  130. </div>