<div
  id="savePDFtoInventory"
  class="modal fade" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"><%= t('projects.reports.new.save_PDF_to_inventory') %></h4>
      </div>
      <div class="modal-body">
        <p><%= t('projects.reports.new.save_PDF_to_inventory_modal.description_one') %></p>
        <br />
        <p><%= t('projects.reports.new.save_PDF_to_inventory_modal.description_two') %></p>
        <span data-hook="save-pdf-to-inventory-modal-body"></span>
        <% if !@report.pdf_file.attached? %>
          <br />
          <p><em><%= t('projects.reports.new.save_PDF_to_inventory_modal.pdf_not_ready') %></em></p>
        <% elsif @available_repositories.present? %>
          <label><%= t('projects.reports.new.save_PDF_to_inventory_modal.inventory') %></label>
          <select
            id="selectInventory"
            class="form-control selectpicker"
            data-live-search="true"
            data-target-url="<%= reports_available_repositories_path %>">
          </select>
          <label><%= t('projects.reports.new.save_PDF_to_inventory_modal.inventory_column') %></label>
          <select
            id="selectInventoryColumn"
            class="form-control selectpicker"
            data-live-search="true"
            data-target-url="<%= available_asset_type_columns_path %>"
            disabled>
          </select>
          <div id="save-PDF-to-inventory-column-warnings"></div>
          <label><%= t('projects.reports.new.save_PDF_to_inventory_modal.inventory_item') %></label>
          <select
            id="selectInventoryItem"
            class="form-control selectpicker"
            data-live-search="true"
            data-target-url="<%= available_rows_repositories_path %>"
            disabled>
          </select>
        <% else %>
          <br />
          <p><em><%= t('projects.reports.new.save_PDF_to_inventory_modal.no_inventories') %></em></p>
        <% end %>
        <div class="save-PDF-to-inventory-alerts" id="save-PDF-to-inventory-warnings"></div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal"><%= t('general.cancel') %></button>
        <% if @report.pdf_file.attached? && @available_repositories.present? %>
          <button
            id="savePDFtoInventorySubmit"
            type="button"
            class="btn btn-primary"
            data-target-url="<%= save_pdf_to_inventory_item_report_path(@report) %>"
            disabled
            ><%= t('general.save') %></button>
        <% end %>
      </div>
    </div>
  </div>
</div>
