2018-08-02 00:09:29 +02:00
|
|
|
<% # Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr> %>
|
|
|
|
<% # License: GNU AGPL-3+ (see full text in LICENSE file) %>
|
2018-05-29 13:11:22 +02:00
|
|
|
<%= simple_form_for(check) do |f| %>
|
2018-07-03 17:38:06 +02:00
|
|
|
<%= f.input :domain,
|
|
|
|
autofocus: true,
|
|
|
|
input_html: { autocapitalize: :none, autocorrect: :off },
|
|
|
|
label: t(".#{check.kind || "generic" }.domain") %>
|
2018-05-29 13:11:22 +02:00
|
|
|
|
|
|
|
<% if check.new_record? %>
|
2018-07-03 17:38:06 +02:00
|
|
|
<%= f.input :kind, as: check.kind.present? ? :hidden : :radio_buttons, collection: Check.kinds.keys %>
|
2018-05-29 13:11:22 +02:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= f.input :comment %>
|
|
|
|
<%= f.input :vendor %>
|
|
|
|
|
|
|
|
<% if check.persisted? %>
|
|
|
|
<%= f.input :active %>
|
|
|
|
<% end %>
|
|
|
|
|
2018-06-04 20:39:53 +02:00
|
|
|
<h2 class="mt-5"><%= t(".notifications") %></h2>
|
|
|
|
<p class="alert alert-light"><%= t(".notifications_hint") %></p>
|
|
|
|
|
|
|
|
<%- check.notifications.each_with_index do |notification, index| %>
|
|
|
|
<div data-notification-id="<%= notification.id %>">
|
|
|
|
<%= f.fields_for :notifications, notification do |nf| %>
|
|
|
|
<%= render "notifications/nested_form_headers", f: nf if index.zero? %>
|
|
|
|
<%= render "notifications/nested_form", f: nf, check: check %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
<%= f.button :submit, class: "btn-primary mt-5" %>
|
2018-05-29 13:11:22 +02:00
|
|
|
<% end %>
|