<%= errors_summary_for material_release %>
<%= bootstrap_form_with model: model, local: true do |form| %>
  <%= field_set_tag content_tag(:span, t(".material_details.heading"), class: "h6 text-muted text-uppercase") do %>
    <div class="form-row">
      <%= form.text_field :name, required: true, wrapper_class: "col-12" %>
    </div>
    <div class="form-row">
      <%= form.text_area :description, placeholder: true, wrapper_class: "col-sm-12", rows: 6 %>
    </div>
  <% end %>

  <hr>

  <%= field_set_tag content_tag(:span, t(".signer_details.heading"), class: "h6 text-muted text-uppercase") do %>
    <div class="form-row">
      <%= form.text_field :person_first_name, wrapper_class: "col-sm-6" %>
      <%= form.text_field :person_last_name, wrapper_class: "col-sm-6" %>
      <%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
      <%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
      <%= form.text_field :person_company, wrapper_class: "col-sm-6" %>
      <%= form.text_field :person_title, wrapper_class: "col-sm-6" %>
    </div>
    <%= render "shared/address_fields", form: form, subject: "person" %>
  <% end %>

  <hr>

  <%= field_set_tag content_tag(:span, t(".contract_and_rights.heading"), class: "h6 text-muted text-uppercase") do %>
    <%= render "shared/contract_fields", form: form, release: material_release %>
    <%= render "shared/exploitable_rights_fields", form: form %>
  <% end %>

  <hr>

  <%= field_set_tag content_tag(:span, t(".photos.heading"), class: "h6 text-muted text-uppercase") do %>
    <%= render "shared/photos_dropzone_fields", form: form, release: material_release %>
  <% end %>

  <div class="row align-items-center text-center mt-4">
    <%= link_to t("shared.cancel"), [material_release.project, :material_releases], class: "col-3 text-reset" %>
    <div class="col-9">
      <%= form.button id: "submit_release", class: class_string("btn btn-block", ["btn-success", "btn-primary"] => material_release.new_record?), data: { disable_with: t("shared.disable_with") } %>
    </div>
  </div>
<% end %>
