hook_gogs.tmpl 1.4 KB

12345678910111213141516171819202122232425262728
  1. {{if eq .HookType "gogs"}}
  2. <p>{{.i18n.Tr "repo.settings.add_webhook_desc" "http://gogs.io/docs/features/webhook.html" | Str2html}}</p>
  3. <form class="ui form" action="{{.BaseLink}}/settings/hooks/gogs/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
  4. {{.CsrfTokenHtml}}
  5. <div class="required field {{if .Err_PayloadURL}}error{{end}}">
  6. <label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
  7. <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
  8. </div>
  9. <div class="field">
  10. <label>{{.i18n.Tr "repo.settings.content_type"}}</label>
  11. <div class="ui selection dropdown">
  12. <input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}application/json{{end}}">
  13. <div class="default text"></div>
  14. <i class="dropdown icon"></i>
  15. <div class="menu">
  16. <div class="item" data-value="1">application/json</div>
  17. <div class="item" data-value="2">application/x-www-form-urlencoded</div>
  18. </div>
  19. </div>
  20. </div>
  21. <input class="fake" type="password">
  22. <div class="field {{if .Err_Secret}}error{{end}}">
  23. <label for="secret">{{.i18n.Tr "repo.settings.secret"}}</label>
  24. <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off">
  25. </div>
  26. {{template "repo/settings/hook_settings" .}}
  27. </form>
  28. {{end}}