2012-02-20 07:39:03 +01:00
|
|
|
= render "projects/project_head"
|
2012-01-04 01:07:56 +01:00
|
|
|
|
2012-01-28 11:40:17 +01:00
|
|
|
- if can? current_user, :admin_project, @project
|
2012-04-26 19:43:12 +02:00
|
|
|
.alert.alert-info
|
|
|
|
%span
|
|
|
|
Post receive hooks for binding events when someone push to repository.
|
|
|
|
%br
|
2012-06-04 00:37:27 +02:00
|
|
|
Read more about web hooks
|
2012-08-11 00:07:50 +02:00
|
|
|
%strong #{link_to "here", help_web_hooks_path, class: "vlink"}
|
2012-01-08 12:20:20 +01:00
|
|
|
|
2012-08-11 00:07:50 +02:00
|
|
|
= form_for [@project, @hook], as: :hook, url: project_hooks_path(@project) do |f|
|
2012-04-26 19:43:12 +02:00
|
|
|
-if @hook.errors.any?
|
|
|
|
.alert-message.block-message.error
|
|
|
|
- @hook.errors.full_messages.each do |msg|
|
|
|
|
%p= msg
|
|
|
|
.clearfix
|
|
|
|
= f.label :url, "URL:"
|
|
|
|
.input
|
2012-08-11 00:07:50 +02:00
|
|
|
= f.text_field :url, class: "text_field xxlarge"
|
2012-04-26 19:43:12 +02:00
|
|
|
|
2012-08-11 00:07:50 +02:00
|
|
|
= f.submit "Add Web Hook", class: "btn primary"
|
2012-04-26 19:43:12 +02:00
|
|
|
%hr
|
2012-03-28 09:46:51 +02:00
|
|
|
|
2012-03-05 23:29:40 +01:00
|
|
|
-if @hooks.any?
|
2012-04-26 19:43:12 +02:00
|
|
|
%h3
|
|
|
|
Hooks
|
|
|
|
%small (#{@hooks.count})
|
|
|
|
%br
|
|
|
|
%table.admin-table
|
|
|
|
%tr
|
|
|
|
%th URL
|
|
|
|
%th Method
|
2012-06-04 00:37:27 +02:00
|
|
|
%th
|
2012-03-05 23:29:40 +01:00
|
|
|
- @hooks.each do |hook|
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
= link_to project_hook_path(@project, hook) do
|
2012-04-26 19:43:12 +02:00
|
|
|
%strong= hook.url
|
2012-08-11 00:07:50 +02:00
|
|
|
= link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn small right"
|
2012-04-26 19:43:12 +02:00
|
|
|
%td POST
|
2012-03-05 23:29:40 +01:00
|
|
|
%td
|
2012-08-11 00:07:50 +02:00
|
|
|
= link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right"
|