summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2023-10-30 02:43:17 -0400
committerDavid Gay <eapoems@riseup.net>2023-10-30 02:43:17 -0400
commitbd681f7a2c58c796a3fa9316ea17b40ba5e01129 (patch)
tree586da670c2b226074ed890567c72ed38e988c251
parent4c4b9b78e2a88b20680f3bf7b4cfcbc3da8de533 (diff)
Home and app structure, style, and content
-rw-r--r--app/assets/stylesheets/application.tailwind.css6
-rw-r--r--app/controllers/home_controller.rb4
-rw-r--r--app/views/home/index.html.erb15
-rw-r--r--app/views/layouts/application.html.erb37
4 files changed, 50 insertions, 12 deletions
diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css
index 4908cf3..c37a0f4 100644
--- a/app/assets/stylesheets/application.tailwind.css
+++ b/app/assets/stylesheets/application.tailwind.css
@@ -8,7 +8,11 @@
}
@layer base {
- h1, h2, h3, h4, h5, h6, .subtitle {
+ .text-display {
font-family: "Pokemon Classic", sans-serif;
}
+
+ h1, h2, h3, h4, h5, h6, .subtitle {
+ @apply text-display;
+ }
}
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 44156ce..59cac59 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -1,5 +1,7 @@
class HomeController < ApplicationController
skip_before_action :authenticate_user!
- def index; end
+ def index
+ @latest_checkpoints = Checkpoint.last(5).sort_by(&:created_at).reverse
+ end
end
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb
index d90d13f..10be138 100644
--- a/app/views/home/index.html.erb
+++ b/app/views/home/index.html.erb
@@ -1,4 +1,15 @@
-<div>
+<div class="space-y-8">
<h1 class="font-bold text-2xl">Welcome to the Cable Club!</h1>
- <%= link_to "Login", new_user_session_path %>
+
+ <div class="space-y-4">
+ <h2>Latest checkpoints</h2>
+ <ul class="list-disc">
+ <% @latest_checkpoints.each do |checkpoint| %>
+ <li>At <%= checkpoint.created_at %>
+ <%= checkpoint.user.email %> checked in a save for
+ <%= link_to checkpoint.run.title, run_path(checkpoint.run) %> (<%= checkpoint.run.game.title %>)
+ <%= link_to "[save file]", rails_blob_path(checkpoint.save_file, disposition: "attachment") %></li>
+ <% end %>
+ </ul>
+ </div>
</div>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 46b1f5b..d956145 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
- <title>CableClub</title>
+ <title>Cable Club</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
@@ -11,12 +11,33 @@
<%= javascript_importmap_tags %>
</head>
- <body>
- <main class="container mx-auto mt-28 px-5">
- <p class="notice"><%= notice %></p>
- <p class="alert"><%= alert %></p>
+ <body class="flex flex-col min-h-screen bg-slate-100">
- <%= yield %>
- </main>
+ <nav class="flex flex-wrap items-center justify-between px-4 py-2 text-display">
+ <div class="flex flex-grow items-center space-x-8">
+ <%= link_to "Cable Club", root_path, class: "text-xl" %>
+ <%= link_to "Runs", runs_path %>
+ </div>
+ <div class="space-x-8">
+ <% if user_signed_in? %>
+ <%= link_to "Profile", "#" %>
+ <%= link_to "Sign out", destroy_user_session_path %>
+ <% else %>
+ <%= link_to "Sign in", new_user_session_path %>
+ <% end %>
+ </div>
+ </nav>
+
+ <main class="container mx-auto mt-28 px-5">
+ <p class="notice"><%= notice %></p>
+ <p class="alert"><%= alert %></p>
+
+ <%= yield %>
+ </main>
+
+ <footer class="flex-shrink">
+ <div class="max-w-screen-lg mx-auto pb-4">
+ </div>
+ </footer>
</body>
</html>