Storage Locations

Manage your physical storage locations and QR codes

<.link navigate={~p"/"} class="bg-gray-600 text-white px-4 py-2 rounded-lg hover:bg-gray-700 flex items-center gap-2" > Components

<%= if @edit_location, do: "Edit Storage Location", else: "New Storage Location" %>

<.form for={@form} phx-submit="save" phx-change="validate" class="space-y-4">
<.input field={@form[:name]} type="text" placeholder="Enter location name" required />
<.input field={@form[:description]} type="textarea" placeholder="Optional description" />
<.input field={@form[:parent_id]} type="select" options={[{"None (Root Level)", ""} | parent_options(@edit_location)]} />

QR Code Scanner

Camera QR scanner would go here

In a real implementation, this would use JavaScript QR scanning

Test with sample codes:

0} class="bg-green-50 border border-green-200 rounded-lg p-4">

Recently Scanned

<%= scan.location.path %> (<%= scan.code %>)
Level <%= scan.location.level %>

Storage Locations

Location Level QR Code Description Actions
<%= location.path %>
DEBUG - ID: <%= location.id %>, Parent: <%= inspect(location.parent_id) %>, Level: <%= location.level %>
<%= format_level(location.level) %> <%= location.qr_code %>
<%= location.description %>
<.link patch={~p"/storage_locations/#{location.id}/edit"} class="text-indigo-600 hover:text-indigo-900" > Edit

No storage locations yet. Create one to get started!

QR Code Examples

Here are some sample QR codes generated for your existing storage locations:

<%= location.path %>
<%= ComponentsElixir.QRCode.generate_qr_data(location) %>