From 82cf9a4f0819bec96d1cf5050cc4e8dc17568be0 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 30 Oct 2023 12:40:08 -0400 Subject: main page! and other layout stuff --- app/controllers/wittle/puzzles_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/controllers') diff --git a/app/controllers/wittle/puzzles_controller.rb b/app/controllers/wittle/puzzles_controller.rb index 3c3c8a6..b481460 100644 --- a/app/controllers/wittle/puzzles_controller.rb +++ b/app/controllers/wittle/puzzles_controller.rb @@ -2,8 +2,16 @@ module Wittle class PuzzlesController < ApplicationController def about @normal_puzzle = Puzzle.normal.order(created_at: :desc).first + @normal_started = ((session[:started_puzzles] || []).include? @normal_puzzle.id) + @normal_solved = ((session[:played_puzzles] || []).include? @normal_puzzle.id) + @hard_puzzle = Puzzle.hard.order(created_at: :desc).first + @hard_started = ((session[:started_puzzles] || []).include? @hard_puzzle.id) + @hard_solved = ((session[:played_puzzles] || []).include? @hard_puzzle.id) + @expert_puzzle = Puzzle.expert.order(created_at: :desc).first + @expert_started = ((session[:started_puzzles] || []).include? @expert_puzzle.id) + @expert_solved = ((session[:played_puzzles] || []).include? @expert_puzzle.id) end def index -- cgit 1.4.1