From b9a7412c3b3f491346cc421523164f414dbe94cb Mon Sep 17 00:00:00 2001 From: Mark Musante Date: Thu, 4 Jul 2024 08:11:04 -0400 Subject: [PATCH] checkbox to hide games that have already been rated; general code cleanup --- IFComp-Dev/docker-compose.yml | 1 - IFComp/root/lib/site/header | 4 +- IFComp/root/lib/site/html | 6 +-- IFComp/root/src/_current_entry_row.tt | 4 -- IFComp/root/src/_filter_entries.tt | 22 ++++++-- IFComp/root/src/_rating_controls.tt | 6 +-- IFComp/root/src/author_name.tt | 6 +-- IFComp/root/src/ballot/index.tt | 66 +++++++++++------------ IFComp/root/src/ballot/vote.tt | 4 -- IFComp/root/src/ttsite.css | 3 ++ IFComp/t/lib/IFCompTestData.pm | 75 ++++++++++++++------------- 11 files changed, 101 insertions(+), 96 deletions(-) diff --git a/IFComp-Dev/docker-compose.yml b/IFComp-Dev/docker-compose.yml index d37da707..ba8f64e9 100644 --- a/IFComp-Dev/docker-compose.yml +++ b/IFComp-Dev/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3.2' services: app: build: diff --git a/IFComp/root/lib/site/header b/IFComp/root/lib/site/header index 25aea0ff..3f652eef 100644 --- a/IFComp/root/lib/site/header +++ b/IFComp/root/lib/site/header @@ -68,13 +68,13 @@ END;
  • + class="custom-control-input" hidden id="dark_mode_toggle">
  • - diff --git a/IFComp/root/lib/site/html b/IFComp/root/lib/site/html index 6344e2cb..895af5ff 100644 --- a/IFComp/root/lib/site/html +++ b/IFComp/root/lib/site/html @@ -1,5 +1,5 @@ - + [% meta.title or site.title %] @@ -8,11 +8,11 @@ - - [% END %] diff --git a/IFComp/root/src/_rating_controls.tt b/IFComp/root/src/_rating_controls.tt index 099d72af..451a5480 100644 --- a/IFComp/root/src/_rating_controls.tt +++ b/IFComp/root/src/_rating_controls.tt @@ -1,11 +1,11 @@ [% IF c.user.get_object.can_vote_for(entry) %]
    -

    Your rating: [% number = 1 %] [% WHILE number <= 10 %] - + [% number = number + 1 %] [% END %] @@ -15,7 +15,7 @@ -

    +
    [% END %] diff --git a/IFComp/root/src/author_name.tt b/IFComp/root/src/author_name.tt index f15c0881..c10705b3 100644 --- a/IFComp/root/src/author_name.tt +++ b/IFComp/root/src/author_name.tt @@ -3,7 +3,7 @@ [% ELSIF entry.author_pseudonym %] [% entry.author_pseudonym | html %] [% IF entry.email && !suppress_links %] - [% entry.email %] + [% entry.email %] [% END %] [% ELSIF suppress_links %] [% entry.author.name | html %] @@ -14,9 +14,9 @@ [% BLOCK name_and_links %] [% IF entry.author.url %][% END %][% entry.author.name | html %][% IF entry.author.url %][% END %] [% IF entry.author.twitter %] - @[% entry.author.twitter | html %] + @[% entry.author.twitter | html %] [% END %] [% IF entry.email || entry.author.email_is_public %] - [% entry.email || entry.author.email | html %] + [% entry.email || entry.author.email | html %] [% END %] [% END %] diff --git a/IFComp/root/src/ballot/index.tt b/IFComp/root/src/ballot/index.tt index 2fb21116..3484fb82 100644 --- a/IFComp/root/src/ballot/index.tt +++ b/IFComp/root/src/ballot/index.tt @@ -1,7 +1,3 @@ - -
    @@ -21,7 +17,7 @@
    - +
    @@ -29,7 +25,7 @@
    - +
    @@ -155,35 +151,31 @@
    -
    -

    Playtime

    - - +
    +

    Playtime

    +
    - - -
    -

    Style

    - +
    +

    Style

    +
    - -
    +

    Platform

    [% FOR entry IN entries %] [% IF entry.is_qualified %]
    [% INCLUDE _entry_title.tt include_permalink = 1 %] [% INCLUDE _current_entry_row.tt %] @@ -256,7 +250,7 @@
    -

    No games match your chosen criteria

    +

    No games match your chosen criteria

    diff --git a/IFComp/root/src/ballot/vote.tt b/IFComp/root/src/ballot/vote.tt index 44f75506..15b9bf7c 100644 --- a/IFComp/root/src/ballot/vote.tt +++ b/IFComp/root/src/ballot/vote.tt @@ -1,7 +1,3 @@ - -
    diff --git a/IFComp/root/src/ttsite.css b/IFComp/root/src/ttsite.css index fd58933a..fd4a0be2 100644 --- a/IFComp/root/src/ttsite.css +++ b/IFComp/root/src/ttsite.css @@ -1,4 +1,7 @@ +.rating-controls { display: none } + +.play-button { display: inline-block } .error { color: #F11; diff --git a/IFComp/t/lib/IFCompTestData.pm b/IFComp/t/lib/IFCompTestData.pm index bfc9cea1..bbe2a6f4 100644 --- a/IFComp/t/lib/IFCompTestData.pm +++ b/IFComp/t/lib/IFCompTestData.pm @@ -111,74 +111,75 @@ sub add_test_data_to_schema { $schema->populate( 'Entry', - [ [ 'id', 'author', 'title', 'comp', - 'place', 'platform', 'coauthor_code', + [ [ 'id', 'author', 'title', 'style', + 'comp', 'place', 'platform', 'coauthor_code', ], [ 100, 1, 'Test Z-code game', - 2, 1, 'inform', '8ad0cfd053b7ed08124d', + 'parser', 2, 1, 'inform', '8ad0cfd053b7ed08124d', ], [ 101, 1, 'Test Glulx game', - 2, 2, 'inform', 'cb596f31d709901e66e0', + 'parser', 2, 2, 'inform', 'cb596f31d709901e66e0', ], [ 102, 1, 'Test Quixe game', - 1, 1, 'quixe', '1d85063fad228a35b48f', + 'choice', 1, 1, 'quixe', '1d85063fad228a35b48f', ], [ 103, 3, 'Test Parchment game', - 2, 2, 'parchment', '2e44258d59ccfca797d8', + 'choice', 2, 2, 'parchment', '2e44258d59ccfca797d8', ], - [ 104, 1, 'Test Z-code website', - 2, 3, 'inform-website', '570afe4434136a35b97e', + [ 104, 1, 'Test Z-code website', + 'other', 2, 3, 'inform-website', '570afe4434136a35b97e', ], - [ 105, 3, 'Test non-Inform website', - 2, 4, 'website', '70d146f955a9be7ee657', + [ 105, 3, 'Test non-Inform website', + 'other', 2, 4, 'website', '70d146f955a9be7ee657', ], [ 106, 3, 'Test HTML page', - 2, 5, 'website', '11740856d5392f4f099c', + 'choice', 2, 5, 'website', '11740856d5392f4f099c', ], [ 107, 3, 'Test Z-code website with buried story file', - 2, 6, 'inform-website', '62584e5198e8ce160921', + 'parser', 2, 6, 'inform-website', '62584e5198e8ce160921', ], - [ 108, 1, 'Test Quest game', - 2, 7, 'quest', 'ec0460756f55e774c47a', + [ 108, 1, 'Test Quest game', + 'other', 2, 7, 'quest', 'ec0460756f55e774c47a', ], [ 109, 1, 'Test TADS game', - 2, 8, 'tads', '701d72d3c91885849902', + 'parser', 2, 8, 'tads', '701d72d3c91885849902', ], [ 110, 1, 'Test Alan game', - 1, 9, 'alan', '1f27146aef4840d23890', + 'parser', 1, 9, 'alan', '1f27146aef4840d23890', ], - [ 111, 1, 'Test ADRIFT game', - 1, 10, 'adrift', '50b2ebe54c374d8a30ce', + [ 111, 1, 'Test ADRIFT game', + 'choice', 1, 10, 'adrift', '50b2ebe54c374d8a30ce', ], - [ 112, 1, 'Quixe game, with extra stuff', - 1, 11, 'quixe', 'e2ffd42661e14703fc4e', + [ 112, 1, 'Quixe game, with extra stuff', + 'parser', 1, 11, 'quixe', 'e2ffd42661e14703fc4e', ], - [ 113, 1, 'Test Hugo game', - 1, 12, 'hugo', '1eada264ce7e16e9871b', + [ 113, 1, 'Test Hugo game', + 'parser', 1, 12, 'hugo', '1eada264ce7e16e9871b', ], - [ 114, 1, 'Test subdir-based ulx game', - 1, 13, 'inform', 'dc828daacbc60b2355fb', + [ 114, 1, 'Test subdir-based ulx game', + 'parser', 1, 13, 'inform', 'dc828daacbc60b2355fb', ], - [ 115, 1, 'Test non-Inform website, no index.html', - 1, 14, 'website', '7ed8e2cdcc37e33beb1c', + [ 115, 1, 'Test non-Inform website, no index.html', + 'choice', 1, 14, 'website', '7ed8e2cdcc37e33beb1c', ], - [ 116, 1, 'Test Adventuron game', - 1, 15, 'adventuron', 'fbbfc1a939a75253bd9d', + [ 116, 1, 'Test Adventuron game', + 'other', 1, 15, 'adventuron', 'fbbfc1a939a75253bd9d', ], - [ 117, 1, 'Test ChoiceScript game', - 1, 16, 'choicescript', '1dc6f3f624b4d41d6722', + [ 117, 1, 'Test ChoiceScript game', + 'choice', 1, 16, 'choicescript', '1dc6f3f624b4d41d6722', ], - [ 118, 1, 'Test Ink game', 1, 17, 'ink', 'dbf9363f8cd1e93f3896', + [ 118, 1, 'Test Ink game', + 'other', 1, 17, 'ink', 'dbf9363f8cd1e93f3896', ], - [ 119, 1, 'Test Texture game', - 1, 18, 'texture', 'eaab524bcce5d4b4c066', + [ 119, 1, 'Test Texture game', + 'choice', 1, 18, 'texture', 'eaab524bcce5d4b4c066', ], - [ 120, 1, 'Test Twine game', - 1, 19, 'twine', 'd7307f76e70989897684', + [ 120, 1, 'Test Twine game', + 'choice', 1, 19, 'twine', 'd7307f76e70989897684', ], - [ 121, 1, 'Test Unity game', - 1, 20, 'unity', 'dfed9407cd2c1c82ae9c', + [ 121, 1, 'Test Unity game', + 'other', 1, 20, 'unity', 'dfed9407cd2c1c82ae9c', ], ], );