hook_slack.tmpl 1.2 KB

12345678910111213141516
  1. <div id="slack" class="{{if or .PageIsSettingsHooksNew (and .PageIsSettingsHooksEdit (not (eq .HookType "Slack")))}}hidden{{end}}">
  2. <form class="form form-align panel-body repo-setting-form" id="repo-setting-form-slack" action="{{if .RepoLink}}{{.RepoLink}}{{else if .OrgLink}}{{.OrgLink}}{{end}}/settings/hooks/slack/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.Id}}{{end}}" method="post">
  3. {{.CsrfTokenHtml}}
  4. <input type="hidden" name="hook_type" value="slack">
  5. <div class="text-center panel-desc">{{.i18n.Tr "repo.settings.add_slack_hook_desc" | Str2html}}</div>
  6. <div class="field">
  7. <label class="req" for="payload-url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
  8. <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 />
  9. </div>
  10. <div class="field">
  11. <label class="req" for="channel">{{.i18n.Tr "repo.settings.slack_channel"}}</label>
  12. <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="channel" name="channel" type="text" value="{{.SlackHook.Channel}}" placeholder="#general" required />
  13. </div>
  14. {{template "repo/settings/hook_settings" .}}
  15. </form>
  16. </div>