aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/settings/hook_settings.tmpl
blob: 7f3406588fa77ec39c17c3ad1a2b539013607361 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<div class="field">
	<h4>{{.i18n.Tr "repo.settings.event_desc"}}</h4>
	<div class="grouped event type fields">
		<div class="field">
			<div class="ui radio non-events checkbox">
				<input class="hidden" name="events" type="radio" value="push_only" {{if or .PageIsSettingsHooksNew .Webhook.PushOnly}}checked{{end}}>
				<label>{{.i18n.Tr "repo.settings.event_push_only" | Str2html}}</label>
			</div>
		</div>
		<div class="field">
			<div class="ui radio non-events checkbox">
				<input class="hidden" name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}>
				<label>{{.i18n.Tr "repo.settings.event_send_everything" | Str2html}}</label>
			</div>
		</div>
		<div class="field">
			<div class="ui radio events checkbox">
				<input class="hidden" name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}>
				<label>{{.i18n.Tr "repo.settings.event_choose" | Str2html}}</label>
			</div>
		</div>
	</div>

	<div class="events fields ui grid" {{if not .Webhook.ChooseEvents}}style="display:none"{{end}}>
		<!-- Create -->
		<div class="seven wide column">
			<div class="field">
				<div class="ui checkbox">
					<input class="hidden" name="create" type="checkbox" tabindex="0" {{if .Webhook.Create}}checked{{end}}>
					<label>{{.i18n.Tr "repo.settings.event_create"}}</label>
					<span class="help">{{.i18n.Tr "repo.settings.event_create_desc"}}</span>
				</div>
			</div>
		</div>
		<!-- Push -->
		<div class="seven wide column">
			<div class="field">
				<div class="ui checkbox">
					<input class="hidden" name="push" type="checkbox" tabindex="0" {{if .Webhook.Push}}checked{{end}}>
					<label>{{.i18n.Tr "repo.settings.event_push"}}</label>
					<span class="help">{{.i18n.Tr "repo.settings.event_push_desc"}}</span>
				</div>
			</div>
		</div>
		<!-- Pull Request -->
		<div class="seven wide column">
			<div class="field">
				<div class="ui checkbox">
					<input class="hidden" name="pull_request" type="checkbox" tabindex="0" {{if .Webhook.PullRequest}}checked{{end}}>
					<label>{{.i18n.Tr "repo.settings.event_pull_request"}}</label>
					<span class="help">{{.i18n.Tr "repo.settings.event_pull_request_desc"}}</span>
				</div>
			</div>
		</div>
		<!-- Repository -->
		<div class="seven wide column">
			<div class="field">
				<div class="ui checkbox">
					<input class="hidden" name="repository" type="checkbox" tabindex="0" {{if .Webhook.Repository}}checked{{end}}>
					<label>{{.i18n.Tr "repo.settings.event_repository"}}</label>
					<span class="help">{{.i18n.Tr "repo.settings.event_repository_desc"}}</span>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="ui divider"></div>

<div class="inline field">
	<div class="ui checkbox">
		<input class="hidden" name="active" type="checkbox" tabindex="0" {{if or .PageIsSettingsHooksNew .Webhook.IsActive}}checked{{end}}>
		<label>{{.i18n.Tr "repo.settings.active"}}</label>
		<span class="help">{{.i18n.Tr "repo.settings.active_helper"}}</span>
	</div>
</div>
<div class="field">
	{{if .PageIsSettingsHooksNew}}
		<button class="ui green button">{{.i18n.Tr "repo.settings.add_webhook"}}</button>
	{{else}}
		<button class="ui green button">{{.i18n.Tr "repo.settings.update_webhook"}}</button>
		<a class="ui red delete-button button" data-url="{{.BaseLink}}/settings/hooks/delete" data-id="{{.Webhook.ID}}">{{.i18n.Tr "repo.settings.delete_webhook"}}</a>
	{{end}}
</div>

{{template "repo/settings/hook_delete_modal" .}}