From 59c462506dd11c1523401b57bb0c5d5b6558c3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=B6hm?= Date: Sun, 31 May 2026 01:09:53 +0200 Subject: [PATCH] Fixed dashboard#index mobile view --- app/views/dashboard/index.html.erb | 88 +++++++----------------------- app/views/items/show.html.erb | 2 +- app/views/layouts/_badge.html.erb | 44 ++++++++++----- 3 files changed, 51 insertions(+), 83 deletions(-) diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index 0341a98..f5e46f4 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -65,7 +65,6 @@
-
@@ -73,54 +72,32 @@

Zuletzt hinzugefügt

-
- <% @recent_items.each.each do |item| %> + <% @recent_items.each do |item| %> - @@ -149,44 +126,19 @@
<%= link_to item_path(item), class: "shrink-0 transition hover:scale-105 active:scale-95 block" do %> - - #<%= item.sticker_id %> - + <%= render "layouts/badge", type: :sticker, label: "##{item.sticker_id}" %> <% end %>
- <%= link_to item_path(item), class: "font-bold text-gray-900 hover:text-blue-600 hover:underline inline leading-tight" do %> - <%= item.name %> + <% if item.present? %> + <%= link_to item_path(item), class: "font-bold text-gray-900 hover:text-blue-600 hover:underline inline leading-tight" do %> + <%= item.name %> + <%= item.category.name %> + <% end %> + <% else %> + Gelöschter Artikel <% end %> - <%= item.category.name %> +
+ <%= render "layouts/badge", type: item.location_badge_type, label: item.location_badge_label(short_room: true) %> +
- <% if item.user.present? %> - - - - - <%= item.user.name %> - - <% elsif item.room.present? %> - <%= link_to room_path item.room do %> - - - - - <%= item.room.name %> - - <% end %> - <% else %> - - - - - Hauptlager - - <% end %> - <%= time_ago_in_words(item.created_at) %>
<%= link_to item_path(log.item), class: "shrink-0 transition hover:scale-105 active:scale-95 block" do %> - - #<%= log.item.sticker_id %> - + <%= render "layouts/badge", type: :sticker, label: "##{log.item.sticker_id}" %> <% end %> -
- <% if log.item.present? %> - <%= link_to item_path(log.item), class: "font-bold text-gray-900 hover:text-blue-600 hover:underline inline leading-tight" do %> - <%= log.item.name %> - <% end %> +
+ <% if log.item.present? %> + <%= link_to item_path(log.item), class: "font-bold text-gray-900 hover:text-blue-600 hover:underline inline leading-tight" do %> + <%= log.item.name %> + <%= log.item.category.name %> + <% end %> <% else %> Gelöschter Artikel <% end %> -
- <% if log.user.present? %> - - - - - <%= log.user.name %> zugewiesen - - <% elsif log.room.present? %> - <%= link_to room_path log.room do %> - - - - - In <%= log.room.name %> platziert - - <% end %> - <% else %> - - - - - Hauptlager zurückgebracht - - <% end %> + <%= render "layouts/badge", type: log.item.location_badge_type, label: log.item.location_badge_label(short_room: true) %>
diff --git a/app/views/items/show.html.erb b/app/views/items/show.html.erb index cc0675d..a12a710 100644 --- a/app/views/items/show.html.erb +++ b/app/views/items/show.html.erb @@ -3,7 +3,7 @@ <% content_for :top_bar_actions do %>
- <%= link_to items_path, class: "py-2 px-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 flex items-center gap-1.5 shadow-sm transition" do %> + <%= link_to "javascript:history.back()", class: "py-2 px-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 flex items-center gap-1.5 shadow-sm transition" do %>