summaryrefslogtreecommitdiff
path: root/app/views/runs/show.html.erb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2023-11-03 02:25:06 -0400
committerDavid Gay <david@davidgay.org>2023-11-03 02:25:06 -0400
commite6577d0fd5ffacd24cf52125cd44037fc33fdb9a (patch)
treecc723b8a01df75735b01bd69c4ca3b32ea2082c5 /app/views/runs/show.html.erb
parentd4c92922e393876e93ad13943ba45fb08586e6c8 (diff)
Better home#index, using partials
Diffstat (limited to 'app/views/runs/show.html.erb')
-rw-r--r--app/views/runs/show.html.erb36
1 files changed, 1 insertions, 35 deletions
diff --git a/app/views/runs/show.html.erb b/app/views/runs/show.html.erb
index cca5029..9db4f53 100644
--- a/app/views/runs/show.html.erb
+++ b/app/views/runs/show.html.erb
@@ -27,41 +27,7 @@
<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>
- </div>
- <div class="text-sm">
- <%= 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 class="text-lg"><%= checkpoint.comment %></div>
- <% end %>
- </div>
- </div>
+ <%= render partial: "checkpoints/checkpoint", locals: {checkpoint:} %>
<% end %>
</div>
<div>