Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions front_end/messages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1785,5 +1785,37 @@
"impersonationBannerText": "Momentálně si prohlížíte Metaculus jako váš bot.",
"stopImpersonating": "Přepnout zpět na můj účet",
"editedOnDate": "Upraveno dne {date}",
"tournamentsHeroLiveTitle": "Předpovídejte klíčová témata,<br></br>šplhejte po žebříčku, vyhrajte ceny.",
"tournamentsHeroLiveShown": "{count, plural, one {# turnaj zobrazen} other {# turnajů zobrazeno}}",
"tournamentsHeroSeriesTitle": "Předpovídejte klíčová témata,<br></br>procvičujte a budujte si záznamy.",
"tournamentsHeroSeriesShown": "{count, plural, one {# série otázek zobrazena} other {# sérií otázek zobrazeno}}",
"tournamentsHeroIndexesTitle": "Objevte složitá témata,<br></br>sledujte jejich vývoj.",
"tournamentsHeroIndexesShown": "{count, plural, one {# index zobrazen} other {# indexů zobrazeno}}",
"tournamentsInfoAria": "Informace o turnaji",
"tournamentsInfoCta": "Přihlaste se k soutěži",
"tournamentPrizePool": "CENOVÝ FOND",
"tournamentNoPrizePool": "ŽÁDNÝ CENOVÝ FOND",
"tournamentTimelineOngoing": "Probíhá",
"tournamentTimelineJustStarted": "Právě začalo",
"tournamentTimelineStarts": "Začíná {when}",
"tournamentTimelineEnds": "Končí {when}",
"tournamentTimelineAllResolved": "Všechny otázky vyřešeny",
"tournamentRelativeSoon": "brzy",
"tournamentRelativeUnderMinute": "za méně než minutu",
"tournamentRelativeFarFuture": "v daleké budoucnosti",
"tournamentRelativeFromNow": "za {n} {unit}",
"tournamentUnit": "{unit, select, minute {minuta} hour {hodina} day {den} week {týden} month {měsíc} year {rok} other {den}}",
"tournamentUnitPlural": "{unit, select, minute {minut} hour {hodin} day {dní} week {týdnů} month {měsíců} year {let} other {dní}}",
"tournamentQuestionsCount": "{count, plural, one {<num>#</num> otázka} other {<num>#</num> otázek}}",
"tournamentQuestionsCountUpper": "<n>{count}</n> OTÁZKY",
"tournamentsEmptySearchTitle": "Nebyly nalezeny žádné výsledky",
"tournamentsEmptySearchBody": "Zkuste jiný vyhledávací výraz nebo vymažte vyhledávání.",
"tournamentsEmptyDefaultTitle": "Zobrazeno {count} turnajů",
"tournamentsEmptyDefaultBody": "Zkontrolujte později nebo vyzkoušejte jinou kartu.",
"tournamentsTabLive": "Živé turnaje",
"tournamentsTabSeries": "Série otázek",
"tournamentsTabIndexes": "Indexy",
"tournamentsTabArchived": "Archivováno",
"tournamentTimelineClosed": "Čekání na vyřešení",
"othersCount": "Ostatní ({count})"
}
35 changes: 35 additions & 0 deletions front_end/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1779,5 +1779,40 @@
"switchToBotAccount": "Switch to Bot Account",
"impersonationBannerText": "You are currently viewing Metaculus as your bot.",
"stopImpersonating": "Switch back to my account",
"tournamentsHeroLiveTitle": "Forecast key topics,<br></br>climb the leaderboards, win prizes.",
"tournamentsHeroLiveShown": "{count, plural, one {# tournament shown} other {# tournaments shown}}",
"tournamentsHeroSeriesTitle": "Forecast key topics,<br></br>practice and build a track record.",
"tournamentsHeroSeriesShown": "{count, plural, one {# question series shown} other {# question series shown}}",
"tournamentsHeroIndexesTitle": "Discover complex topics,<br></br>monitor their progress.",
"tournamentsHeroIndexesShown": "{count, plural, one {# index shown} other {# indexes shown}}",
"tournamentsInfoAria": "Tournament info",
"tournamentsInfoTitle": "We are <predmarket>not a prediction market</predmarket>. You can participate for free and win cash prizes for being accurate.",
"tournamentsInfoScoringLink": "What are forecasting scores?",
"tournamentsInfoPrizesLink": "How are prizes distributed?",
"tournamentsInfoCta": "Sign up to compete",
"tournamentPrizePool": "PRIZE POOL",
"tournamentNoPrizePool": "NO PRIZE POOL",
"tournamentTimelineOngoing": "Ongoing",
"tournamentTimelineJustStarted": "Just started",
"tournamentTimelineStarts": "Starts {when}",
"tournamentTimelineEnds": "Ends {when}",
"tournamentTimelineClosed": "Waiting resolutions",
"tournamentTimelineAllResolved": "All questions resolved",
"tournamentRelativeSoon": "soon",
"tournamentRelativeUnderMinute": "in under a minute",
"tournamentRelativeFarFuture": "in the far future",
"tournamentRelativeFromNow": "{n} {unit} from now",
"tournamentUnit": "{unit, select, minute {minute} hour {hour} day {day} week {week} month {month} year {year} other {day}}",
"tournamentUnitPlural": "{unit, select, minute {minutes} hour {hours} day {days} week {weeks} month {months} year {years} other {days}}",
"tournamentQuestionsCount": "{count, plural, one {<num>#</num> question} other {<num>#</num> questions}}",
"tournamentQuestionsCountUpper": "<n>{count}</n> QUESTIONS",
"tournamentsEmptySearchTitle": "No results found",
"tournamentsEmptySearchBody": "Try a different search term, or clear the search.",
"tournamentsEmptyDefaultTitle": "{count} tournaments shown",
"tournamentsEmptyDefaultBody": "Check back later or try another tab.",
"tournamentsTabLive": "Live Tournaments",
"tournamentsTabSeries": "Question Series",
"tournamentsTabIndexes": "Indexes",
"tournamentsTabArchived": "Archived",
"none": "none"
}
32 changes: 32 additions & 0 deletions front_end/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1785,5 +1785,37 @@
"impersonationBannerText": "Actualmente estás viendo Metaculus como tu bot.",
"stopImpersonating": "Volver a mi cuenta",
"editedOnDate": "Editado el {date}",
"tournamentsHeroLiveTitle": "Pronostica temas clave,<br></br>súbete al marcador, gana premios.",
"tournamentsHeroLiveShown": "{count, plural, one {# torneo mostrado} other {# torneos mostrados}}",
"tournamentsHeroSeriesTitle": "Pronostica temas clave,<br></br>practica y construye un historial.",
"tournamentsHeroSeriesShown": "{count, plural, one {# serie de preguntas mostrada} other {# series de preguntas mostradas}}",
"tournamentsHeroIndexesTitle": "Descubre temas complejos,<br></br>monitorea su progreso.",
"tournamentsHeroIndexesShown": "{count, plural, one {# índice mostrado} other {# índices mostrados}}",
"tournamentsInfoAria": "Información del torneo",
"tournamentsInfoCta": "Regístrate para competir",
"tournamentPrizePool": "PREMIO TOTAL",
"tournamentNoPrizePool": "SIN PREMIO TOTAL",
"tournamentTimelineOngoing": "En curso",
"tournamentTimelineJustStarted": "Acaba de comenzar",
"tournamentTimelineStarts": "Comienza {when}",
"tournamentTimelineEnds": "Termina {when}",
"tournamentTimelineAllResolved": "Todas las preguntas resueltas",
"tournamentRelativeSoon": "pronto",
"tournamentRelativeUnderMinute": "en menos de un minuto",
"tournamentRelativeFarFuture": "en el futuro lejano",
"tournamentRelativeFromNow": "{n} {unit} a partir de ahora",
"tournamentUnit": "{unit, select, minute {minuto} hour {hora} day {día} week {semana} month {mes} year {año} other {día}}",
"tournamentUnitPlural": "{unit, select, minute {minutos} hour {horas} day {días} week {semanas} month {meses} year {años} other {días}}",
"tournamentQuestionsCount": "{count, plural, one {<num>#</num> pregunta} other {<num>#</num> preguntas}}",
"tournamentQuestionsCountUpper": "<n>{count}</n> PREGUNTAS",
"tournamentsEmptySearchTitle": "No se encontraron resultados",
"tournamentsEmptySearchBody": "Prueba un término de búsqueda diferente o borra la búsqueda.",
"tournamentsEmptyDefaultTitle": "{count} torneos mostrados",
"tournamentsEmptyDefaultBody": "Vuelve más tarde o prueba otra pestaña.",
"tournamentsTabLive": "Torneos en Vivo",
"tournamentsTabSeries": "Series de Preguntas",
"tournamentsTabIndexes": "Índices",
"tournamentsTabArchived": "Archivado",
"tournamentTimelineClosed": "Esperando resoluciones",
"othersCount": "Otros ({count})"
}
32 changes: 32 additions & 0 deletions front_end/messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1783,5 +1783,37 @@
"impersonationBannerText": "Você está visualizando o Metaculus atualmente como seu bot.",
"stopImpersonating": "Voltar para minha conta",
"editedOnDate": "Editado em {date}",
"tournamentsHeroLiveTitle": "Preveja tópicos chave,<br></br>suba nas classificações, ganhe prêmios.",
"tournamentsHeroLiveShown": "{count, plural, one {# torneio mostrado} other {# torneios mostrados}}",
"tournamentsHeroSeriesTitle": "Preveja tópicos chave,<br></br>pratique e construa um histórico.",
"tournamentsHeroSeriesShown": "{count, plural, one {# série de perguntas mostrada} other {# séries de perguntas mostradas}}",
"tournamentsHeroIndexesTitle": "Descubra tópicos complexos,<br></br>monitore o progresso deles.",
"tournamentsHeroIndexesShown": "{count, plural, one {# índice mostrado} other {# índices mostrados}}",
"tournamentsInfoAria": "Informações do Torneio",
"tournamentsInfoCta": "Inscreva-se para competir",
"tournamentPrizePool": "PRÊMIO",
"tournamentNoPrizePool": "SEM PRÊMIO",
"tournamentTimelineOngoing": "Em andamento",
"tournamentTimelineJustStarted": "Acabou de começar",
"tournamentTimelineStarts": "Começa {when}",
"tournamentTimelineEnds": "Termina {when}",
"tournamentTimelineAllResolved": "Todas as perguntas resolvidas",
"tournamentRelativeSoon": "em breve",
"tournamentRelativeUnderMinute": "em menos de um minuto",
"tournamentRelativeFarFuture": "no futuro distante",
"tournamentRelativeFromNow": "em {n} {unit}",
"tournamentUnit": "{unit, select, minute {minuto} hour {hora} day {dia} week {semana} month {mês} year {ano} other {dia}}",
"tournamentUnitPlural": "{unit, select, minute {minutos} hour {horas} day {dias} week {semanas} month {meses} year {anos} other {dias}}",
"tournamentQuestionsCount": "{count, plural, one {<num>#</num> pergunta} other {<num>#</num> perguntas}}",
"tournamentQuestionsCountUpper": "<n>{count}</n> PERGUNTAS",
"tournamentsEmptySearchTitle": "Nenhum resultado encontrado",
"tournamentsEmptySearchBody": "Tente um termo de pesquisa diferente ou limpe a pesquisa.",
"tournamentsEmptyDefaultTitle": "{count} torneios mostrados",
"tournamentsEmptyDefaultBody": "Volte mais tarde ou tente outra aba.",
"tournamentsTabLive": "Torneios ao Vivo",
"tournamentsTabSeries": "Série de Perguntas",
"tournamentsTabIndexes": "Índices",
"tournamentsTabArchived": "Arquivado",
"tournamentTimelineClosed": "Aguardando resoluções",
"othersCount": "Outros ({count})"
}
32 changes: 32 additions & 0 deletions front_end/messages/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -1782,5 +1782,37 @@
"impersonationBannerText": "您目前正在以您的機器人帳戶查看 Metaculus。",
"stopImpersonating": "切換回我的帳戶",
"editedOnDate": "編輯於 {date}",
"tournamentsHeroLiveTitle": "預測關鍵議題,<br></br>攀登排行榜,贏得獎品。",
"tournamentsHeroLiveShown": "{count, plural, one {顯示 # 個錦標賽} other {顯示 # 個錦標賽}}",
"tournamentsHeroSeriesTitle": "預測關鍵議題,<br></br>練習並建立成果紀錄。",
"tournamentsHeroSeriesShown": "{count, plural, one {顯示 # 個問題系列} other {顯示 # 個問題系列}}",
"tournamentsHeroIndexesTitle": "探索複雜議題,<br></br>監控其進展。",
"tournamentsHeroIndexesShown": "{count, plural, one {顯示 # 個指數} other {顯示 # 個指數}}",
"tournamentsInfoAria": "錦標賽資訊",
"tournamentsInfoCta": "註冊參賽",
"tournamentPrizePool": "獎金池",
"tournamentNoPrizePool": "無獎金池",
"tournamentTimelineOngoing": "進行中",
"tournamentTimelineJustStarted": "剛剛開始",
"tournamentTimelineStarts": "{when} 開始",
"tournamentTimelineEnds": "{when} 結束",
"tournamentTimelineAllResolved": "所有問題已解決",
"tournamentRelativeSoon": "即將",
"tournamentRelativeUnderMinute": "在不到一分鐘內",
"tournamentRelativeFarFuture": "在遙遠的未來",
"tournamentRelativeFromNow": "{n} {unit} 後",
"tournamentUnit": "{unit, select, minute {分鐘} hour {小時} day {天} week {週} month {月} year {年} other {天}}",
"tournamentUnitPlural": "{unit, select, minute {分鐘} hour {小時} day {天} week {週} month {月} year {年} other {天}}",
"tournamentQuestionsCount": "{count, plural, one {<num>#</num> 個問題} other {<num>#</num> 個問題}}",
"tournamentQuestionsCountUpper": "<n>{count}</n> 題問題",
"tournamentsEmptySearchTitle": "找不到結果",
"tournamentsEmptySearchBody": "嘗試使用不同的搜索詞,或清除搜索。",
"tournamentsEmptyDefaultTitle": "顯示 {count} 個比賽",
"tournamentsEmptyDefaultBody": "稍後再查看或嘗試其他標籤。",
"tournamentsTabLive": "現場錦標賽",
"tournamentsTabSeries": "問答系列",
"tournamentsTabIndexes": "指數",
"tournamentsTabArchived": "已存檔",
"tournamentTimelineClosed": "等待裁定",
"withdrawAfterPercentSetting2": "問題總生命周期後撤回"
}
32 changes: 32 additions & 0 deletions front_end/messages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1787,5 +1787,37 @@
"impersonationBannerText": "您当前正在以机器人身份查看 Metaculus。",
"stopImpersonating": "切换回我的账户",
"editedOnDate": "编辑于 {date}",
"tournamentsHeroLiveTitle": "预测关键话题,<br></br>登上排行榜,赢得奖品。",
"tournamentsHeroLiveShown": "{count, plural, one {显示#场锦标赛} other {显示#场锦标赛}}",
"tournamentsHeroSeriesTitle": "预测关键话题,<br></br>实践并建立记录。",
"tournamentsHeroSeriesShown": "{count, plural, one {显示#个问题系列} other {显示#个问题系列}}",
"tournamentsHeroIndexesTitle": "发现复杂话题,<br></br>监控其进展。",
"tournamentsHeroIndexesShown": "{count, plural, one {显示#个指数} other {显示#个指数}}",
"tournamentsInfoAria": "比赛信息",
"tournamentsInfoCta": "注册参赛",
"tournamentPrizePool": "奖金池",
"tournamentNoPrizePool": "无奖金池",
"tournamentTimelineOngoing": "进行中",
"tournamentTimelineJustStarted": "刚刚开始",
"tournamentTimelineStarts": "开始于{when}",
"tournamentTimelineEnds": "结束于{when}",
"tournamentTimelineAllResolved": "所有问题已解决",
"tournamentRelativeSoon": "很快",
"tournamentRelativeUnderMinute": "不到一分钟",
"tournamentRelativeFarFuture": "在遥远的未来",
"tournamentRelativeFromNow": "{n}{unit}后",
"tournamentUnit": "{unit, select, minute {分钟} hour {小时} day {天} week {周} month {个月} year {年} other {天}}",
"tournamentUnitPlural": "{unit, select, minute {分钟} hour {小时} day {天} week {周} month {个月} year {年} other {天}}",
"tournamentQuestionsCount": "{count, plural, one {<num>#</num> 个问题} other {<num>#</num> 个问题}}",
"tournamentQuestionsCountUpper": "<n>{count}</n> 题目",
"tournamentsEmptySearchTitle": "未找到结果",
"tournamentsEmptySearchBody": "尝试不同的搜索词,或清除搜索。",
"tournamentsEmptyDefaultTitle": "显示了 {count} 场比赛",
"tournamentsEmptyDefaultBody": "稍后再查看或尝试其他选项卡。",
"tournamentsTabLive": "直播锦标赛",
"tournamentsTabSeries": "问题系列",
"tournamentsTabIndexes": "索引",
"tournamentsTabArchived": "已归档",
"tournamentTimelineClosed": "等待解决",
"othersCount": "其他({count})"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { BotLeaderboardStatus, Tournament } from "@/types/projects";
import cn from "@/utils/core/cn";
import { formatDate } from "@/utils/formatters/date";

