87 lines
4.5 KiB
Plaintext
87 lines
4.5 KiB
Plaintext
<% content_for :title, "Dashboard Übersicht" %>
|
|
|
|
<div class="space-y-6">
|
|
|
|
<!-- KENNZAHLEN-GRID -->
|
|
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
|
|
|
<!-- Karte 1: Gesamtartikel -->
|
|
<div class="bg-white border border-gray-200 rounded-xl p-5 shadow-sm flex items-center gap-4">
|
|
<div class="p-3 bg-blue-50 text-blue-600 rounded-lg">
|
|
<!-- Heroicon: cube -->
|
|
<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="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>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-semibold uppercase text-gray-400">Objekte im System</p>
|
|
<h3 class="text-2xl font-bold text-gray-800"><%= @total_items %></h3>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Karte 2: Im Lager -->
|
|
<div class="bg-white border border-gray-200 rounded-xl p-5 shadow-sm flex items-center gap-4">
|
|
<div class="p-3 bg-amber-50 text-amber-600 rounded-lg">
|
|
<!-- Heroicon: archive-box -->
|
|
<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="M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z" /></svg>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-semibold uppercase text-gray-400">Aktuell im Lager</p>
|
|
<h3 class="text-2xl font-bold text-amber-600"><%= @items_in_storage %></h3>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Karte 3: Gesamtwert (Wird formatiert in Euro ausgegeben) -->
|
|
<div class="bg-white border border-gray-200 rounded-xl p-5 shadow-sm flex items-center gap-4">
|
|
<div class="p-3 bg-green-50 text-green-600 rounded-lg">
|
|
<!-- Heroicon: banknotes -->
|
|
<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 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75m0 .75h-.75m0 0v-.75m0 .75h.75m0 0V18m0-13.5h16.5M1.5 6h21M3.75 18v.75m0-.75h-.75m0 0v.75m0-.75h.75m0 0V6M10.5 9a2.25 2.25 0 114.5 0 2.25 2.25 0 01-4.5 0z" /></svg>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs font-semibold uppercase text-gray-400">Gesamtwert Inventar</p>
|
|
<h3 class="text-2xl font-bold text-gray-800">
|
|
<%= number_to_currency(@total_value, unit: "€", separator: ",", delimiter: ".", format: "%n %u") %>
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- NEUESTE SYSTEMZUGÄNGE -->
|
|
<div class="bg-white border border-gray-200 rounded-xl shadow-sm p-6">
|
|
<h2 class="text-base font-bold text-gray-800 mb-4 flex items-center gap-2">
|
|
<!-- Heroicon: clock -->
|
|
<svg class="h-5 w-5 text-gray-500" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
|
Zuletzt registrierte Artikel
|
|
</h2>
|
|
|
|
<% if @recent_items.any? %>
|
|
<div class="space-y-3">
|
|
<% @recent_items.each do |item| %>
|
|
<div class="flex items-start sm:items-center justify-between p-3 bg-gray-50 rounded-lg text-sm border border-gray-100 gap-4">
|
|
<div class="flex items-center gap-3 min-w-0">
|
|
<span class="p-1.5 bg-blue-100 text-blue-700 rounded-md font-mono text-[10px] font-bold">#<%= item.sticker_id %></span>
|
|
<div class="min-w-0">
|
|
<p class="font-semibold text-gray-800 truncate"><%= item.name %></p>
|
|
<p class="text-xs text-gray-500">
|
|
<% if item.user.present? %>
|
|
Zugewiesen an: 👤 <%= item.user.name %>
|
|
<% elsif item.room.present? %>
|
|
Standort: 📍 <%= item.room.name_with_building %>
|
|
<% else %>
|
|
📦 Im Hauptlager
|
|
<% end %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="text-xs text-gray-400 text-right shrink-0">
|
|
<%= time_ago_in_words(item.created_at) %> vor
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% else %>
|
|
<div class="text-center py-6 text-gray-400 text-sm">
|
|
Bisher wurden keine Artikel im System erfasst.
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|