2021-01-15 04:54:03 +05:30
|
|
|
{{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}}
|
2014-08-24 18:29:47 +05:30
|
|
|
<div class="field">
|
2023-09-25 14:26:50 +05:30
|
|
|
<h4>{{ctx.Locale.Tr "repo.settings.event_desc"}}</h4>
|
2015-08-28 21:06:13 +05:30
|
|
|
<div class="grouped event type fields">
|
2015-12-08 04:00:52 +05:30
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio non-events checkbox">
|
2023-02-13 08:46:59 +05:30
|
|
|
<input name="events" type="radio" value="push_only" {{if or $isNew .Webhook.PushOnly}}checked{{end}}>
|
2024-03-10 14:21:19 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_push_only"}}</label>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio non-events checkbox">
|
2023-02-13 08:46:59 +05:30
|
|
|
<input name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}>
|
2024-03-10 14:21:19 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_send_everything"}}</label>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio events checkbox">
|
2023-02-13 08:46:59 +05:30
|
|
|
<input name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}>
|
2024-03-10 14:21:19 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_choose"}}</label>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2015-08-26 22:00:06 +05:30
|
|
|
</div>
|
2015-08-28 21:06:13 +05:30
|
|
|
|
2023-02-19 09:36:14 +05:30
|
|
|
<div class="events fields ui grid {{if not .Webhook.ChooseEvents}}gt-hidden{{end}}">
|
2020-03-06 10:40:48 +05:30
|
|
|
<!-- Repository Events -->
|
|
|
|
<div class="fourteen wide column">
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_header_repository"}}</label>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
2015-12-08 04:00:52 +05:30
|
|
|
<!-- Create -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="create" type="checkbox" {{if .Webhook.Create}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_create"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_create_desc"}}</span>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-16 19:31:55 +05:30
|
|
|
<!-- Delete -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="delete" type="checkbox" {{if .Webhook.Delete}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_delete"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_delete_desc"}}</span>
|
2018-05-16 19:31:55 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Fork -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="fork" type="checkbox" {{if .Webhook.Fork}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_fork"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_fork_desc"}}</span>
|
2018-05-16 19:31:55 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-12-08 04:00:52 +05:30
|
|
|
<!-- Push -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="push" type="checkbox" {{if .Webhook.Push}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_push"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_push_desc"}}</span>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-06 10:40:48 +05:30
|
|
|
<!-- Repository -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="repository" type="checkbox" {{if .Webhook.Repository}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_repository"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_repository_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Release -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="release" type="checkbox" {{if .Webhook.Release}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_release"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_release_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-03-30 14:12:47 +05:30
|
|
|
<!-- Package -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="package" type="checkbox" {{if .Webhook.Package}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_package"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_package_desc"}}</span>
|
2022-03-30 14:12:47 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-06 10:40:48 +05:30
|
|
|
|
2022-09-05 01:24:23 +05:30
|
|
|
<!-- Wiki -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="wiki" type="checkbox" {{if .Webhook.Wiki}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_wiki"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_wiki_desc"}}</span>
|
2022-09-05 01:24:23 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-03-06 10:40:48 +05:30
|
|
|
<!-- Issue Events -->
|
|
|
|
<div class="fourteen wide column">
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_header_issue"}}</label>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
2018-05-16 19:31:55 +05:30
|
|
|
<!-- Issues -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="issues" type="checkbox" {{if .Webhook.Issues}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_issues"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_issues_desc"}}</span>
|
2018-05-16 19:31:55 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-06 10:40:48 +05:30
|
|
|
<!-- Issue Assign -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="issue_assign" type="checkbox" {{if .Webhook.IssueAssign}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_issue_assign"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_assign_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Issue Label -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="issue_label" type="checkbox" {{if .Webhook.IssueLabel}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_issue_label"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_label_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Issue Milestone -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="issue_milestone" type="checkbox" {{if .Webhook.IssueMilestone}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_issue_milestone"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_milestone_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-16 19:31:55 +05:30
|
|
|
<!-- Issue Comment -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="issue_comment" type="checkbox" {{if .Webhook.IssueComment}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_issue_comment"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_comment_desc"}}</span>
|
2018-05-16 19:31:55 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-06 10:40:48 +05:30
|
|
|
|
|
|
|
<!-- Pull Request Events -->
|
|
|
|
<div class="fourteen wide column">
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_header_pull_request"}}</label>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
2016-08-14 16:02:24 +05:30
|
|
|
<!-- Pull Request -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="pull_request" type="checkbox" {{if .Webhook.PullRequest}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_pull_request"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_desc"}}</span>
|
2016-08-14 16:02:24 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-06 10:40:48 +05:30
|
|
|
<!-- Pull Request Assign -->
|
2017-09-03 13:50:24 +05:30
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="pull_request_assign" type="checkbox" {{if .Webhook.PullRequestAssign}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_assign"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span>
|
2017-09-03 13:50:24 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-06 10:40:48 +05:30
|
|
|
<!-- Pull Request Label -->
|
2018-05-16 19:31:55 +05:30
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="pull_request_label" type="checkbox" {{if .Webhook.PullRequestLabel}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_label"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_label_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Pull Request Milestone -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="pull_request_milestone" type="checkbox" {{if .Webhook.PullRequestMilestone}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Pull Request Comment -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="pull_request_comment" type="checkbox" {{if .Webhook.PullRequestComment}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_comment"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Pull Request Review -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="pull_request_review" type="checkbox" {{if .Webhook.PullRequestReview}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_desc"}}</span>
|
2020-03-06 10:40:48 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- Pull Request Sync -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="pull_request_sync" type="checkbox" {{if .Webhook.PullRequestSync}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_sync"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span>
|
2018-05-16 19:31:55 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-05-25 07:36:27 +05:30
|
|
|
<!-- Pull Request Review Request -->
|
|
|
|
<div class="seven wide column">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="pull_request_review_request" type="checkbox" {{if .Webhook.PullRequestReviewRequest}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span>
|
2023-05-25 07:36:27 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
2014-08-24 18:29:47 +05:30
|
|
|
</div>
|
2015-08-28 21:06:13 +05:30
|
|
|
|
2019-09-09 11:18:21 +05:30
|
|
|
<!-- Branch filter -->
|
|
|
|
<div class="field">
|
2023-09-25 14:26:50 +05:30
|
|
|
<label for="branch_filter">{{ctx.Locale.Tr "repo.settings.branch_filter"}}</label>
|
2024-02-17 20:02:43 +05:30
|
|
|
<input id="branch_filter" name="branch_filter" type="text" value="{{or .Webhook.BranchFilter "*"}}">
|
2024-03-10 14:21:19 +05:30
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.branch_filter_desc"}}</span>
|
2019-09-09 11:18:21 +05:30
|
|
|
</div>
|
|
|
|
|
2022-11-03 23:53:20 +05:30
|
|
|
<!-- Authorization Header -->
|
2024-03-24 03:13:44 +05:30
|
|
|
<div class="field{{if eq .HookType "matrix"}} required{{end}} {{if .Err_AuthorizationHeader}}error{{end}}">
|
2023-09-25 14:26:50 +05:30
|
|
|
<label for="authorization_header">{{ctx.Locale.Tr "repo.settings.authorization_header"}}</label>
|
2022-11-03 23:53:20 +05:30
|
|
|
<input id="authorization_header" name="authorization_header" type="text" value="{{.Webhook.HeaderAuthorization}}"{{if eq .HookType "matrix"}} placeholder="Bearer $access_token" required{{end}}>
|
|
|
|
{{if ne .HookType "matrix"}}{{/* Matrix doesn't make the authorization optional but it is implied by the help string, should be changed.*/}}
|
2024-02-25 16:15:56 +05:30
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" ("<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | SafeHTML)}}</span>
|
2022-11-03 23:53:20 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
|
2023-06-29 17:54:22 +05:30
|
|
|
<div class="divider"></div>
|
2015-08-28 21:06:13 +05:30
|
|
|
|
2015-08-26 22:00:06 +05:30
|
|
|
<div class="inline field">
|
2015-12-08 04:00:52 +05:30
|
|
|
<div class="ui checkbox">
|
2023-08-26 08:14:00 +05:30
|
|
|
<input name="active" type="checkbox" {{if or $isNew .Webhook.IsActive}}checked{{end}}>
|
2023-09-25 14:26:50 +05:30
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.active"}}</label>
|
|
|
|
<span class="help">{{ctx.Locale.Tr "repo.settings.active_helper"}}</span>
|
2015-12-08 04:00:52 +05:30
|
|
|
</div>
|
2014-08-24 18:29:47 +05:30
|
|
|
</div>
|
|
|
|
<div class="field">
|
2019-03-19 08:03:20 +05:30
|
|
|
{{if $isNew}}
|
2023-09-25 14:26:50 +05:30
|
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</button>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{else}}
|
2023-09-25 14:26:50 +05:30
|
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_webhook"}}</button>
|
|
|
|
<a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a>
|
2015-12-08 04:00:52 +05:30
|
|
|
{{end}}
|
2014-08-24 18:29:47 +05:30
|
|
|
</div>
|
2015-08-26 22:00:06 +05:30
|
|
|
|
2018-05-16 19:31:55 +05:30
|
|
|
{{template "repo/settings/webhook/delete_modal" .}}
|