webhook_settings.tmpl 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. <!-- Pull Request -->
  65. <div class="seven wide column">
  66. <div class="field">
  67. <div class="ui checkbox">
  68. <input class="hidden" name="pull_request" type="checkbox" tabindex="0" {{if .Webhook.PullRequest}}checked{{end}}>
  69. <label>{{.i18n.Tr "repo.settings.event_pull_request"}}</label>
  70. <span class="help">{{.i18n.Tr "repo.settings.event_pull_request_desc"}}</span>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="ui divider"></div>
  77. <div class="inline field">
  78. <div class="ui checkbox">
  79. <input class="hidden" name="active" type="checkbox" tabindex="0" {{if or .PageIsSettingsHooksNew .Webhook.IsActive}}checked{{end}}>
  80. <label>{{.i18n.Tr "repo.settings.active"}}</label>
  81. <span class="help">{{.i18n.Tr "repo.settings.active_helper"}}</span>
  82. </div>
  83. </div>
  84. <div class="field">
  85. {{if .PageIsSettingsHooksNew}}
  86. <button class="ui green button">{{.i18n.Tr "repo.settings.add_webhook"}}</button>
  87. {{else}}
  88. <button class="ui green button">{{.i18n.Tr "repo.settings.update_webhook"}}</button>
  89. <a class="ui red delete-button button" data-url="{{.BaseLink}}/settings/hooks/delete" data-id="{{.Webhook.ID}}">{{.i18n.Tr "repo.settings.delete_webhook"}}</a>
  90. {{end}}
  91. </div>
  92. {{template "repo/settings/webhook_delete_modal" .}}