45 lines
2.7 KiB
Plaintext
45 lines
2.7 KiB
Plaintext
<!-- Ersetze den alten Button im Top-Bar-Yield durch diesen echten Link -->
|
|
|
|
<% content_for :title, "Kategorien" %>
|
|
|
|
<div class="space-y-6">
|
|
<!-- Header-Aktionen (Nutzt das Yield aus deinem Layout) -->
|
|
<% content_for :top_bar_actions do %>
|
|
<%= link_to new_category_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>
|
|
Kategorie erstellen
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<!-- Das Kachel-Grid -->
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
<% @categories.each do |category| %>
|
|
<div class="bg-white border border-gray-200 rounded-xl p-6 shadow-sm hover:shadow-md transition flex flex-col justify-between">
|
|
<div>
|
|
<div class="flex items-center justify-between mb-4">
|
|
<div class="p-2.5 bg-blue-50 text-blue-600 rounded-lg">
|
|
<!-- Heroicon: folder -->
|
|
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-19.5 0A2.25 2.25 0 0 0 2.25 15v2.25m0-4.5A2.25 2.25 0 0 1 4.5 12h15a2.25 2.25 0 0 1 2.25 2.25m-19.5 0v4.5A2.25 2.25 0 0 0 4.5 21h15a2.25 2.25 0 0 0 2.25-2.25V15M2.25 12V6a2.25 2.25 0 0 1 2.25-2.25h2.25c.59 0 1.157.234 1.576.652L9.75 5.85a2.25 2.25 0 0 0 1.576.652h6.924a2.25 2.25 0 0 1 2.25 2.25v3.25" /></svg>
|
|
</div>
|
|
<!-- Dynamische Anzahl der Objekte im System -->
|
|
<span class="inline-flex items-center py-1 px-2.5 rounded-full text-xs font-semibold bg-gray-100 text-gray-800 border border-gray-200">
|
|
<%= category.items.count %> <%= category.items.count == 1 ? "Objekt" : "Objekte" %>
|
|
</span>
|
|
</div>
|
|
<h3 class="text-base font-bold text-gray-800"><%= category.name %></h3>
|
|
<p class="text-xs text-gray-500 mt-2 leading-relaxed"><%= category.description.presence || "Keine Beschreibung hinterlegt." %></p>
|
|
</div>
|
|
|
|
<div class="mt-6 pt-4 border-t border-gray-100 flex justify-end gap-3 text-xs font-semibold">
|
|
|
|
<%= link_to "Bearbeiten", edit_category_path(category), class: "text-gray-500 hover:text-gray-700 transition" %>
|
|
|
|
<%= link_to category_path(category), class: "text-blue-600 hover:text-blue-800 flex items-center gap-0.5 transition" do %>
|
|
Artikel ansehen →
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|