summaryrefslogtreecommitdiffstats
path: root/templates/repo/settings
diff options
context:
space:
mode:
authorRémy Boulanouar <rboulanouar@gmail.com>2017-05-29 09:17:15 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-05-29 02:17:15 -0500
commite0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b (patch)
tree44e906f5ac3a322832e5d9a55ea59bf613d36b24 /templates/repo/settings
parente67ece26f0b97437200998b9b153b4c3a87a65aa (diff)
downloadgitea-e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b.tar.gz
gitea-e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b.zip
Add Gitea Webhook (#1755)
* Replace Gogs by Gitea * Fix missing changes * Create Gitea webhook and put Gogs webhook apart.
Diffstat (limited to 'templates/repo/settings')
-rw-r--r--templates/repo/settings/hook_gitea.tmpl28
-rw-r--r--templates/repo/settings/hook_list.tmpl5
-rw-r--r--templates/repo/settings/hook_new.tmpl5
3 files changed, 36 insertions, 2 deletions
diff --git a/templates/repo/settings/hook_gitea.tmpl b/templates/repo/settings/hook_gitea.tmpl
new file mode 100644
index 0000000000..4ac6d718c9
--- /dev/null
+++ b/templates/repo/settings/hook_gitea.tmpl
@@ -0,0 +1,28 @@
+{{if eq .HookType "gitea"}}
+ <p>{{.i18n.Tr "repo.settings.add_webhook_desc" "https://docs.gitea.io/features/webhook.html" | Str2html}}</p>
+ <form class="ui form" action="{{.BaseLink}}/settings/hooks/gitea/{{if .PageIsSettingsHooksNew}}new{{else}}{{.Webhook.ID}}{{end}}" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="required field {{if .Err_PayloadURL}}error{{end}}">
+ <label for="payload_url">{{.i18n.Tr "repo.settings.payload_url"}}</label>
+ <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required>
+ </div>
+ <div class="field">
+ <label>{{.i18n.Tr "repo.settings.content_type"}}</label>
+ <div class="ui selection dropdown">
+ <input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}application/json{{end}}">
+ <div class="default text"></div>
+ <i class="dropdown icon"></i>
+ <div class="menu">
+ <div class="item" data-value="1">application/json</div>
+ <div class="item" data-value="2">application/x-www-form-urlencoded</div>
+ </div>
+ </div>
+ </div>
+ <input class="fake" type="password">
+ <div class="field {{if .Err_Secret}}error{{end}}">
+ <label for="secret">{{.i18n.Tr "repo.settings.secret"}}</label>
+ <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off">
+ </div>
+ {{template "repo/settings/hook_settings" .}}
+ </form>
+{{end}}
diff --git a/templates/repo/settings/hook_list.tmpl b/templates/repo/settings/hook_list.tmpl
index 0b9c4d5057..aba948b952 100644
--- a/templates/repo/settings/hook_list.tmpl
+++ b/templates/repo/settings/hook_list.tmpl
@@ -5,9 +5,12 @@
<div class="ui floating1 jump dropdown">
<div class="ui blue tiny button">{{.i18n.Tr "repo.settings.add_webhook"}}</div>
<div class="menu">
- <a class="item" href="{{.BaseLink}}/settings/hooks/gogs/new">
+ <a class="item" href="{{.BaseLink}}/settings/hooks/gitea/new">
<img class="img-10" src="{{AppSubUrl}}/img/favicon.png">Gitea
</a>
+ <a class="item" href="{{.BaseLink}}/settings/hooks/gogs/new">
+ <img class="img-10" src="{{AppSubUrl}}/img/gogs.ico">Gogs
+ </a>
<a class="item" href="{{.BaseLink}}/settings/hooks/slack/new">
<img class="img-10" src="{{AppSubUrl}}/img/slack.png">Slack
</a>
diff --git a/templates/repo/settings/hook_new.tmpl b/templates/repo/settings/hook_new.tmpl
index 8f7f0026f2..48322e47f8 100644
--- a/templates/repo/settings/hook_new.tmpl
+++ b/templates/repo/settings/hook_new.tmpl
@@ -7,14 +7,17 @@
<h4 class="ui top attached header">
{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
<div class="ui right">
- {{if eq .HookType "gogs"}}
+ {{if eq .HookType "gitea"}}
<img class="img-13" src="{{AppSubUrl}}/img/favicon.png">
+ {{else if eq .HookType "gogs"}}
+ <img class="img-13" src="{{AppSubUrl}}/img/gogs.ico">
{{else if eq .HookType "slack"}}
<img class="img-13" src="{{AppSubUrl}}/img/slack.png">
{{end}}
</div>
</h4>
<div class="ui attached segment">
+ {{template "repo/settings/hook_gitea" .}}
{{template "repo/settings/hook_gogs" .}}
{{template "repo/settings/hook_slack" .}}
</div>