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,
|
2018-08-29 16:42:00 +02:00
|
|
|
input_html: { autocapitalize: :none, autocorrect: :off, data: { kind: check.kind } },
|
|
|
|
label: t(".#{check.kind || "generic" }.domain"),
|
|
|
|
hint: t(".#{check.kind || "generic" }.unsupported"),
|
|
|
|
hint_html: {
|
|
|
|
id: "check_domain_unsupported_container",
|
|
|
|
class: "#{check.supported? && 'd-none'}",
|
|
|
|
}
|
|
|
|
%>
|
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 %>
|
|
|
|
|
2018-08-29 16:42:00 +02:00
|
|
|
<div id="check_domain_expires_at_container" class="<%= check.supported? ? "d-none" : "d-block" %>">
|
|
|
|
<%= f.input :domain_expires_at,
|
|
|
|
required: true,
|
|
|
|
input_html: {
|
2018-08-29 17:17:58 +02:00
|
|
|
type: :date,
|
2018-08-29 16:42:00 +02:00
|
|
|
value: check.domain_expires_at&.to_date,
|
2018-08-29 17:17:58 +02:00
|
|
|
min: Date.yesterday,
|
|
|
|
max: 10.years.from_now.end_of_year.to_date
|
2018-08-29 16:42:00 +02:00
|
|
|
},
|
|
|
|
as: :string,
|
2018-08-29 17:17:58 +02:00
|
|
|
placeholder: t(".domain_expires_at_placeholder")
|
2018-08-29 16:42:00 +02:00
|
|
|
%>
|
|
|
|
</div>
|
|
|
|
|
2018-05-29 13:11:22 +02:00
|
|
|
<%= f.input :comment %>
|
|
|
|
<%= f.input :vendor %>
|
|
|
|
|
2018-07-25 11:57:07 +02:00
|
|
|
<% if check.ssl? %>
|
|
|
|
<%= f.input :round_robin %>
|
|
|
|
<% end %>
|
2018-08-30 17:53:06 +02:00
|
|
|
|
2018-05-29 13:11:22 +02:00
|
|
|
<% 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 %>
|