61 lines
2.9 KiB
Plaintext
61 lines
2.9 KiB
Plaintext
<!-- <%# content_for :title, "Items" %>
|
|
|
|
<div class="w-full">
|
|
<% if notice.present? %>
|
|
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-md inline-block" id="notice"><%= notice %></p>
|
|
<% end %>
|
|
|
|
<div class="flex justify-between items-center">
|
|
<h1 class="font-bold text-4xl">Items</h1>
|
|
<%= link_to "New item", new_item_path, class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white block font-medium" %>
|
|
</div>
|
|
|
|
<div id="items" class="min-w-full divide-y divide-gray-200 space-y-5">
|
|
<% if @items.any? %>
|
|
<% @items.each do |item| %>
|
|
<div class="flex flex-col sm:flex-row justify-between items-center pb-5 sm:pb-0">
|
|
<%#= render item %>
|
|
<div class="w-full sm:w-auto flex flex-col sm:flex-row space-x-2 space-y-2">
|
|
<%= link_to "Show", item, class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
|
<%= link_to "Edit", edit_item_path(item), class: "w-full sm:w-auto text-center rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
|
|
<%= button_to "Destroy", item, method: :delete, class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% else %>
|
|
<p class="text-center my-10">No items found.</p>
|
|
<% end %>
|
|
</div>
|
|
</div>-->
|
|
|
|
<% content_for :title, "Gesamtbestand" %>
|
|
|
|
<% content_for :top_bar_actions do %>
|
|
<%= link_to new_item_path, class: "py-2 px-4 text-sm font-semibold rounded-lg bg-blue-600 text-white hover:bg-blue-700 flex items-center gap-1.5 shadow-sm transition" do %>
|
|
<svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" /></svg>
|
|
Artikel hinzufügen
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<div class="w-full space-y-4">
|
|
<!-- 1. Suchleiste laden (mit aktiviertem CSV-Export) -->
|
|
<%= render "items/search_bar", show_csv: true %>
|
|
|
|
<!-- 2. Artikelliste laden -->
|
|
<% if @items.any? %>
|
|
<%= render "items/list", items: @items %>
|
|
<% else %>
|
|
<div class="text-center py-16 text-gray-400 bg-white border border-gray-200 rounded-xl shadow-sm">
|
|
<svg class="mx-auto h-12 w-12 text-gray-300" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l5.25 3.03M12 12.75v9" />
|
|
</svg>
|
|
<p class="text-sm mt-3 font-medium">Bisher sind keine Inventargegenstände erfasst.</p>
|
|
<p class="text-xs text-gray-400 mt-1">Klicke oben rechts auf "Artikel hinzufügen", um das erste Gerät einzubuchen.</p>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|