<%= @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 <%= 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? %> 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) %>
<% @run.checkpoints.order(:created_at).reverse.each do |checkpoint| %>
<% case checkpoint.kind.to_sym %> <% when :comment %> 💬 <% when :checkin %> 📬 <% when :checkout %> 📭 <% else %> <%# Should never happen. %> <% end %>
<%= checkpoint.kind %> <% if checkpoint.save_file.attached? %> <%= link_to "Download save file", rails_blob_path(checkpoint.save_file, disposition: "attachment") %> <% end %>
<%= time_ago_in_words(checkpoint.created_at) %> ago by <%= link_to checkpoint.user.name || "???", user_path(checkpoint.user) %> @ <%= checkpoint.created_at %>
<% if checkpoint.comment %>
<%= checkpoint.comment %>
<% end %>
<% end %>