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.

hook_new.tmpl 4.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {{template "ng/base/head" .}}
  2. {{template "ng/base/header" .}}
  3. <div id="repo-wrapper">
  4. {{template "repo/header" .}}
  5. <div id="setting-wrapper" class="main-wrapper">
  6. <div id="repo-setting" class="container clear">
  7. {{template "repo/settings/nav" .}}
  8. <div class="grid-4-5 left">
  9. <div class="setting-content">
  10. {{template "ng/base/alert" .}}
  11. <div id="setting-content">
  12. <div id="repo-hooks-panel" class="panel panel-radius">
  13. <div class="panel-header">
  14. <strong>{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}</strong>
  15. </div>
  16. <form class="form form-align panel-body" id="repo-setting-form" action="{{.RepoLink}}/settings/hooks/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.Id}}{{end}}" method="post">
  17. {{.CsrfTokenHtml}}
  18. <div class="text-center panel-desc">{{.i18n.Tr "repo.settings.add_webhook_desc" | Str2html}}</div>
  19. <div class="field">
  20. <label class="req" for="payload-url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
  21. <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="payload-url" name="payload_url" type="url" value="{{.Webhook.Url}}" required />
  22. </div>
  23. <div class="field">
  24. <label class="req">{{.i18n.Tr "repo.settings.content_type"}}</label>
  25. <select name="content_type">
  26. <option value="1" {{if or .PageIsSettingsHooksNew (eq .Webhook.ContentType 1)}}selected{{end}}>application/json</option>
  27. <option value="2" {{if eq .Webhook.ContentType 2}}selected{{end}}>application/x-www-form-urlencoded</option>
  28. </select>
  29. </div>
  30. <div class="field">
  31. <label for="secret">{{.i18n.Tr "repo.settings.secret"}}</label>
  32. <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off" />
  33. </div>
  34. <div class="field">
  35. <h4 class="text-center">{{.i18n.Tr "repo.settings.event_desc"}}</h4>
  36. <label></label>
  37. <input name="push_only" type="radio" {{if or .PageIsSettingsHooksNew .Webhook.PushOnly}}checked{{end}}> {{.i18n.Tr "repo.settings.event_push_only" | Str2html}}
  38. </div>
  39. <div class="field">
  40. <label for="active">{{.i18n.Tr "repo.settings.active"}}</label>
  41. <input class="ipt-chk" id="active" name="active" type="checkbox" {{if or .PageIsSettingsHooksNew .Webhook.IsActive}}checked{{end}} />
  42. <span>{{.i18n.Tr "repo.settings.active_helper"}}</span>
  43. </div>
  44. <div class="field">
  45. <label></label>
  46. <button class="btn btn-green btn-large btn-radius">{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}</button>
  47. {{if .PageIsSettingsHooksEdit}}<a class="btn btn-red btn-large btn-link btn-radius" href="{{.RepoLink}}/settings/hooks?remove={{.Webhook.Id}}"><strong>{{.i18n.Tr "repo.settings.delete_webhook"}}</strong></a>{{end}}
  48. </div>
  49. </form>
  50. </div>
  51. </div>
  52. <br>
  53. <div id="setting-content">
  54. <div id="repo-hooks-history-panel" class="panel panel-radius">
  55. <div class="panel-header">
  56. <strong>{{.i18n.Tr "repo.settings.recent_deliveries"}}</strong>
  57. </div>
  58. <ul class="panel-body setting-list">
  59. <li>Coming soon!</li>
  60. </ul>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. {{template "ng/base/footer" .}}