<% # Copyright (C) 2018 Colin Darie , 2018 Evolix %> <% # License: GNU AGPL-3+ (see full text in LICENSE file) %> <%= simple_form_for(check) do |f| %> <%= f.input :domain, autofocus: true, 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'}", } %> <% if check.new_record? %> <%= f.input :kind, as: check.kind.present? ? :hidden : :radio_buttons, collection: Check.kinds.keys %> <% end %>
"> <%= f.input :domain_expires_at, required: true, input_html: { type: :date, value: check.domain_expires_at&.to_date, min: Date.yesterday, max: 10.years.from_now.end_of_year.to_date }, as: :string, placeholder: t(".domain_expires_at_placeholder") %>
<%= f.input :comment %> <%= f.input :vendor %> <% if check.ssl? %> <%= f.input :round_robin %> <% end %> <% if check.persisted? %> <%= f.input :active %> <% end %>

<%= t(".notifications_hint") %>

<%= f.association :notifications, as: :check_boxes, collection: policy_scope(Notification), label_method: :notifical_label, label_text: false %> <%= f.fields_for :notifications, new_notification do |nf| %> <%= render "notifications/nested_form_headers", f: nf %> <%= render "notifications/nested_form", f: nf, notification: new_notification %> <% end %> <%= f.button :submit, class: "btn-primary mt-5" %> <% end %>