<% content_for :title, 'Imports' %>

Imports

<%= link_to "New import", new_import_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %> <% if current_user.safe_settings.immich_url && current_user.safe_settings.immich_api_key %> <%= link_to 'Import Immich data', settings_background_jobs_path(job_name: 'start_immich_import'), method: :post, data: { turbo_confirm: 'Are you sure?', turbo_method: :post }, class: 'rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium' %> <% else %> Import Immich data <% end %> <% if current_user.safe_settings.photoprism_url && current_user.safe_settings.photoprism_api_key %> <%= link_to 'Import Photoprism data', settings_background_jobs_path(job_name: 'start_photoprism_import'), method: :post, data: { turbo_confirm: 'Are you sure?', turbo_method: :post }, class: 'rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium' %> <% else %> Import Photoprism data <% end %>
<% if @imports.empty? %>

Hello there!

Here you'll find your imports, but now there are none. Let's <%= link_to 'create one', new_import_path, class: 'link' %>!

<% else %>
<%= paginate @imports %>
<% @imports.each do |import| %> <% end %>
Name File size Imported points Status Created at Actions
<%= link_to import.name, import, class: 'underline hover:no-underline' %> (<%= import.source %>)   <%= link_to 'πŸ—ΊοΈ', map_path(import_id: import.id) %>   <%= link_to 'πŸ“‹', points_path(import_id: import.id) %> <%= number_to_human_size(import.file&.byte_size) || 'N/A' %> <%= number_with_delimiter import.processed %> <%= import.status %> <%= human_datetime(import.created_at) %> <% if import.deleting? %> Deleting... <% else %> <% if import.file.present? %> <%= link_to 'Download', rails_blob_path(import.file, disposition: 'attachment'), class: "btn btn-outline btn-sm btn-info", download: import.name %> <% end %> <%= link_to 'Delete', import, data: { turbo_confirm: "Are you sure?", turbo_method: :delete }, method: :delete, class: "btn btn-outline btn-sm btn-error" %> <% end %>
<%= paginate @imports %>
<% end %>