2013-08-15 18:19:29 +00:00
|
|
|
%h3.page-title
|
2013-12-02 19:38:32 +00:00
|
|
|
Web hooks
|
2013-08-15 18:19:29 +00:00
|
|
|
|
|
|
|
%p.light
|
2013-12-02 19:38:32 +00:00
|
|
|
#{link_to "Web hooks ", help_web_hooks_path, class: "vlink"} can be
|
2014-01-07 14:19:45 +00:00
|
|
|
used for binding events when something is happening within the project.
|
2013-08-15 18:19:29 +00:00
|
|
|
|
|
|
|
%hr.clearfix
|
2012-01-08 11:20:20 +00:00
|
|
|
|
2013-12-31 14:16:50 +00:00
|
|
|
= form_for [@project, @hook], as: :hook, url: project_hooks_path(@project), html: { class: 'form-horizontal' } do |f|
|
2012-04-26 17:43:12 +00:00
|
|
|
-if @hook.errors.any?
|
2013-12-31 14:34:14 +00:00
|
|
|
.alert.alert-danger
|
2012-04-26 17:43:12 +00:00
|
|
|
- @hook.errors.full_messages.each do |msg|
|
|
|
|
%p= msg
|
2013-12-30 23:27:02 +00:00
|
|
|
.form-group
|
2013-12-31 14:16:50 +00:00
|
|
|
= f.label :url, "URL", class: 'control-label'
|
2013-12-30 23:27:02 +00:00
|
|
|
.col-sm-10
|
2013-12-31 14:16:50 +00:00
|
|
|
= f.text_field :url, class: "form-control", placeholder: 'http://example.com/trigger-ci.json'
|
2013-12-30 23:27:02 +00:00
|
|
|
.form-group
|
2013-12-31 14:16:50 +00:00
|
|
|
= f.label :url, "Trigger", class: 'control-label'
|
2013-12-30 23:27:02 +00:00
|
|
|
.col-sm-10
|
2013-12-02 19:38:32 +00:00
|
|
|
%div
|
|
|
|
= f.check_box :push_events, class: 'pull-left'
|
|
|
|
.prepend-left-20
|
|
|
|
= f.label :push_events, class: 'list-label' do
|
|
|
|
%strong Push events
|
|
|
|
%p.light
|
2014-01-07 14:19:45 +00:00
|
|
|
This url will be triggered by a push to the repository
|
2013-12-02 19:38:32 +00:00
|
|
|
%div
|
|
|
|
= f.check_box :issues_events, class: 'pull-left'
|
|
|
|
.prepend-left-20
|
|
|
|
= f.label :issues_events, class: 'list-label' do
|
|
|
|
%strong Issues events
|
|
|
|
%p.light
|
2014-01-07 14:19:45 +00:00
|
|
|
This url will be triggered when an issue is created
|
2013-12-02 19:38:32 +00:00
|
|
|
%div
|
|
|
|
= f.check_box :merge_requests_events, class: 'pull-left'
|
|
|
|
.prepend-left-20
|
|
|
|
= f.label :merge_requests_events, class: 'list-label' do
|
|
|
|
%strong Merge Request events
|
|
|
|
%p.light
|
2014-01-07 14:19:45 +00:00
|
|
|
This url will be triggered when a merge request is created
|
2013-12-31 14:16:50 +00:00
|
|
|
.form-actions
|
|
|
|
= f.submit "Add Web Hook", class: "btn btn-create"
|
2012-03-28 07:46:51 +00:00
|
|
|
|
2012-03-05 22:29:40 +00:00
|
|
|
-if @hooks.any?
|
2013-06-19 19:55:49 +00:00
|
|
|
.ui-box
|
2013-07-13 17:36:21 +00:00
|
|
|
.title
|
2013-12-13 11:14:43 +00:00
|
|
|
Web hooks (#{@hooks.count})
|
2013-06-19 19:55:49 +00:00
|
|
|
%ul.well-list
|
|
|
|
- @hooks.each do |hook|
|
|
|
|
%li
|
2013-01-30 14:40:43 +00:00
|
|
|
.pull-right
|
2013-01-29 20:29:21 +00:00
|
|
|
= link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn btn-small grouped"
|
2013-12-10 19:33:21 +00:00
|
|
|
= link_to 'Remove', project_hook_path(@project, hook), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove btn-small grouped"
|
2013-12-02 19:38:32 +00:00
|
|
|
.clearfix
|
|
|
|
%span.monospace= hook.url
|
|
|
|
%p
|
|
|
|
- %w(push_events issues_events merge_requests_events).each do |trigger|
|
|
|
|
- if hook.send(trigger)
|
|
|
|
%span.label.label-gray= trigger.titleize
|