<div class="card shadow-sm">
  <div class="card-body">
    <%= errors_summary_for @material_release %>
    <%= bootstrap_form_with model: [@account, @project, @contract_template, @material_release], local: true, validation_context: :native do |form| %>
      <%= card_field_set_tag t(".legal.heading") do %>
        <p><%= @contract_template.body %></p>
        <% if @contract_template.fee? %>
          <p>
            Fee <span class="font-weight-bold text-success"><%= number_to_currency @contract_template.fee %></span>
          </p>
        <% end %>
      <% end %>

      <hr>

      <%= card_field_set_tag t(".release_info.heading") 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 %>

      <%= card_field_set_tag t(".contact_info.heading") 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 %>

      <%= card_field_set_tag t(".photo.heading") do %>
        <%= render "shared/photos_dropzone_fields", form: form, release: @material_release %>
      <% end %>

      <hr>

      <%= card_field_set_tag t(".signature.heading") do %>
        <%= render "shared/signature_fields", form: form, instruction: 'For Owner or Authorized Signatory' %>
      <% end %>

      <div class="mt-5">
        <%= form.button t("shared.submit_release_long"), class: "btn btn-block btn-lg btn-success", data: { disable_with: t("shared.disable_with") } %>
      </div>
    <% end %>
  </div>
</div>
