gitea源码

issue_management.tmpl 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {{if and .IsRepoAdmin (not .Repository.IsArchived)}}
  2. <div class="divider"></div>
  3. {{/* Pin issue */}}
  4. {{if or .PinEnabled .Issue.IsPinned}}
  5. <form class="tw-mt-1 form-fetch-action single-button-form" method="post" {{if $.NewPinAllowed}}action="{{.Issue.Link}}/pin"{{else}}data-tooltip-content="{{ctx.Locale.Tr "repo.issues.max_pinned"}}"{{end}}>
  6. {{$.CsrfTokenHtml}}
  7. <button class="fluid ui button {{if not $.NewPinAllowed}}disabled{{end}}">
  8. {{if not .Issue.IsPinned}}
  9. {{svg "octicon-pin"}}
  10. {{ctx.Locale.Tr "pin"}}
  11. {{else}}
  12. {{svg "octicon-pin-slash"}}
  13. {{ctx.Locale.Tr "unpin"}}
  14. {{end}}
  15. </button>
  16. </form>
  17. {{end}}
  18. {{/* Lock/unlock conversation */}}
  19. <button class="tw-mt-1 fluid ui show-modal button{{if .Issue.IsLocked}} red{{end}}" data-modal="#lock-conversation">
  20. {{if .Issue.IsLocked}}
  21. {{svg "octicon-key"}} {{ctx.Locale.Tr "repo.issues.unlock"}}
  22. {{else}}
  23. {{svg "octicon-lock"}} {{ctx.Locale.Tr "repo.issues.lock"}}
  24. {{end}}
  25. </button>
  26. <div class="ui tiny modal" id="lock-conversation">
  27. <div class="header">
  28. {{if .Issue.IsLocked}}
  29. {{ctx.Locale.Tr "repo.issues.unlock.title"}}
  30. {{else}}
  31. {{ctx.Locale.Tr "repo.issues.lock.title"}}
  32. {{end}}
  33. </div>
  34. <div class="content">
  35. <div class="ui warning message">
  36. {{if .Issue.IsLocked}}
  37. {{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}<br>
  38. {{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}<br>
  39. {{else}}
  40. {{ctx.Locale.Tr "repo.issues.lock.notice_1"}}<br>
  41. {{ctx.Locale.Tr "repo.issues.lock.notice_2"}}<br>
  42. {{ctx.Locale.Tr "repo.issues.lock.notice_3"}}<br>
  43. {{end}}
  44. </div>
  45. <form class="ui form form-fetch-action" method="post" action="{{.Issue.Link}}{{if .Issue.IsLocked}}/unlock{{else}}/lock{{end}}">
  46. {{.CsrfTokenHtml}}
  47. {{if not .Issue.IsLocked}}
  48. <div class="field">
  49. <strong>{{ctx.Locale.Tr "repo.issues.lock.reason"}}</strong>
  50. </div>
  51. <div class="field">
  52. <div class="ui fluid dropdown selection">
  53. <input type="hidden" name="reason">
  54. <div class="text"></div> {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  55. <div class="menu">
  56. <div class="item" data-value=""></div>
  57. {{range .LockReasons}}
  58. <div class="item" data-value="{{.}}">{{.}}</div>
  59. {{end}}
  60. </div>
  61. </div>
  62. </div>
  63. {{end}}
  64. <div class="actions">
  65. <button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
  66. {{/* explicitly focus the submit button, to avoid Fomantic modal focuses and popups the dropdown */}}
  67. <button class="ui red button" autofocus>
  68. {{if .Issue.IsLocked}}
  69. {{ctx.Locale.Tr "repo.issues.unlock_confirm"}}
  70. {{else}}
  71. {{ctx.Locale.Tr "repo.issues.lock_confirm"}}
  72. {{end}}
  73. </button>
  74. </div>
  75. </form>
  76. </div>
  77. </div>
  78. <button class="tw-mt-1 fluid ui show-modal button" data-modal="#sidebar-delete-issue">
  79. {{svg "octicon-trash"}}
  80. {{ctx.Locale.Tr "repo.issues.delete"}}
  81. </button>
  82. <div class="ui g-modal-confirm modal" id="sidebar-delete-issue">
  83. <div class="header">
  84. {{if .Issue.IsPull}}
  85. {{ctx.Locale.Tr "repo.pulls.delete.title"}}
  86. {{else}}
  87. {{ctx.Locale.Tr "repo.issues.delete.title"}}
  88. {{end}}
  89. </div>
  90. <div class="content">
  91. <p>
  92. {{if .Issue.IsPull}}
  93. {{ctx.Locale.Tr "repo.pulls.delete.text"}}
  94. {{else}}
  95. {{ctx.Locale.Tr "repo.issues.delete.text"}}
  96. {{end}}
  97. </p>
  98. </div>
  99. <form action="{{.Issue.Link}}/delete" method="post">
  100. {{.CsrfTokenHtml}}
  101. {{template "base/modal_actions_confirm" .}}
  102. </form>
  103. </div>
  104. {{end}}