Added Search function for items and fixed javascript controller
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled

This commit is contained in:
2026-05-25 04:23:08 +02:00
parent 650b83bdf4
commit 204a6c05dc
9 changed files with 178 additions and 121 deletions

View File

@@ -8,28 +8,25 @@
<% end %>
<div class="w-full space-y-6">
<!-- Beschreibungskarte -->
<!-- Beschreibungskarte der Kategorie -->
<div class="bg-white border border-gray-200 rounded-xl p-6 shadow-sm">
<h2 class="text-sm font-bold text-gray-400 uppercase tracking-wider">Beschreibung</h2>
<p class="text-sm text-gray-600 mt-1 leading-relaxed"><%= @category.description.presence || "Keine Beschreibung hinterlegt." %></p>
</div>
<div>
<!-- 1. Gleiche Suchleiste laden (CSV-Export bleibt hier deaktiviert!) -->
<!-- 1. Suchleiste steht außerhalb des Frames (CSV-Export hier auf 'false') -->
<%= render "items/search_bar", show_csv: false %>
<!-- 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>
<!-- 2. NUR DAS LIST-PARTIAL WIRD IN DEN FRAME GEPAKT -->
<%= turbo_frame_tag "items_list_frame" do %>
<% if @items.any? %>
<%= render "items/list", items: @items %>
<% else %>
<div class="text-center py-12 text-gray-400 bg-white border border-gray-200 rounded-xl shadow-sm">
<p class="text-sm">Keine passenden Artikel in dieser Kategorie gefunden.</p>
</div>
<% end %>
<% end %>
</div>
</div>