<% content_for :javascripts, javascript_include_tag('provider/admin/webhooks') %>

<h2>Webhooks</h2>

<p class="help">Web hooks let you define a URL to be called with a notification when events in the 3scale management system happen.</p>

<%= semantic_form_for @webhook, :url => provider_admin_webhooks_path do |f| -%>
  <%= render 'form', :form => f %>

  <div class='button-bar'>
    <%= f.buttons :style => 'position:absolute' do %>
    <% end %>

   <%= f.buttons :style => 'position:absolute' do %>
     <% if @webhook.url %>
       <%= f.button 'Ping!', :button_html => { :class => 'less-important-button',
                                               :type => 'button',
                                               :value => 'ping',
                                               'data-ping-url' => provider_admin_webhooks_path(:format => :js) } %>
     <% end %>
     <%= f.commit_button :label => 'Save'  %>
   <% end %>
  </div>
<% end %>
