<div class="card shadow-sm">
  <div class="card-body">
    <%= errors_summary_for @acquired_media_release %>
    <%= bootstrap_form_with model: [@account, @project, @contract_template, @acquired_media_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(".acquired_media_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, wrapper_class: "col-12" %>
        </div>
        <%= form.form_group :categories, label: { text: "Licensed property type" } do %>
          <% AcquiredMediaRelease::CATEGORIES.each do |category| %>
            <%= form.check_box :categories, { multiple: true, label: category }, category, false %>
          <% end %>
        <% end %>
      <% end %>

      <hr>

      <%= card_field_set_tag t(".personal_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.text_field :person_title, wrapper_class: "col-sm-6" %>
          <%= form.phone_field :person_phone, wrapper_class: "col-sm-6", label: 'Phone' %>
          <%= form.email_field :person_email, wrapper_class: "col-sm-6", label: 'Email' %>
          <%= form.text_field :person_fax, wrapper_class: "col-sm-6", label: 'Fax' %>
        </div>
        <%= render "shared/address_fields", form: form, subject: "person" %>
      <% end %>

      <hr>

      <%= card_field_set_tag t(".files.heading") do %>
        <div class="alert alert-warning text-center text-md-left">
          <%= fa_icon "warning" %>
          <strong>For optimal accuracy, please ensure video file names and photo file names match the source file name in the editing sequence.</strong>
        </div>
        <%= render "shared/file_infos_dropzone", form: form, releasable: @acquired_media_release %>
      <% end %>

      <hr>

      <%= card_field_set_tag t(".signature.heading") do %>
        <%= render "shared/signature_fields", form: form %>
      <% 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>
