From d672465c2be3dc54463a92a3f1c4aa23447bc5c8 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 29 Oct 2023 14:02:34 -0400 Subject: better display of completions --- app/assets/stylesheets/wittle/general.css.scss | 2 +- app/views/wittle/puzzles/show.html.haml | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/wittle/general.css.scss b/app/assets/stylesheets/wittle/general.css.scss index 06a7a83..b2b432d 100644 --- a/app/assets/stylesheets/wittle/general.css.scss +++ b/app/assets/stylesheets/wittle/general.css.scss @@ -83,7 +83,7 @@ input[type="range"]::-ms-thumb { text-align: center; } - ol { + table { width: max-content; margin: 0 auto; } diff --git a/app/views/wittle/puzzles/show.html.haml b/app/views/wittle/puzzles/show.html.haml index d5d8b00..75ae288 100644 --- a/app/views/wittle/puzzles/show.html.haml +++ b/app/views/wittle/puzzles/show.html.haml @@ -14,12 +14,18 @@ #scores #by-time %h2 Fastest Solves - %ol + %table - @puzzle.scores.where("seconds_taken IS NOT NULL").order(seconds_taken: :asc).each do |score| - %li= score.name + %tr + %td #{(i + 1)}. + %td= score.name + %td #by-when %h2 Completion Order - %ol - - @puzzle.scores.order(created_at: :desc).each do |score| - %li= score.name + %table + - @puzzle.scores.order(created_at: :asc).each_with_index do |score, i| + %tr + %td #{(i + 1)}. + %td= score.name + %td= score.created_at.getlocal().strftime("%-I:%M:%S%P") = render partial: "handle_puzzle" -- cgit 1.4.1