summaryrefslogtreecommitdiff
path: root/app/views/runs/show.html.erb
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2023-11-03 01:03:48 -0400
committerDavid Gay <david@davidgay.org>2023-11-03 01:03:48 -0400
commit0c5cccbecfc8b71fb318c275f142306e19bb7e43 (patch)
tree178b401fe2ecf6bd965524e078e9882305342a69 /app/views/runs/show.html.erb
parent47ecf3f515ef5bd7db2c4f3bce0a872a46ca2233 (diff)
Pokedex entry recording and viewing on runs#show
Diffstat (limited to 'app/views/runs/show.html.erb')
-rw-r--r--app/views/runs/show.html.erb80
1 files changed, 45 insertions, 35 deletions
diff --git a/app/views/runs/show.html.erb b/app/views/runs/show.html.erb
index e080783..cca5029 100644
--- a/app/views/runs/show.html.erb
+++ b/app/views/runs/show.html.erb
@@ -21,44 +21,54 @@
<% end %>
</div>
- <h2 class="text-xl">Checkpoints</h2>
- <div><%= link_to "New checkpoint", new_run_checkpoint_path(@run) %></div>
+ <div class="grid grid-cols-1 md:grid-cols-2">
+ <div>
+ <h2 class="text-xl">Checkpoints</h2>
+ <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") %>
+ <% @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>
- <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>
+ <% end %>
</div>
- <% end %>
+ <div>
+ <% if @run.checked_out_user == current_user %>
+ <h2 class="text-xl">Pokédex Entries</h2>
+ <%= turbo_frame_tag "pokedex_entries", src: run_pokedex_entries_url(@run) %>
+ <% end %>
+ </div>
+ </div>
</div>