gogs.tmpl 1.4 KB

1234567891011121314151617181920212223242526272829
  1. {{if eq .HookType "gogs"}}
  2. <p>{{.i18n.Tr "repo.settings.add_webhook_desc" "https://gogs.io/docs/features/webhook.html" | Safe}}</p>
  3. <form class="ui form" action="{{if .PageIsSettingsHooksNew}}{{$.Link}}{{else}}{{.FormURL}}{{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. <p class="text grey desc">{{.i18n.Tr "repo.settings.secret_desc" | Safe}}</p>
  26. </div>
  27. {{template "repo/settings/webhook/settings" .}}
  28. </form>
  29. {{end}}