<%= error_messages_for @webhook %>

<%= f.text_field :url, required: true, size: 60 %> <%= l :webhook_url_info %>

<%= f.text_field :secret %> <%= raw l :webhook_secret_info_html %>

<%= f.check_box :active %>

<%= l :label_webhook_events %>

<% @webhook.setable_events.keys.sort.each do |type| %>
<%= toggle_checkboxes_link("##{type}_events\ input") %><%= l_or_humanize(type, prefix: 'webhook_events_') %> <% @webhook.setable_events[type].each do |action| %> <% name = "#{type}.#{action}" %> <% end %>
<% end %>
<%= check_all_links 'events' %> <%= hidden_field_tag 'webhook[events][]', '' %>
<%= toggle_checkboxes_link("#webhook_project_ids input[type=checkbox]") %><%= l(:label_project_plural) %> <% project_ids = @webhook.project_ids.to_a %> <%= render_project_nested_lists(@webhook.setable_projects) do |p| content_tag('label', check_box_tag('webhook[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + h(p)) end %> <%= hidden_field_tag('webhook[project_ids][]', '', :id => nil) %>