本站源代码
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.

145 lines
5.6KB

  1. {{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminHooksNew}}
  2. <div class="field">
  3. <h4>{{.i18n.Tr "repo.settings.event_desc"}}</h4>
  4. <div class="grouped event type fields">
  5. <div class="field">
  6. <div class="ui radio non-events checkbox">
  7. <input class="hidden" name="events" type="radio" value="push_only" {{if or $isNew .Webhook.PushOnly}}checked{{end}}>
  8. <label>{{.i18n.Tr "repo.settings.event_push_only" | Str2html}}</label>
  9. </div>
  10. </div>
  11. <div class="field">
  12. <div class="ui radio non-events checkbox">
  13. <input class="hidden" name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}>
  14. <label>{{.i18n.Tr "repo.settings.event_send_everything" | Str2html}}</label>
  15. </div>
  16. </div>
  17. <div class="field">
  18. <div class="ui radio events checkbox">
  19. <input class="hidden" name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}>
  20. <label>{{.i18n.Tr "repo.settings.event_choose" | Str2html}}</label>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="events fields ui grid" {{if not .Webhook.ChooseEvents}}style="display:none"{{end}}>
  25. <!-- Create -->
  26. <div class="seven wide column">
  27. <div class="field">
  28. <div class="ui checkbox">
  29. <input class="hidden" name="create" type="checkbox" tabindex="0" {{if .Webhook.Create}}checked{{end}}>
  30. <label>{{.i18n.Tr "repo.settings.event_create"}}</label>
  31. <span class="help">{{.i18n.Tr "repo.settings.event_create_desc"}}</span>
  32. </div>
  33. </div>
  34. </div>
  35. <!-- Delete -->
  36. <div class="seven wide column">
  37. <div class="field">
  38. <div class="ui checkbox">
  39. <input class="hidden" name="delete" type="checkbox" tabindex="0" {{if .Webhook.Delete}}checked{{end}}>
  40. <label>{{.i18n.Tr "repo.settings.event_delete"}}</label>
  41. <span class="help">{{.i18n.Tr "repo.settings.event_delete_desc"}}</span>
  42. </div>
  43. </div>
  44. </div>
  45. <!-- Fork -->
  46. <div class="seven wide column">
  47. <div class="field">
  48. <div class="ui checkbox">
  49. <input class="hidden" name="fork" type="checkbox" tabindex="0" {{if .Webhook.Fork}}checked{{end}}>
  50. <label>{{.i18n.Tr "repo.settings.event_fork"}}</label>
  51. <span class="help">{{.i18n.Tr "repo.settings.event_fork_desc"}}</span>
  52. </div>
  53. </div>
  54. </div>
  55. <!-- Push -->
  56. <div class="seven wide column">
  57. <div class="field">
  58. <div class="ui checkbox">
  59. <input class="hidden" name="push" type="checkbox" tabindex="0" {{if .Webhook.Push}}checked{{end}}>
  60. <label>{{.i18n.Tr "repo.settings.event_push"}}</label>
  61. <span class="help">{{.i18n.Tr "repo.settings.event_push_desc"}}</span>
  62. </div>
  63. </div>
  64. </div>
  65. <!-- Issues -->
  66. <div class="seven wide column">
  67. <div class="field">
  68. <div class="ui checkbox">
  69. <input class="hidden" name="issues" type="checkbox" tabindex="0" {{if .Webhook.Issues}}checked{{end}}>
  70. <label>{{.i18n.Tr "repo.settings.event_issues"}}</label>
  71. <span class="help">{{.i18n.Tr "repo.settings.event_issues_desc"}}</span>
  72. </div>
  73. </div>
  74. </div>
  75. <!-- Issue Comment -->
  76. <div class="seven wide column">
  77. <div class="field">
  78. <div class="ui checkbox">
  79. <input class="hidden" name="issue_comment" type="checkbox" tabindex="0" {{if .Webhook.IssueComment}}checked{{end}}>
  80. <label>{{.i18n.Tr "repo.settings.event_issue_comment"}}</label>
  81. <span class="help">{{.i18n.Tr "repo.settings.event_issue_comment_desc"}}</span>
  82. </div>
  83. </div>
  84. </div>
  85. <!-- Pull Request -->
  86. <div class="seven wide column">
  87. <div class="field">
  88. <div class="ui checkbox">
  89. <input class="hidden" name="pull_request" type="checkbox" tabindex="0" {{if .Webhook.PullRequest}}checked{{end}}>
  90. <label>{{.i18n.Tr "repo.settings.event_pull_request"}}</label>
  91. <span class="help">{{.i18n.Tr "repo.settings.event_pull_request_desc"}}</span>
  92. </div>
  93. </div>
  94. </div>
  95. <!-- Repository -->
  96. <div class="seven wide column">
  97. <div class="field">
  98. <div class="ui checkbox">
  99. <input class="hidden" name="repository" type="checkbox" tabindex="0" {{if .Webhook.Repository}}checked{{end}}>
  100. <label>{{.i18n.Tr "repo.settings.event_repository"}}</label>
  101. <span class="help">{{.i18n.Tr "repo.settings.event_repository_desc"}}</span>
  102. </div>
  103. </div>
  104. </div>
  105. <!-- Release -->
  106. <div class="seven wide column">
  107. <div class="field">
  108. <div class="ui checkbox">
  109. <input class="hidden" name="release" type="checkbox" tabindex="0" {{if .Webhook.Release}}checked{{end}}>
  110. <label>{{.i18n.Tr "repo.settings.event_release"}}</label>
  111. <span class="help">{{.i18n.Tr "repo.settings.event_release_desc"}}</span>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <!-- Branch filter -->
  118. <div class="field">
  119. <label for="branch_filter">{{.i18n.Tr "repo.settings.branch_filter"}}</label>
  120. <input name="branch_filter" type="text" tabindex="0" value="{{or .Webhook.BranchFilter "*"}}">
  121. <span class="help">{{.i18n.Tr "repo.settings.branch_filter_desc" | Str2html}}</span>
  122. </div>
  123. <div class="ui divider"></div>
  124. <div class="inline field">
  125. <div class="ui checkbox">
  126. <input class="hidden" name="active" type="checkbox" tabindex="0" {{if or $isNew .Webhook.IsActive}}checked{{end}}>
  127. <label>{{.i18n.Tr "repo.settings.active"}}</label>
  128. <span class="help">{{.i18n.Tr "repo.settings.active_helper"}}</span>
  129. </div>
  130. </div>
  131. <div class="field">
  132. {{if $isNew}}
  133. <button class="ui green button">{{.i18n.Tr "repo.settings.add_webhook"}}</button>
  134. {{else}}
  135. <button class="ui green button">{{.i18n.Tr "repo.settings.update_webhook"}}</button>
  136. <a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{.i18n.Tr "repo.settings.delete_webhook"}}</a>
  137. {{end}}
  138. </div>
  139. {{template "repo/settings/webhook/delete_modal" .}}
上海开阖软件有限公司 沪ICP备12045867号-1