From 7fb0491b7954f59964b8f2153dce42855b50141f Mon Sep 17 00:00:00 2001 From: David Gay Date: Thu, 2 Nov 2023 18:30:34 -0400 Subject: Run view improvements, misc tweaks --- app/views/runs/index.html.erb | 3 ++- app/views/runs/show.html.erb | 46 ++++++++++++++++++++++++++++++++----------- app/views/users/show.html.erb | 2 +- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/app/views/runs/index.html.erb b/app/views/runs/index.html.erb index 9f01859..5e49429 100644 --- a/app/views/runs/index.html.erb +++ b/app/views/runs/index.html.erb @@ -15,7 +15,8 @@ diff --git a/app/views/runs/show.html.erb b/app/views/runs/show.html.erb index 24f551a..d7d65b6 100644 --- a/app/views/runs/show.html.erb +++ b/app/views/runs/show.html.erb @@ -1,20 +1,44 @@
-

<%= @run.title %>

-

<%= @run.game.title %>

- -

Run started by: <%= @run.user.name || "Unknown trainer" %>

+
+

<%= @run.title %>

+

<%= @run.game.title %>

+

Started by <%= link_to @run.user.name || "???", user_path(@run.user) %> + <%= time_ago_in_words(@run.created_at) %> ago.

+
+
+ This run is currently + <% if @run.checked_in? %> + checked in! You can progress this run <%= link_to "by creating a checkpoint", new_run_checkpoint_path(@run) %>. + <% else %> + checked out by <%= link_to @run.checked_out_user.name || "???", user_path(@run.checked_out_user) %>. + <% if @run.last_save_file.attached? %> + You can + <%= link_to "download the last save file", rails_blob_path(@run.last_save_file, disposition: "attachment") %> + to check it out, but you won't be able to check in any progress. + <% end %> + <% end %> +

Checkpoints

<%= link_to "New checkpoint", new_run_checkpoint_path(@run) %> - +
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index f0335eb..4df3273 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,7 +1,7 @@

TRAINER CARD - <%= @user.name || "Unknown" %> + <%= @user.name || "???" %>

ID No. <%= @user.id %>

-- cgit v1.2.3