summaryrefslogtreecommitdiff
path: root/app/views/hooks/index.html.haml
blob: d81cce763d6a61543ead557d77d563d425326d78 (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
= 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) 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
    Hooks
    %small (#{@hooks.count})
  %br
  %table.admin-table
    %tr
      %th URL
      %th Method
      %th 
    - @hooks.each do |hook|
      %tr
        %td
          = link_to project_hook_path(@project, hook) do
            %strong= hook.url
          = link_to 'Test Hook', test_project_hook_path(@project, hook), :class => "btn small right"
        %td POST
        %td
          = link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right"