diff --git a/src/app/(award-master)/award-master/awards/[id]/page.tsx b/src/app/(award-master)/award-master/awards/[id]/page.tsx index 11debf0..f24adbc 100644 --- a/src/app/(award-master)/award-master/awards/[id]/page.tsx +++ b/src/app/(award-master)/award-master/awards/[id]/page.tsx @@ -42,6 +42,7 @@ import { import { cn } from '@/lib/utils' import { CountryDisplay } from '@/components/shared/country-display' import { ProjectFilesSection } from '@/components/jury/project-files-section' +import { ProjectLogo } from '@/components/shared/project-logo' export default function AwardMasterVotingPage({ params, @@ -254,7 +255,8 @@ export default function AwardMasterVotingPage({ onClick={() => handleProjectClick(project.id)} > -
+
+
{project.title} diff --git a/src/app/(jury)/jury/page.tsx b/src/app/(jury)/jury/page.tsx index a11151c..cc259c2 100644 --- a/src/app/(jury)/jury/page.tsx +++ b/src/app/(jury)/jury/page.tsx @@ -132,6 +132,17 @@ async function JuryDashboardContent() { const juryCompareEnabled = compareFlag?.value === 'true' + // Check which awards the user has already voted on + const awardIds = myAwardJurorRecords.map((r) => r.award.id) + const myAwardVotes = awardIds.length > 0 + ? await prisma.awardVote.groupBy({ + by: ['awardId'], + where: { userId, awardId: { in: awardIds } }, + _count: { id: true }, + }) + : [] + const votedAwardIds = new Set(myAwardVotes.filter((v) => v._count.id > 0).map((v) => v.awardId)) + // Awards where voting is open const activeAwards = myAwardJurorRecords.filter( (r) => r.award.status === 'VOTING_OPEN' @@ -314,35 +325,50 @@ async function JuryDashboardContent() { const award = record.award const deadline = award.votingEndAt ? new Date(award.votingEndAt) : null const isUrgent = deadline && (deadline.getTime() - now.getTime()) < 24 * 60 * 60 * 1000 + const hasVoted = votedAwardIds.has(award.id) return (
-

{award.name}

+

{award.name}

{award._count.eligibilities} project{award._count.eligibilities !== 1 ? 's' : ''} to review {record.isChair && ' ยท You are the Chair'}

- - Vote Now - + {hasVoted ? ( + + + Submitted + + ) : ( + + Vote Now + + )}
{deadline && ( )} - diff --git a/src/server/routers/specialAward.ts b/src/server/routers/specialAward.ts index 98c1b1d..6a0416b 100644 --- a/src/server/routers/specialAward.ts +++ b/src/server/routers/specialAward.ts @@ -818,6 +818,7 @@ export const specialAwardRouter = router({ select: { id: true, title: true, teamName: true, description: true, competitionCategory: true, country: true, tags: true, + logoKey: true, logoProvider: true, }, }, }, @@ -886,12 +887,15 @@ export const specialAwardRouter = router({ })) } + const projectsWithScores = eligibleProjects.map((e) => ({ + ...e.project, + evaluationScore: projectScores[e.project.id] ?? null, + })) + const projectsWithLogos = await attachProjectLogoUrls(projectsWithScores) + return { award, - projects: eligibleProjects.map((e) => ({ - ...e.project, - evaluationScore: projectScores[e.project.id] ?? null, - })), + projects: projectsWithLogos, myVotes, isChair, otherVotes,