webhook_settings.tmpl 4.9 KB

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