diff --git a/lib/config.php b/lib/config.php index b674a3c..1b04e19 100644 --- a/lib/config.php +++ b/lib/config.php @@ -1,4 +1,6 @@ 0, "path" => "/", diff --git a/lib/partials/assignments.php b/lib/partials/assignments.php index 1555012..5a0ed56 100644 --- a/lib/partials/assignments.php +++ b/lib/partials/assignments.php @@ -24,8 +24,15 @@ $assignments->params["round"] = 3; $stmt_assignments->execute($assignments->params); $assignments->round_3 = $stmt_assignments->fetchAll(PDO::FETCH_OBJ); ?> -
-

Your Assignments

+
+

Your Assignments

+ status_id, [ + STATUS_ENROLLING, + STATUS_REVIEW, + ])) { ?> +

The manuscripts to which you've been assigned to provide feedback will appear here.

+ + round_1): ?>
@@ -39,12 +46,14 @@ $assignments->round_3 = $stmt_assignments->fetchAll(PDO::FETCH_OBJ); round_1 as $item): ?> - +
Round One Assignments for name ?>
title ?>score ?? 'N/A' ?>score ?? "N/A" ?>
+ + round_2): ?>
@@ -58,12 +67,14 @@ $assignments->round_3 = $stmt_assignments->fetchAll(PDO::FETCH_OBJ); round_2 as $item): ?> - +
Round Two Assignments for name ?>
title ?>score ?? 'N/A' ?>score ?? "N/A" ?>
+ + round_3): ?>
@@ -77,10 +88,11 @@ $assignments->round_3 = $stmt_assignments->fetchAll(PDO::FETCH_OBJ); round_3 as $item): ?> - +
Round Three Assignments for name ?>
title ?>score ?? 'N/A' ?>score ?? "N/A" ?>
+
diff --git a/lib/partials/contest-schedule.php b/lib/partials/contest-schedule.php new file mode 100644 index 0000000..97593c5 --- /dev/null +++ b/lib/partials/contest-schedule.php @@ -0,0 +1,94 @@ +
+

Schedule

+ DateTimeImmutable::createFromFormat( + "U", + $game->submitstart + )->setTimezone($time_zone), + "submitend" => DateTimeImmutable::createFromFormat( + "U", + $game->submitend + )->setTimezone($time_zone), + "onestart" => DateTimeImmutable::createFromFormat( + "U", + $game->onestart + )->setTimezone($time_zone), + "twostart" => DateTimeImmutable::createFromFormat( + "U", + $game->twostart + )->setTimezone($time_zone), + "threestart" => DateTimeImmutable::createFromFormat( + "U", + $game->threestart + )->setTimezone($time_zone), + "gameend" => DateTimeImmutable::createFromFormat( + "U", + $game->gameend + )->setTimezone($time_zone), +]; ?> +
+
+
Submissions
+
Open:
+
Close:
+
+
+
Document Review
+
Start:
+
End:
+
+
+
Round One
+
Start:
+
End:
+
+
+
Round Two
+
Start:
+
End:
+
+
+
Round Three
+
Start:
+
End:
+
+
+
diff --git a/lib/partials/feedback.php b/lib/partials/feedback.php index ca73f35..f15ffe6 100644 --- a/lib/partials/feedback.php +++ b/lib/partials/feedback.php @@ -7,8 +7,9 @@ $stmt_fdbck->execute([ ]); $feedback = $stmt_fdbck->fetchAll(PDO::FETCH_OBJ); ?> -
-

Feedback

+
+

Feedback

+
@@ -28,4 +29,7 @@ $feedback = $stmt_fdbck->fetchAll(PDO::FETCH_OBJ);
Feedback for "title ?>"
-
+ +

The feedback you receive from other writers will appear here.

