Files
Redmine/app/views/webhooks/_form.html.erb
Marius Balteanu d90d192f48 Introduces issue webhooks (#29664):
* users can set up hooks for issue creation, update and deletion events, for any number of projects
* hooks run in the context of the creating user, and only if the object in question is visible to that user
* the actual HTTP call is done in ActiveJob
* webhook calls are optionally signed the same way GitHub does

Patch by Jens Krämer (user:jkraemer).



git-svn-id: https://svn.redmine.org/redmine/trunk@24034 e93f8b46-1217-0410-a6f0-8f06a7374b81
2025-10-07 06:49:14 +00:00

45 lines
1.8 KiB
Plaintext

<%= error_messages_for @webhook %>
<div class="splitcontent">
<div class="splitcontentleft">
<div class="box tabular">
<p><%= f.text_field :url, required: true, size: 60 %>
<em class="info"><%= l :webhook_url_info %></em>
</p>
<p>
<%= f.text_field :secret %>
<em class="info"><%= raw l :webhook_secret_info_html %></em>
</p>
<p><%= f.check_box :active %></p>
</div>
<h3><%= l :label_webhook_events %></h3>
<div class="box tabular" id="events">
<% @webhook.setable_events.keys.sort.each do |type| %>
<fieldset id="<%= type %>_events"><legend><%= toggle_checkboxes_link("##{type}_events\ input") %><%= l_or_humanize(type, prefix: 'webhook_events_') %></legend>
<% @webhook.setable_events[type].each do |action| %>
<% name = "#{type}.#{action}" %>
<label class="floating">
<%= check_box_tag 'webhook[events][]', name, @webhook.events.include?(name), id: "webhook_events_#{name}" %>
<%= l_or_humanize(name.tr('.', '_'), :prefix => 'webhook_events_') %>
</label>
<% end %>
</fieldset>
<% end %>
<br /><%= check_all_links 'events' %>
<%= hidden_field_tag 'webhook[events][]', '' %>
</div>
</div>
<div class="splitcontentright">
<fieldset class="box" id="webhook_project_ids"><legend><%= toggle_checkboxes_link("#webhook_project_ids input[type=checkbox]") %><%= l(:label_project_plural) %></legend>
<% 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) %>
</fieldset>
</div>
</div>