43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
= render "projects/project_head"
|
|
|
|
- if can? current_user, :admin_project, @project
|
|
.alert.alert-info
|
|
%span
|
|
Post receive hooks for binding events when someone push to repository.
|
|
%br
|
|
Read more about web hooks
|
|
%strong #{link_to "here", help_web_hooks_path, class: "vlink"}
|
|
|
|
= form_for [@project, @hook], as: :hook, url: project_hooks_path(@project), html: { class: 'form-inline' } do |f|
|
|
-if @hook.errors.any?
|
|
.alert-message.block-message.error
|
|
- @hook.errors.full_messages.each do |msg|
|
|
%p= msg
|
|
.clearfix
|
|
= f.label :url, "URL:"
|
|
.input
|
|
= f.text_field :url, class: "text_field xxlarge"
|
|
|
|
= f.submit "Add Web Hook", class: "btn primary"
|
|
%hr
|
|
|
|
-if @hooks.any?
|
|
%h3.page_title
|
|
Hooks (#{@hooks.count})
|
|
%br
|
|
%table
|
|
%thead
|
|
%tr
|
|
%th URL
|
|
%th
|
|
- @hooks.each do |hook|
|
|
%tr
|
|
%td
|
|
%span.badge.badge-info POST
|
|
= link_to project_hook_path(@project, hook) do
|
|
%strong= hook.url
|
|
%td
|
|
.right
|
|
= link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn small grouped"
|
|
= link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small grouped"
|