summaryrefslogtreecommitdiff
path: root/app/views/runs/show.html.erb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2023-11-02 19:05:13 -0400
committerDavid Gay <david@davidgay.org>2023-11-02 19:05:13 -0400
commitbb4eb1113b188ad7f1149df715ae2d9fd0411ca7 (patch)
tree2fabac7be53fd90a973da1707d9a785eab7dcdcb /app/views/runs/show.html.erb
parent11b7be5c41edda171a05e92295c51320cb315c68 (diff)
Improve run and checkpoint views
Diffstat (limited to 'app/views/runs/show.html.erb')
-rw-r--r--app/views/runs/show.html.erb39
1 files changed, 28 insertions, 11 deletions
diff --git a/app/views/runs/show.html.erb b/app/views/runs/show.html.erb
index 55bef02..e080783 100644
--- a/app/views/runs/show.html.erb
+++ b/app/views/runs/show.html.erb
@@ -9,7 +9,8 @@
<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) %>.
+ checked in! You can <%= link_to "checkout this run", new_run_checkpoint_path(@run) %>
+ to play it yourself, then check it back in when you're done to save your progress.
<% else %>
checked out by <%= link_to @run.checked_out_user.name || "???", user_path(@run.checked_out_user) %>.
<% if @run.last_save_file.attached? %>
@@ -21,25 +22,41 @@
</div>
<h2 class="text-xl">Checkpoints</h2>
- <%= link_to "New checkpoint", new_run_checkpoint_path(@run) %>
+ <div><%= link_to "New checkpoint", new_run_checkpoint_path(@run) %></div>
<% @run.checkpoints.order(:created_at).reverse.each do |checkpoint| %>
<div class="border-l border-orange-900 p-2">
<div class="flex flex-col">
+ <div class="flex space-x-2 text-sm">
+ <div>
+ <% case checkpoint.kind.to_sym %>
+ <% when :comment %>
+ 💬
+ <% when :checkin %>
+ 📬
+ <% when :checkout %>
+ 📭
+ <% else %>
+ <%# Should never happen. %>
+ <% end %>
+ </div>
+ <div class="flex space-x-2">
+ <span class="uppercase"><%= checkpoint.kind %></span>
+ <% if checkpoint.save_file.attached? %>
+ <%= link_to "Download save file", rails_blob_path(checkpoint.save_file, disposition: "attachment") %>
+ <% end %>
+ </div>
+
+ </div>
<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 %>
+ <%= time_ago_in_words(checkpoint.created_at) %> ago by
+ <%= link_to checkpoint.user.name || "???", user_path(checkpoint.user) %>
+ <span>@ <%= checkpoint.created_at %></span>
</div>
<% if checkpoint.comment %>
- <div><%= checkpoint.comment %></div>
+ <div class="text-lg"><%= checkpoint.comment %></div>
<% end %>
</div>
</div>