<div class="card shadow-sm">
  <div class="card-body">
    <%= errors_summary_for @location_release %>
    <%= bootstrap_form_with model: [@account, @project, @contract_template, @location_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(".location_info.heading") do %>
        <div class="form-row">
          <%= form.text_field :name, required: true, wrapper_class: "col-12" %>
        </div>
        <%= render "shared/address_fields", form: form, required: true, subject: "" %>
      <% end %>

      <hr>

      <%= card_field_set_tag t(".contact_info.heading") do %>
        <div class="form-row">
          <%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-6" %>
          <%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-6" %>
          <%= form.phone_field :person_phone, required: true, wrapper_class: "col-sm-6" %>
          <%= form.email_field :person_email, required: true, wrapper_class: "col-sm-6" %>
          <%= form.text_field :person_company, required: true, wrapper_class: "col-sm-6" %>
          <%= form.text_field :person_title, required: true, wrapper_class: "col-sm-6" %>
        </div>
        <%= render "shared/address_fields", form: form, required: true, subject: "person" %>
      <% end %>

      <hr>


      <%= card_field_set_tag t(".filming_info.heading") do %>
        <div class="form-row">
          <%= form.text_field :filming_started_on, required: true, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
          <%= form.text_field :filming_ended_on, required: true, wrapper_class: "col-sm-6", class: "datepicker-control", readonly: true %>
          <%= form.text_field :filming_hours, required: true, wrapper_class: "col-sm-12" %>
        </div>
      <% end %>

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

      <%= card_field_set_tag t(".signature.heading") do %>
        <%= render "shared/signature_fields", form: form, instruction: 'An Authorized Signatory', signature_legal_text: @contract_template.signature_legal_text %>
      <% 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>
