Skip to content

Commit

Permalink
comp 2024 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmusante committed Oct 21, 2024
1 parent 95df72b commit 902ccec
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 14 deletions.
57 changes: 47 additions & 10 deletions IFComp/lib/IFComp/Controller/Admin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sub gamescsv : Chained( 'root' ) : Args(0) {
my ( $self, $c ) = @_;

unless ( $c->user
&& $c->check_any_user_role( 'curator', ) )
&& $c->check_any_user_role('cheez') )
{
$c->detach('/error_403');
return;
Expand All @@ -62,7 +62,17 @@ sub gamescsv : Chained( 'root' ) : Args(0) {
my $output = "";
open my $fh, ">:encoding(utf8)", \$output or die "open fail $!";

$csv->print( $fh, [ "TITLE", "PRIMARY AUTHOR" ] );
# select place, title, name, entry.email as entry_email, user.email as
# user_email, paypal from entry, user where comp=? and is_disqualified != 1
# and entry.author = user.id order by place asc;

$csv->print(
$fh,
[ "PLACE", "TITLE",
"PRIMARY AUTHOR", "AUTHOR EMAIL",
"ENTRY EMAIL", "PAYPAL"
]
);
print $fh "\n";

for my $entry ( $current_comp->entries ) {
Expand All @@ -76,7 +86,13 @@ sub gamescsv : Chained( 'root' ) : Args(0) {
{
$author = $entry->author->name;
}
$csv->print( $fh, [ $entry->title, $author ] );
$csv->print(
$fh,
[ $entry->place, $entry->title,
$author, $entry->author->email,
$entry->email, $entry->author->paypal
]
);
print $fh "\n";
}

Expand Down Expand Up @@ -157,14 +173,35 @@ sub resultscsv : Chained( 'root' ) : Args(0) {
"average", "stddev", "total_votes"
);

$csv->print(
$fh,
[ "AUTHOR", "EMAIL", "PSEUDONYM", "REVEAL",
"TITLE", "PLACE", "MISS-C", "AVERAGE",
"STDDEV", "TOTAL-VOTES"
]
);
print $fh "\n";

for my $entry ( $current_comp->entries ) {
if ( $entry->is_disqualified == 0 ) {

my $reveal = "n/a";
if ( $entry->author_pseudonym ) {
if ( $entry->reveal_pseudonym ) {
$reveal = "YES";
}
else {
$reveal = "NO";
}
}

$csv->print(
$fh,
[ $entry->author->name, $entry->title,
$entry->place, $entry->miss_congeniality_place,
$entry->average_score, $entry->standard_deviation,
$entry->votes_cast
[ $entry->author->name, $entry->author->email,
$entry->author_pseudonym, $reveal,
$entry->title, $entry->place,
$entry->miss_congeniality_place, $entry->average_score,
$entry->standard_deviation, $entry->votes_cast
]
);
print $fh "\n";
Expand All @@ -183,7 +220,7 @@ sub votecsv : Chained( 'root' ) {
my ( $self, $c ) = @_;

unless ( $c->user
&& $c->check_any_user_role( 'cheez', ) )
&& $c->check_any_user_role( 'votecounter', 'cheez', ) )
{
$c->detach('/error_403');
return;
Expand Down Expand Up @@ -218,8 +255,8 @@ sub votecsv : Chained( 'root' ) {
my $output = "";
open my $fh, ">:encoding(utf8)", \$output or die "open fail $!";
$csv->column_names(
"title", "platform", "voter", "vote",
"ip address", "timestamp", "any GAI", "GAI cover",
"title", "platform", "voter", "vote",
"ip address", "timestamp", "GAI-FREE", "GAI cover",
"GAI non-text", "GAI text"
);
$csv->print(
Expand Down
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' || 'processing_votes' %]
[% IF ( current_comp.status == 'open_for_judging' ) || ( current_comp.status == 'processing_votes' ) %]
<li><a href="/ballot/">Entries</a></li>
[% ELSE %]
<li><a href="/comp/">Results</a></li>
Expand Down
3 changes: 2 additions & 1 deletion IFComp/root/src/_schedule.tt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
<li><p><strong>[% current_comp.intents_close.strftime( '%{month_name} %{day}' ) %]:</strong> The last date that authors can register their intent to enter.</p></li>
<li><p><strong>[% current_comp.entries_due.strftime( '%{month_name} %{day}' ) %]:</strong> The last date that authors can upload their games to the competition site. Everyone starts counting down the hours, eager to explore all the new IFfy goodness.</p></li>
<li><p><strong>[% current_comp.judging_begins.strftime( '%{month_name} %{day}' ) %]:</strong> The games are released to the public, and the judging period begins.</p></li>
<li><p><strong>[% current_comp.judging_ends.strftime( '%{month_name} %{day}' ) %]:</strong> All votes must be submitted by the end of the day. The competition results are announced shortly afterwards. Prize choosing and distribution begins.</p></li>
<li><p><strong>[% current_comp.judging_ends.strftime( '%{month_name} %{day}' ) %]:</strong> All votes must be submitted by the end of the day.</p></li>
<!--<li><p><strong>October XX at Xpm Eastern:</strong> IFComp Awards Ceremony on Twitch: <a href="https://www.twitch.tv/interactivefictioncomp">https://www.twitch.tv/interactivefictioncomp</a> (Competition results posted to this site shortly after the stream. Prize choosing and distribution begins.)</p></li>-->
</ul>
6 changes: 4 additions & 2 deletions IFComp/root/src/admin/index.tt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
<li><a href="[% c.uri_for('/admin/voting/') %]">Voting</a></li>
<li><a href="[% c.uri_for('/admin/email/') %]">Author email-address and forum-handle lists</a></li>
[% END %]
[% IF c.check_any_user_role( 'votecounter', 'cheez' ) %]
<li><a href="[% c.uri_for_action('/admin/votecsv') %]">Download a CSV of Voting Data for this year</a></li>
[% END %]
[% IF c.check_user_roles( 'curator' ) %]
<li><a href="[% c.uri_for('/admin/feedback/') %]">Feedback</a></li>
<li><a href="[% c.uri_for('/admin/genai/') %]">Generative AI Responses</a></li>
<li><a href="[% c.uri_for_action('/admin/ballotcsv') %]">Download CSV of Entries</a></li>
<li><a href="[% c.uri_for_action('/admin/gamescsv') %]">Download CSV of just Titles and Authors</a></li>
[% END %]
[% IF c.check_user_roles( 'cheez' ) %]
<li><a href="[% c.uri_for('/admin/validation/') %]">User Validation</a></li>
<li><a href="[% c.uri_for_action('/admin/resultscsv') %]">Download CSV of Results</a></li>
<li><a href="[% c.uri_for_action('/admin/votecsv') %]">Download a CSV of Voting Data for this year</a></li>
<li><a href="[% c.uri_for_action('/admin/gamescsv') %]">Download CSV of Payout Results</a></li>
[% END %]
[% IF c.check_user_roles( 'prizemanager' ) %]
<li><a href="[% c.uri_for('/admin/prizes/list') %]">Prize Management</a></li>
Expand Down
4 changes: 4 additions & 0 deletions IFComp/root/static/css/ifcomp.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ option:checked {
stroke: #ccc;
}

[data-theme="dark"] .highcharts-axis-labels text {
fill: #26f;
}

[data-theme="dark"] .highcharts-color-1 {
fill: #9696ab;
stroke: #9696ab;
Expand Down

0 comments on commit 902ccec

Please sign in to comment.