aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/settings
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-05-16 22:01:55 +0800
committerGitHub <noreply@github.com>2018-05-16 22:01:55 +0800
commit24941a10464dc27eaebafda2a208fa827b74ff8d (patch)
treec875dd6b7d659e2dbd926dbd3a04a036f9f41c94 /templates/repo/settings
parent188fe6c301f9c44d569b75cb339d6a6b3f6e03ad (diff)
downloadgitea-24941a10464dc27eaebafda2a208fa827b74ff8d.tar.gz
gitea-24941a10464dc27eaebafda2a208fa827b74ff8d.zip
Add more webhooks support and refactor webhook templates directory (#3929)
* add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * update vendor Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * load attributes when created release * update comparsion doc
Diffstat (limited to 'templates/repo/settings')
-rw-r--r--templates/repo/settings/webhook/base.tmpl (renamed from templates/repo/settings/hooks.tmpl)2
-rw-r--r--templates/repo/settings/webhook/delete_modal.tmpl (renamed from templates/repo/settings/hook_delete_modal.tmpl)0
-rw-r--r--templates/repo/settings/webhook/dingtalk.tmpl (renamed from templates/repo/settings/hook_dingtalk.tmpl)2
-rw-r--r--templates/repo/settings/webhook/discord.tmpl (renamed from templates/repo/settings/hook_discord.tmpl)2
-rw-r--r--templates/repo/settings/webhook/gitea.tmpl (renamed from templates/repo/settings/hook_gitea.tmpl)2
-rw-r--r--templates/repo/settings/webhook/gogs.tmpl (renamed from templates/repo/settings/hook_gogs.tmpl)2
-rw-r--r--templates/repo/settings/webhook/history.tmpl (renamed from templates/repo/settings/hook_history.tmpl)0
-rw-r--r--templates/repo/settings/webhook/list.tmpl (renamed from templates/repo/settings/hook_list.tmpl)2
-rw-r--r--templates/repo/settings/webhook/new.tmpl (renamed from templates/repo/settings/hook_new.tmpl)12
-rw-r--r--templates/repo/settings/webhook/settings.tmpl (renamed from templates/repo/settings/hook_settings.tmpl)52
-rw-r--r--templates/repo/settings/webhook/slack.tmpl (renamed from templates/repo/settings/hook_slack.tmpl)2
11 files changed, 64 insertions, 14 deletions
diff --git a/templates/repo/settings/hooks.tmpl b/templates/repo/settings/webhook/base.tmpl
index 34c5cfbb6c..6f486131f7 100644
--- a/templates/repo/settings/hooks.tmpl
+++ b/templates/repo/settings/webhook/base.tmpl
@@ -3,7 +3,7 @@
{{template "repo/header" .}}
{{template "repo/settings/navbar" .}}
<div class="ui container">
- {{template "repo/settings/hook_list" .}}
+ {{template "repo/settings/webhook/list" .}}
</div>
</div>
{{template "base/footer" .}}
diff --git a/templates/repo/settings/hook_delete_modal.tmpl b/templates/repo/settings/webhook/delete_modal.tmpl
index 2a2a7c8da2..2a2a7c8da2 100644
--- a/templates/repo/settings/hook_delete_modal.tmpl
+++ b/templates/repo/settings/webhook/delete_modal.tmpl
diff --git a/templates/repo/settings/hook_dingtalk.tmpl b/templates/repo/settings/webhook/dingtalk.tmpl
index 37271a7db5..3e6504f651 100644
--- a/templates/repo/settings/hook_dingtalk.tmpl
+++ b/templates/repo/settings/webhook/dingtalk.tmpl
@@ -6,6 +6,6 @@
<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>
- {{template "repo/settings/hook_settings" .}}
+ {{template "repo/settings/webhook/settings" .}}
</form>
{{end}}
diff --git a/templates/repo/settings/hook_discord.tmpl b/templates/repo/settings/webhook/discord.tmpl
index 901e7e6311..75c31efb51 100644
--- a/templates/repo/settings/hook_discord.tmpl
+++ b/templates/repo/settings/webhook/discord.tmpl
@@ -14,6 +14,6 @@
<label for="icon_url">{{.i18n.Tr "repo.settings.discord_icon_url"}}</label>
<input id="icon_url" name="icon_url" value="{{.DiscordHook.IconURL}}" placeholder="e.g. https://example.com/img/favicon.png">
</div>
- {{template "repo/settings/hook_settings" .}}
+ {{template "repo/settings/webhook/settings" .}}
</form>
{{end}}
diff --git a/templates/repo/settings/hook_gitea.tmpl b/templates/repo/settings/webhook/gitea.tmpl
index fc5e35e068..87a8813d0e 100644
--- a/templates/repo/settings/hook_gitea.tmpl
+++ b/templates/repo/settings/webhook/gitea.tmpl
@@ -23,6 +23,6 @@
<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" .}}
+ {{template "repo/settings/webhook/settings" .}}
</form>
{{end}}
diff --git a/templates/repo/settings/hook_gogs.tmpl b/templates/repo/settings/webhook/gogs.tmpl
index 28098d14ec..649fb54aea 100644
--- a/templates/repo/settings/hook_gogs.tmpl
+++ b/templates/repo/settings/webhook/gogs.tmpl
@@ -23,6 +23,6 @@
<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" .}}
+ {{template "repo/settings/webhook/settings" .}}
</form>
{{end}}
diff --git a/templates/repo/settings/hook_history.tmpl b/templates/repo/settings/webhook/history.tmpl
index a08481aafa..a08481aafa 100644
--- a/templates/repo/settings/hook_history.tmpl
+++ b/templates/repo/settings/webhook/history.tmpl
diff --git a/templates/repo/settings/hook_list.tmpl b/templates/repo/settings/webhook/list.tmpl
index 4e61ba7a07..de6bd2c5f2 100644
--- a/templates/repo/settings/hook_list.tmpl
+++ b/templates/repo/settings/webhook/list.tmpl
@@ -48,4 +48,4 @@
</div>
</div>
-{{template "repo/settings/hook_delete_modal" .}}
+{{template "repo/settings/webhook/delete_modal" .}}
diff --git a/templates/repo/settings/hook_new.tmpl b/templates/repo/settings/webhook/new.tmpl
index 7e3cf3c8cf..1b3d114577 100644
--- a/templates/repo/settings/hook_new.tmpl
+++ b/templates/repo/settings/webhook/new.tmpl
@@ -21,14 +21,14 @@
</div>
</h4>
<div class="ui attached segment">
- {{template "repo/settings/hook_gitea" .}}
- {{template "repo/settings/hook_gogs" .}}
- {{template "repo/settings/hook_slack" .}}
- {{template "repo/settings/hook_discord" .}}
- {{template "repo/settings/hook_dingtalk" .}}
+ {{template "repo/settings/webhook/gitea" .}}
+ {{template "repo/settings/webhook/gogs" .}}
+ {{template "repo/settings/webhook/slack" .}}
+ {{template "repo/settings/webhook/discord" .}}
+ {{template "repo/settings/webhook/dingtalk" .}}
</div>
- {{template "repo/settings/hook_history" .}}
+ {{template "repo/settings/webhook/history" .}}
</div>
</div>
{{template "base/footer" .}}
diff --git a/templates/repo/settings/hook_settings.tmpl b/templates/repo/settings/webhook/settings.tmpl
index 7f3406588f..f04c25a0a3 100644
--- a/templates/repo/settings/hook_settings.tmpl
+++ b/templates/repo/settings/webhook/settings.tmpl
@@ -32,6 +32,26 @@
</div>
</div>
</div>
+ <!-- Delete -->
+ <div class="seven wide column">
+ <div class="field">
+ <div class="ui checkbox">
+ <input class="hidden" name="delete" type="checkbox" tabindex="0" {{if .Webhook.Delete}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.event_delete"}}</label>
+ <span class="help">{{.i18n.Tr "repo.settings.event_delete_desc"}}</span>
+ </div>
+ </div>
+ </div>
+ <!-- Fork -->
+ <div class="seven wide column">
+ <div class="field">
+ <div class="ui checkbox">
+ <input class="hidden" name="fork" type="checkbox" tabindex="0" {{if .Webhook.Fork}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.event_fork"}}</label>
+ <span class="help">{{.i18n.Tr "repo.settings.event_fork_desc"}}</span>
+ </div>
+ </div>
+ </div>
<!-- Push -->
<div class="seven wide column">
<div class="field">
@@ -42,6 +62,26 @@
</div>
</div>
</div>
+ <!-- Issues -->
+ <div class="seven wide column">
+ <div class="field">
+ <div class="ui checkbox">
+ <input class="hidden" name="issues" type="checkbox" tabindex="0" {{if .Webhook.Issues}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.event_issues"}}</label>
+ <span class="help">{{.i18n.Tr "repo.settings.event_issues_desc"}}</span>
+ </div>
+ </div>
+ </div>
+ <!-- Issue Comment -->
+ <div class="seven wide column">
+ <div class="field">
+ <div class="ui checkbox">
+ <input class="hidden" name="issue_comment" type="checkbox" tabindex="0" {{if .Webhook.IssueComment}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.event_issue_comment"}}</label>
+ <span class="help">{{.i18n.Tr "repo.settings.event_issue_comment_desc"}}</span>
+ </div>
+ </div>
+ </div>
<!-- Pull Request -->
<div class="seven wide column">
<div class="field">
@@ -62,6 +102,16 @@
</div>
</div>
</div>
+ <!-- Release -->
+ <div class="seven wide column">
+ <div class="field">
+ <div class="ui checkbox">
+ <input class="hidden" name="release" type="checkbox" tabindex="0" {{if .Webhook.Release}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.event_release"}}</label>
+ <span class="help">{{.i18n.Tr "repo.settings.event_release_desc"}}</span>
+ </div>
+ </div>
+ </div>
</div>
</div>
@@ -83,4 +133,4 @@
{{end}}
</div>
-{{template "repo/settings/hook_delete_modal" .}}
+{{template "repo/settings/webhook/delete_modal" .}}
diff --git a/templates/repo/settings/hook_slack.tmpl b/templates/repo/settings/webhook/slack.tmpl
index 16e1859470..c35a679da7 100644
--- a/templates/repo/settings/hook_slack.tmpl
+++ b/templates/repo/settings/webhook/slack.tmpl
@@ -23,6 +23,6 @@
<label for="color">{{.i18n.Tr "repo.settings.slack_color"}}</label>
<input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="e.g. #dd4b39, good, warning, danger">
</div>
- {{template "repo/settings/hook_settings" .}}
+ {{template "repo/settings/webhook/settings" .}}
</form>
{{end}}