summaryrefslogtreecommitdiff
path: root/app/views/home/index.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/home/index.html.erb
parentd4c92922e393876e93ad13943ba45fb08586e6c8 (diff)
Better home#index, using partials
Diffstat (limited to 'app/views/home/index.html.erb')
-rw-r--r--app/views/home/index.html.erb31
1 files changed, 17 insertions, 14 deletions
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb
index a961565..fe9031e 100644
--- a/app/views/home/index.html.erb
+++ b/app/views/home/index.html.erb
@@ -1,24 +1,27 @@
<div class="space-y-8">
<h1 class="font-bold text-2xl">Welcome to the Cable Club!</h1>
- <div class="grid grid-cols-2">
- <div class="space-y-4">
+ <div class="grid grid-cols-1 md:grid-cols-3">
+ <div class="space-y-2">
<h2>Latest checkpoints</h2>
- <ul class="list-disc">
+ <div class="space-y-2">
<% @latest_checkpoints.each do |checkpoint| %>
- <li>At <%= checkpoint.created_at %>
- <%= checkpoint.user.name %> checked in a save for
- <%= link_to checkpoint.run.title, run_path(checkpoint.run) %> (<%= checkpoint.run.game.title %>)
- <% if checkpoint.save_file.attached? %>
- <%= link_to "[save file]", rails_blob_path(checkpoint.save_file, disposition: "attachment") %>
- <% end %>
- </li>
+ <%= render partial: "checkpoints/checkpoint", locals: {checkpoint:} %>
<% end %>
- </ul>
+ </div>
</div>
- <div class="flex justify-around">
- <%= image_tag "pokemon_classic_watercolor_small.png" %>
+
+ <div class="space-y-2">
+ <h2>Latest Pokédex entries</h2>
+ <div class="space-y-2">
+ <% @latest_entries.each do |entry| %>
+ <%= render partial: "pokedex_entries/entry", locals: {entry:} %>
+ <% end %>
+ </div>
</div>
- </div>
+ <div>
+ <%= image_tag "pokemon_classic_watercolor_small.png", class: "mx-auto" %>
+ </div>
+ </div>
</div>