hook_settings.tmpl 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. <!-- Push -->
  35. <div class="seven wide column">
  36. <div class="field">
  37. <div class="ui checkbox">
  38. <input class="hidden" name="push" type="checkbox" tabindex="0" {{if .Webhook.Push}}checked{{end}}>
  39. <label>{{.i18n.Tr "repo.settings.event_push"}}</label>
  40. <span class="help">{{.i18n.Tr "repo.settings.event_push_desc"}}</span>
  41. </div>
  42. </div>
  43. </div>
  44. <!-- Pull Request -->
  45. <div class="seven wide column">
  46. <div class="field">
  47. <div class="ui checkbox">
  48. <input class="hidden" name="pull_request" type="checkbox" tabindex="0" {{if .Webhook.PullRequest}}checked{{end}}>
  49. <label>{{.i18n.Tr "repo.settings.event_pull_request"}}</label>
  50. <span class="help">{{.i18n.Tr "repo.settings.event_pull_request_desc"}}</span>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="ui divider"></div>
  57. <div class="inline field">
  58. <div class="ui checkbox">
  59. <input class="hidden" name="active" type="checkbox" tabindex="0" {{if or .PageIsSettingsHooksNew .Webhook.IsActive}}checked{{end}}>
  60. <label>{{.i18n.Tr "repo.settings.active"}}</label>
  61. <span class="help">{{.i18n.Tr "repo.settings.active_helper"}}</span>
  62. </div>
  63. </div>
  64. <div class="field">
  65. {{if .PageIsSettingsHooksNew}}
  66. <button class="ui green button">{{.i18n.Tr "repo.settings.add_webhook"}}</button>
  67. {{else}}
  68. <button class="ui green button">{{.i18n.Tr "repo.settings.update_webhook"}}</button>
  69. <a class="ui red delete-button button" data-url="{{.BaseLink}}/settings/hooks/delete" data-id="{{.Webhook.ID}}">{{.i18n.Tr "repo.settings.delete_webhook"}}</a>
  70. {{end}}
  71. </div>
  72. {{template "repo/settings/hook_delete_modal" .}}