From bd681f7a2c58c796a3fa9316ea17b40ba5e01129 Mon Sep 17 00:00:00 2001 From: David Gay Date: Mon, 30 Oct 2023 02:43:17 -0400 Subject: Home and app structure, style, and content --- app/assets/stylesheets/application.tailwind.css | 6 +++- app/controllers/home_controller.rb | 4 ++- app/views/home/index.html.erb | 15 ++++++++-- app/views/layouts/application.html.erb | 37 +++++++++++++++++++------ 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 @@ -
+

Welcome to the Cable Club!

- <%= link_to "Login", new_user_session_path %> + +
+

Latest checkpoints

+
    + <% @latest_checkpoints.each do |checkpoint| %> +
  • 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") %>
  • + <% end %> +
+
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 @@ - + - CableClub + Cable Club <%= csrf_meta_tags %> <%= csp_meta_tag %> @@ -11,12 +11,33 @@ <%= javascript_importmap_tags %> - -
-

<%= notice %>

-

<%= alert %>

+ - <%= yield %> -
+ + +
+

<%= notice %>

+

<%= alert %>

+ + <%= yield %> +
+ + -- cgit v1.2.3