index.html.haml 2.2 KB
Newer Older
1
%h3.page-title
2
  Web hooks
3 4

%p.light
5 6
  #{link_to "Web hooks ", help_web_hooks_path, class: "vlink"} can be
  used for binding events when something happends to the the project.
7 8

%hr.clearfix
9

D
Dmitriy Zaporozhets 已提交
10
= form_for [@project, @hook], as: :hook, url: project_hooks_path(@project), html: { class: 'form-horizontal' } do |f|
11
  -if @hook.errors.any?
D
Dmitriy Zaporozhets 已提交
12
    .alert.alert-danger
13 14
      - @hook.errors.full_messages.each do |msg|
        %p= msg
D
Dmitriy Zaporozhets 已提交
15
  .form-group
D
Dmitriy Zaporozhets 已提交
16
    = f.label :url, "URL", class: 'control-label'
D
Dmitriy Zaporozhets 已提交
17
    .col-sm-10
D
Dmitriy Zaporozhets 已提交
18
      = f.text_field :url, class: "form-control", placeholder: 'http://example.com/trigger-ci.json'
D
Dmitriy Zaporozhets 已提交
19
  .form-group
D
Dmitriy Zaporozhets 已提交
20
    = f.label :url, "Trigger", class: 'control-label'
D
Dmitriy Zaporozhets 已提交
21
    .col-sm-10
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
      %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
            This url will be triggered in case of push to repository
      %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
            This url will be triggered for created issues
      %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
            This url will be triggered for created merge requests
D
Dmitriy Zaporozhets 已提交
43 44
  .form-actions
    = f.submit "Add Web Hook", class: "btn btn-create"
45

46
-if @hooks.any?
47
  .ui-box
48
    .title
D
Dmitriy Zaporozhets 已提交
49
      Web hooks (#{@hooks.count})
50 51 52
    %ul.well-list
      - @hooks.each do |hook|
        %li
53
          .pull-right
D
Dmitriy Zaporozhets 已提交
54
            = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn btn-small grouped"
55
            = link_to 'Remove', project_hook_path(@project, hook), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove btn-small grouped"
56 57 58 59 60 61
          .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