mirror of
https://github.com/ryankazokas/turbovault-app.git
synced 2026-04-17 04:02:53 +00:00
51 lines
2.7 KiB
Plaintext
51 lines
2.7 KiB
Plaintext
<div class="max-w-4xl mx-auto">
|
|
<h1 class="text-3xl font-bold mb-6">Import Games from CSV</h1>
|
|
|
|
<div class="bg-white p-6 rounded-lg shadow mb-6">
|
|
<h2 class="text-xl font-bold mb-4">CSV Format</h2>
|
|
<p class="text-gray-600 mb-4">Your CSV file should have the following columns:</p>
|
|
|
|
<div class="bg-gray-100 p-4 rounded mb-4 overflow-x-auto">
|
|
<code class="text-sm">
|
|
title,platform,format,genres,completion_status,user_rating,condition,price_paid,location,digital_store,date_added,notes
|
|
</code>
|
|
</div>
|
|
|
|
<div class="space-y-2 text-sm text-gray-600">
|
|
<p><strong>Required fields:</strong> title, platform, format</p>
|
|
<p><strong>Platform:</strong> Use the full name or abbreviation (e.g., "Nintendo 64" or "N64")</p>
|
|
<p><strong>Format:</strong> Either "physical" or "digital"</p>
|
|
<p><strong>Genres:</strong> Separate multiple genres with | (e.g., "Action|Adventure")</p>
|
|
<p><strong>Completion Status:</strong> backlog, currently_playing, completed, on_hold, not_playing</p>
|
|
<p><strong>User Rating:</strong> Number from 1 to 5</p>
|
|
<p><strong>Condition (physical only):</strong> cib, loose, sealed, good, fair</p>
|
|
<p><strong>Date Added:</strong> YYYY-MM-DD format (defaults to today if not provided)</p>
|
|
</div>
|
|
|
|
<div class="mt-6">
|
|
<h3 class="font-bold mb-2">Example CSV:</h3>
|
|
<div class="bg-gray-100 p-4 rounded overflow-x-auto">
|
|
<pre class="text-xs">title,platform,format,genres,completion_status,user_rating,condition,price_paid,location,digital_store,date_added,notes
|
|
The Legend of Zelda: Ocarina of Time,N64,physical,Action|Adventure,completed,5,cib,45.00,Shelf A,,2024-01-15,One of the best games ever
|
|
Elden Ring,PS5,digital,Action|RPG,currently_playing,5,,,PlayStation Store,2024-03-01,Amazing open world</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="bg-white p-6 rounded-lg shadow">
|
|
<h2 class="text-xl font-bold mb-4">Upload CSV File</h2>
|
|
|
|
<%= form_with url: bulk_create_games_path, multipart: true, class: "space-y-4" do |f| %>
|
|
<div>
|
|
<%= f.label :csv_file, "Select CSV File", class: "block text-sm font-medium text-gray-700 mb-2" %>
|
|
<%= f.file_field :csv_file, accept: ".csv", required: true, class: "block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100" %>
|
|
</div>
|
|
|
|
<div class="flex space-x-4">
|
|
<%= f.submit "Import Games", class: "px-6 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700" %>
|
|
<%= link_to "Cancel", games_path, class: "px-6 py-2 bg-gray-200 text-gray-700 rounded-md hover:bg-gray-300" %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|