import GradientProgressLine from "./gradient_progress_line";

type Props = {
tournament: Tournament;
latestScheduledCloseTimestamp: number;
Expand Down Expand Up @@ -66,15 +68,13 @@ const ActiveTournamentTimeline: FC<Props> = async ({
{t("closes")}
</p>
</div>
<div className="relative my-2.5 flex h-1 w-full rounded bg-blue-400 dark:bg-blue-400-dark sm:my-3">
{!isUpcoming && (
<div
className="relative h-full rounded bg-blue-700 dark:bg-blue-700-dark"
style={{ width: `${progressPercentage}%` }}
>
<TimelineArrow progressPercentage={progressPercentage} />
</div>
<div className="relative my-2.5 w-full sm:my-3">
{!isUpcoming ? (
<GradientProgressLine pct={progressPercentage} />
) : (
<div className="h-1 w-full rounded bg-blue-400 dark:bg-blue-400-dark" />
)}

{lastParticipationDayTimestamp && lastParticipationPosition && (
<LastDayParticipationChip
lastParticipationDayTimestamp={lastParticipationDayTimestamp}
Expand Down Expand Up @@ -145,28 +145,6 @@ const LastDayParticipationChip: FC<{
);
};

const TimelineArrow: FC<{
progressPercentage: number;
}> = ({ progressPercentage }) => (
<div
className={cn(
"absolute left-full top-[50%] -translate-x-1/2 -translate-y-1/2",
progressPercentage < 3 && "hidden"
)}
>
<div
className={cn(
"h-3 w-[4px] origin-bottom-right -rotate-45 rounded-full bg-blue-700 dark:bg-blue-700-dark"
)}
/>
<div
className={cn(
"h-3 w-[4px] origin-top-right rotate-45 rounded-full bg-blue-700 dark:bg-blue-700-dark"
)}
/>
</div>
);

function calculateLastParticipationPosition(
lastParticipationDayTimestamp: number | null,
startDate: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"use client";

import React from "react";

import cn from "@/utils/core/cn";

type Props = {
pct: number;
className?: string;
trackClassName?: string;
fillClassName?: string;
dotClassName?: string;
edgeInsetPx?: number;
};

const GradientProgressLine: React.FC<Props> = ({
pct,
className,
trackClassName,
fillClassName,
dotClassName,
edgeInsetPx = 5,
}) => {
const clamped = Math.max(0, Math.min(100, pct));
const left = `${clamped}%`;
const thumbLeft = `clamp(${edgeInsetPx}px, ${left}, calc(100% - ${edgeInsetPx}px))`;

return (
<div
className={cn(
"relative h-1 w-full rounded-full",
"bg-blue-400 dark:bg-blue-400-dark",
className,
trackClassName
)}
>
<div
className={cn(
"h-full rounded-full",
"bg-gradient-to-r from-blue-200 to-blue-700 dark:from-blue-200-dark dark:to-blue-700-dark",
fillClassName
)}
style={{ width: `${clamped}%` }}
/>

<div
className={cn(
"absolute top-1/2 h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full",
"bg-blue-700 dark:bg-blue-700-dark",
dotClassName
)}
style={{ left: thumbLeft }}
/>
</div>
);
};

export default GradientProgressLine;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import ServerProjectsApi from "@/services/api/projects/projects.server";

import ArchivedTournamentsGrid from "../components/tournaments_grid/archived_tournaments_grid";
import TournamentsScreen from "../components/tournaments_screen";

const ArchivedPage: React.FC = async () => {
const tournaments = await ServerProjectsApi.getTournaments();
const nowTs = Date.now();
return (
<TournamentsScreen
current="archived"
tournaments={tournaments}
nowTs={nowTs}
>
<ArchivedTournamentsGrid />
</TournamentsScreen>
);
};

export default ArchivedPage;
Loading