+ +
diff --git a/lib/partials/submission-details.php b/lib/partials/submission-details.php new file mode 100644 index 0000000..b9daf5e --- /dev/null +++ b/lib/partials/submission-details.php @@ -0,0 +1,37 @@ + + +
+ + + + + + + + + + + + status_id === STATUS_REVIEW) { ?> + + + + + + + + + + + + + + + + + + + +
Submission Details
IDid ?>
Titletitle ?>
Review Statusstatus)->name ?? + "N/A" ?>
RankingsRound Onerank_round_1 ?? "N/A" ?>
Round Tworank_round_2 ?? "N/A" ?>
Round Threerank_round_3 ?? "N/A" ?>
+
diff --git a/lib/partials/submission-info.php b/lib/partials/submission-info.php deleted file mode 100644 index f770ed1..0000000 --- a/lib/partials/submission-info.php +++ /dev/null @@ -1,33 +0,0 @@ -prepare( - "SELECT round_number, score, comment FROM assignments WHERE completed IS NOT NULL AND submission_id = :submission_id" -); -$stmt_fdbck->execute([ - "submission_id" => $submission->id, -]); -$feedback = $stmt_fdbck->fetchAll(PDO::FETCH_OBJ); -?> -
- - - - - - - - - - - - - - - - - - - - - -
Submission details
Titletitle ?>
RankingRound Onerank_round_1 ?>
Round Tworank_round_2 ?>
Round Threerank_round_3 ?>
-
diff --git a/www/assets/css/app.css b/www/assets/css/app.css index 15b43de..98ae080 100644 --- a/www/assets/css/app.css +++ b/www/assets/css/app.css @@ -1,4 +1,4 @@ -header { +main > header { text-align: center; } @@ -93,3 +93,7 @@ form mark { border-radius: 0.5em; display: none; } + +.single-game ul { + padding: 0; +} diff --git a/www/games/game.php b/www/games/game.php index 8ae582f..734d8ac 100644 --- a/www/games/game.php +++ b/www/games/game.php @@ -1,5 +1,4 @@ prepare( "SELECT * FROM assignments WHERE assignments.game_id = :game_id" ); @@ -57,155 +57,57 @@ include "partials/head.php"; ]); $submission = $stmt->fetch(PDO::FETCH_OBJ); unset($stmt); - - if ($game->status_id === STATUS_ENROLLING && $submission) { - $participant_state = 'GAME_OPEN_WITH_SUBMISSION'; - } elseif ($game->status_id === STATUS_ENROLLING && !$submission) { - $participant_state = 'GAME_OPEN_WITHOUT_SUBMISSION'; - } elseif ($submission && in_array($game->status_id, [ - STATUS_ROUND_ONE, - STATUS_ROUND_TWO, - STATUS_ROUND_THREE, - STATUS_DONE, - ])) { - $participant_state = 'GAME_CLOSED_WITH_SUBMISSION'; - } else { - $participant_state = 'GAME_CLOSED_WITHOUT_SUBMISSION'; - } - - $dates = [ - "submitstart" => DateTimeImmutable::createFromFormat( - "U", - $game->submitstart - )->setTimezone($time_zone), - "submitend" => DateTimeImmutable::createFromFormat( - "U", - $game->submitend - )->setTimezone($time_zone), - "onestart" => DateTimeImmutable::createFromFormat( - "U", - $game->onestart - )->setTimezone($time_zone), - "twostart" => DateTimeImmutable::createFromFormat( - "U", - $game->twostart - )->setTimezone($time_zone), - "threestart" => DateTimeImmutable::createFromFormat( - "U", - $game->threestart - )->setTimezone($time_zone), - "gameend" => DateTimeImmutable::createFromFormat( - "U", - $game->gameend - )->setTimezone($time_zone), - ]; ?> -
+

Your Submission

transaction_id !== NULL; - switch ($participant_state) { - case 'GAME_OPEN_WITH_SUBMISSION': ?> -

title ?>

-

You have not yet paid for your submission.

-

Update submission

- -

Pay submission fee

- - + $IS_PAID = $submission && $submission->transaction_id !== null; + if ( + in_array($game->status_id, [ + STATUS_ENROLLING, + STATUS_REVIEW, + ]) && + $submission && + !$IS_PAID + ) { ?> + + + + + + + status_id === STATUS_ENROLLING && + !$submission + ) { ?>

You haven't submitted work to this contest.

Submit to name ?>

- - -

Update submission visibility

- - - -

You didn't submit a work to this contest.

- - + + status_id !== STATUS_DONE && !$submission) { ?> +

You didn't submit a work to this contest.

+

-
-

Schedule

-
-
-
Submissions
-
Open:
-
Close:
-
-
-
Document Review
-
Start:
-
End:
-
-
-
Round One
-
Start:
-
End:
-
-
-
Round Two
-
Start:
-
End:
-
-
-
Round Three
-
Start:
-
End:
-
-
-
+