diff --git a/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/evaluate/page.tsx b/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/evaluate/page.tsx
index 1be77c4..0e969fa 100644
--- a/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/evaluate/page.tsx
+++ b/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/evaluate/page.tsx
@@ -7,21 +7,22 @@ import type { Route } from 'next'
import { trpc } from '@/lib/trpc/client'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
import { Button } from '@/components/ui/button'
-import { Input } from '@/components/ui/input'
+import { Slider } from '@/components/ui/slider'
import { Textarea } from '@/components/ui/textarea'
import { Label } from '@/components/ui/label'
import { Skeleton } from '@/components/ui/skeleton'
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'
import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from '@/components/ui/dialog'
+ AlertDialog,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from '@/components/ui/alert-dialog'
import { Checkbox } from '@/components/ui/checkbox'
-import { ArrowLeft, Save, Send, AlertCircle, ThumbsUp, ThumbsDown } from 'lucide-react'
+import { cn } from '@/lib/utils'
+import { ArrowLeft, Save, Send, AlertCircle, ThumbsUp, ThumbsDown, Clock } from 'lucide-react'
import { toast } from 'sonner'
import type { EvaluationConfig } from '@/types/competition-configs'
@@ -235,25 +236,23 @@ export default function JuryEvaluatePage({ params: paramsPromise }: PageProps) {
// COI Dialog
if (!coiAccepted && showCOIDialog && evalConfig?.coiRequired !== false) {
return (
-
+
+
+
)
}
@@ -300,6 +299,48 @@ export default function JuryEvaluatePage({ params: paramsPromise }: PageProps) {
)
}
+ // Check if round is active and voting window is open
+ const now = new Date()
+ const isRoundActive = round.status === 'ROUND_ACTIVE'
+ const isWindowOpen = isRoundActive &&
+ round.windowOpenAt && round.windowCloseAt &&
+ new Date(round.windowOpenAt) <= now && new Date(round.windowCloseAt) >= now
+
+ if (!isWindowOpen) {
+ return (
+
+
+
+
+
+
+
+
+
+
+
Evaluation Not Available
+
+ {!isRoundActive
+ ? 'This round is not currently active. Evaluations can only be submitted during an active round.'
+ : 'The voting window for this round is not currently open. Please check back when the window opens.'}
+
Provide a score from 1 to 10 based on your overall assessment
diff --git a/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/page.tsx b/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/page.tsx
index a421f92..9c3a616 100644
--- a/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/page.tsx
+++ b/src/app/(jury)/jury/competitions/[roundId]/projects/[projectId]/page.tsx
@@ -22,6 +22,17 @@ export default function JuryProjectDetailPage() {
{ enabled: !!projectId }
)
+ const { data: round } = trpc.round.getById.useQuery(
+ { id: roundId },
+ { enabled: !!roundId }
+ )
+
+ // Determine if voting is currently open
+ const now = new Date()
+ const isVotingOpen = round?.status === 'ROUND_ACTIVE' &&
+ round?.windowOpenAt && round?.windowCloseAt &&
+ new Date(round.windowOpenAt) <= now && new Date(round.windowCloseAt) >= now
+
if (isLoading) {
return (
@@ -71,12 +82,18 @@ export default function JuryProjectDetailPage() {
{project.teamName}
)}
-
+ {isVotingOpen ? (
+
+ ) : (
+
+ Voting not open
+
+ )}
diff --git a/src/app/(jury)/jury/competitions/page.tsx b/src/app/(jury)/jury/competitions/page.tsx
index fe4654a..0b4d2c3 100644
--- a/src/app/(jury)/jury/competitions/page.tsx
+++ b/src/app/(jury)/jury/competitions/page.tsx
@@ -74,7 +74,7 @@ export default function JuryAssignmentsPage() {
No Assignments
- You don't have any active assignments yet.
+ You don't have any assignments yet. Assignments will appear once an administrator assigns projects to you.