From c052b0a35a5ec167e2d9353b882a38a37a8f662e Mon Sep 17 00:00:00 2001 From: Jasper Mayone Date: Sun, 4 Aug 2024 11:30:18 -0400 Subject: [PATCH] more bugz --- .ruby-version | 2 +- Gemfile.lock | 2 +- app/controllers/loaners_controller.rb | 8 ++++---- app/controllers/loans_controller.rb | 2 +- app/models/loaner.rb | 1 + app/views/main/overview.html.erb | 8 +++++++- 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.ruby-version b/.ruby-version index 944880f..351227f 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.0 +3.2.4 diff --git a/Gemfile.lock b/Gemfile.lock index d37fa86..c3f9c87 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -666,7 +666,7 @@ DEPENDENCIES web-console RUBY VERSION - ruby 3.2.0p0 + ruby 3.2.4p170 BUNDLED WITH 2.5.9 diff --git a/app/controllers/loaners_controller.rb b/app/controllers/loaners_controller.rb index f5d6d3b..1e500b4 100644 --- a/app/controllers/loaners_controller.rb +++ b/app/controllers/loaners_controller.rb @@ -51,7 +51,7 @@ def return StatsD.increment("loaner_return_attempt") StatsD.measure('loaner.return_action') do if @loaner.present? - @loaner.mark_as_returned + @loaner.return! StatsD.increment("loaner_returned") redirect_to loaners_path, notice: "Asset checked in successfully." else @@ -65,7 +65,7 @@ def enable StatsD.increment("loaner_enable_attempt") StatsD.measure('loaner.enable_action') do if @loaner.present? - @loaner.mark_as_enabled + @loaner.enable! StatsD.increment("loaner_enabled") redirect_to loaners_path, notice: "Asset marked as enabled successfully." else @@ -93,7 +93,7 @@ def broken StatsD.increment("loaner_broken_attempt") StatsD.measure('loaner.broken_action') do if @loaner.present? - @loaner.mark_as_broken + @loaner.broken! StatsD.increment("loaner_broken") redirect_to loaners_path, notice: "Asset marked as broken successfully." else @@ -107,7 +107,7 @@ def repair StatsD.increment("loaner_repair_attempt") StatsD.measure('loaner.repair_action') do if @loaner.present? - @loaner.mark_as_repaired + @loaner.repair! StatsD.increment("loaner_repaired") redirect_to loaners_path, notice: "Asset marked as repaired successfully." else diff --git a/app/controllers/loans_controller.rb b/app/controllers/loans_controller.rb index f109bfa..af89581 100644 --- a/app/controllers/loans_controller.rb +++ b/app/controllers/loans_controller.rb @@ -146,7 +146,7 @@ def extend flash[:alert] = 'Loan not found.' end - redirect_to loans_list_out_path + redirect_to overview_path end def repair diff --git a/app/models/loaner.rb b/app/models/loaner.rb index 88ef609..4f817b4 100644 --- a/app/models/loaner.rb +++ b/app/models/loaner.rb @@ -75,6 +75,7 @@ def chrome_enable state :loaned, display: "Loaned" state :disabled, display: "Disabled" state :maintenance, display: "Maintenance" + state :decommissioned, display: "Decommissioned" after_all_transitions :log_status_change diff --git a/app/views/main/overview.html.erb b/app/views/main/overview.html.erb index 919daa3..bd925f4 100644 --- a/app/views/main/overview.html.erb +++ b/app/views/main/overview.html.erb @@ -86,7 +86,7 @@ <%= link_to loaner.freindly_id, loaner_path(loaner) %> - <%= loaner.asset_tag %> + <%= link_to loaner.asset_tag, loaner_path(loaner), class: "lnk" %> <%= link_to loan.borrower.email, borrower_path(loan.borrower) %> <%= loan.loaned_at.strftime("%A, %B %e at %l:%M %p") %> <%= loan.reason.humanize %> @@ -150,5 +150,11 @@ margin-right: 10px; margin-left: 10px; } + + .lnk { + color: #000; + font-style: italic; + text-decoration: underline; + }