diff options
author | David Gay <david@davidgay.org> | 2023-11-02 18:30:34 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2023-11-02 18:30:34 -0400 |
commit | 7fb0491b7954f59964b8f2153dce42855b50141f (patch) | |
tree | 54467c093f9b6d65d6f90f530f7852428b1f606c /app/views/runs/show.html.erb | |
parent | f353175922bf855f732ee0fb8e976167d001a92b (diff) |
Run view improvements, misc tweaks
Diffstat (limited to 'app/views/runs/show.html.erb')
-rw-r--r-- | app/views/runs/show.html.erb | 46 |
1 files changed, 35 insertions, 11 deletions
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 @@ <div class="space-y-4"> - <h1 class="text-2xl"><%= @run.title %></h1> - <p class="subtitle"><%= @run.game.title %></p> - - <p>Run started by: <%= @run.user.name || "Unknown trainer" %></p> + <div class="space-y-2"> + <h1 class="text-2xl"><%= @run.title %></h1> + <p class="subtitle"><%= @run.game.title %></p> + <p>Started by <%= link_to @run.user.name || "???", user_path(@run.user) %> + <%= time_ago_in_words(@run.created_at) %> ago.</p> + </div> + <div class="font-bold"> + 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 %> + </div> <h2 class="text-xl">Checkpoints</h2> <%= link_to "New checkpoint", new_run_checkpoint_path(@run) %> - <ul class="list-disc"> + <div class="border-l border-orange-900 p-2"> <% @run.checkpoints.each do |checkpoint| %> - <li><%= checkpoint.created_at %> - <% if checkpoint.save_file.attached? %> - <%= link_to "[save file]", rails_blob_path(checkpoint.save_file, disposition: "attachment") %> - <% end %> - </li> + <div class="flex flex-col"> + <div> + <%= time_ago_in_words(checkpoint.created_at) %> ago by + <%= link_to checkpoint.user.name || "???", user_path(checkpoint.user) %> + </div> + <div class="text-sm"> + <span><%= checkpoint.created_at %></span> + <% if checkpoint.save_file.attached? %> + <%= link_to "Download save file", rails_blob_path(checkpoint.save_file, disposition: "attachment") %> + <% else %> + <span>(No save file attached.)</span> + <% end %> + </div> + </div> <% end %> - </ul> + </div> </div> |