Skip to content

Commit

Permalink
Disable rating controls after voting closes (fixes #412) (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keltena authored Aug 21, 2024
1 parent 873b402 commit 0b3a820
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion IFComp/root/lib/site/header
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ END;
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
[% IF current_comp.status == 'open_for_judging' %]
[% IF current_comp.status == 'open_for_judging' || 'processing_votes' %]
<li><a href="/ballot/">Entries</a></li>
[% ELSE %]
<li><a href="/comp/">Results</a></li>
Expand Down
4 changes: 3 additions & 1 deletion IFComp/root/src/_rating_controls.tt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
[% IF c.user.get_object.can_vote_for(entry) %]

<div class="rating-controls" style="float: right;">
<p>Your rating: <select data-entry="[% entry.id %]" class="rating-select">
<p>Your rating: <select data-entry="[% entry.id %]" class="rating-select"[% IF current_comp.status == 'processing_votes' %] disabled[% END %]>
<option value="0">None</option>
[% number = 1 %]
[% WHILE number <= 10 %]
<option value="[% number %]" [% IF rating_for_entry.${entry.id} == number %] selected="1" [% END %] >[% number %]</option>
[% number = number + 1 %]
[% END %]
</select>
[% IF current_comp.status == 'open_for_judging' %]
<span class="feedback-link" id="feedback-link-[% entry.id %]">
<a href="[% c.uri_for_action( '/ballot/feedback', entry.id ) %]">Add / edit feedback</a>
</span>
[% END %]
<span id="rating-status-[% entry.id %]-spinner" class="label label-default waiting" style="display:none">Submitting...</span>
<span id="rating-status-[% entry.id %]-success" class="label label-success success" style="display:none">Rating recorded!</span>
<span id="rating-status-[% entry.id %]-failure" class="label label-danger danger" style="display:none">Rating not recorded! (Uh oh. Contact [email protected] about this, please.)</span>
Expand Down
6 changes: 5 additions & 1 deletion IFComp/root/src/ballot/index.tt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@

<h1 id="browse" class="page-header">Browse and play the games</h1>

<p>Have a look at our <a href="[% c.uri_for('/about/file_formats') %]" target="_blank">guide to IF formats</a> for some additional information on the various download-flavors you'll find below. And for a more compact list of this year's entries, <a href="/ballot/vote/">see the voting ballot</a>.</p>
<p>Have a look at our <a href="[% c.uri_for('/about/file_formats') %]" target="_blank">guide to IF formats</a> for some additional information on the various download-flavors you'll find below.
[% IF current_comp.status == 'open_for_judging' %]
And for a more compact list of this year's entries, <a href="/ballot/vote/">see the voting ballot</a>.
[% END %]
</p>

<p>Please note that some entries, when played online through this website, collect anonymous transcripts of player input for the benefit of those entries' authors. You can opt out of this by downloading and playing these entries offline. <a href="/about/transcripts">Read this note for more information.</a></p>

Expand Down
2 changes: 1 addition & 1 deletion IFComp/root/src/welcome.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ All entries are in and being prepared for release. The judging period will begin
[% ELSIF current_comp.status == 'open_for_judging' %]
<a href="[% c.uri_for('/ballot') %]">The games of the [% current_comp.year %] Interactive Fiction Competition are ready for judging!</a> <em>Anyone can be a judge</em>: just play and <a href="[% c.uri_for('/ballot/vote') %]">rate</a> at least five games by [% current_comp.judging_ends.month_name %] [% current_comp.judging_ends.day %]. <a href="[% c.uri_for('/about/schedule') %]">See the full schedule</a>.
[% ELSIF current_comp.status == 'processing_votes' %]
Voting has closed! We're tallying up the results now. Final results will be posted soon. <a href="[% c.uri_for('/about/schedule') %]">See the full schedule</a>. (You can still <a href="[% c.uri_for('/comp') %]">browse and play the games</a>, in the meantime.)
Voting has closed! We're tallying up the results now. Final results will be posted soon. <a href="[% c.uri_for('/about/schedule') %]">See the full schedule</a>. (You can still <a href="[% c.uri_for('/ballot') %]">browse and play the games</a>, in the meantime.)
[% ELSE %]
The [% current_comp.year %] IFComp is over. Congratulations to the first-place winner[% IF current_comp.winners.size > 1 %]s[% END %], [% winner_count = 1 %][% FOR winner IN current_comp.winners %]<em>[% winner.title %]</em> by [% INCLUDE author_name.tt entry=winner suppress_links=1 | trim %][% IF winner_count < current_comp.winners.size %] and [% END %][% winner_count = winner_count + 1 %][% END %]!</p>

Expand Down

0 comments on commit 0b3a820

Please sign in to comment.