Skip to content

Commit 3ccc18f

Browse files
committed
update emails
fix tests
1 parent 013f88d commit 3ccc18f

16 files changed

Lines changed: 77 additions & 112 deletions

File tree

front_end/messages/cs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@
939939
"settingsChangeEmailAddress": "Změnit e-mailovou adresu",
940940
"settingsChangeEmailAddressSuccess": "Na váš nový e-mail byla zaslána potvrzovací zpráva. Prosím, následujte odkaz uvnitř pro aktivaci.",
941941
"choices": "Možnosti",
942+
"choicesLockedHelp": "Možnosti lze po zahájení prognózování měnit pouze v administrátorském panelu.",
942943
"inCommunityReviewStatus1": "Tato otázka potřebuje schválení od kurátora komunity jako jste vy. Můžete také provádět úpravy, označit autora v komentáři níže, poslat otázku zpět k návrhu na revizi nebo otázku zamítnout. Několik návrhů na kvalitní otázky:",
943944
"inCommunityReviewStatus2": "<li>Definujte pojmy a buďte konkrétní. Odkazy jsou užitečné.</li> <li>Otázky by se měly dát jednoduše vyřešit a neměly by vyžadovat velké úsilí administrátora.</li> <li>Název a formulace otázky by měly být v souladu s kritérii pro vyřešení.</li> <li>Zkuste tento test: Lidé v budoucnosti se shodnou, jak byla tato otázka vyřešena. Pokud nemohou, je třeba ji objasnit</li>",
944945
"bulkEdit": "Hromadná úprava",

front_end/messages/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@
952952
"resolutionCriteriaExplanation": "A good question will almost always resolve unambiguously. If you have a data source by which the question will resolve, link to it here. If there is some simple math that will need to be done to resolve this question, define the equation in markdown: <markdown>\\[ y = ax^2+b \\]</markdown>.",
953953
"choices": "Choices",
954954
"choicesSeparatedBy": "Choices (separated by ,)",
955+
"choicesLockedHelp": "Options can only be changed through the admin panel once forecasting has started.",
955956
"projects": "projects",
956957
"FABPrizePool": "PRIZE POOL",
957958
"FABPrizeValue": "$30,000",

front_end/messages/es.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,5 +1882,10 @@
18821882
"futureEval": "EvaluaciónFutura",
18831883
"launchATournament": "Iniciar un Torneo",
18841884
"allCategoriesTopQuestions": "Principales preguntas en cada categoría",
1885+
"periodDays": "{count, plural, one {# día} other {# días}}",
1886+
"periodHours": "{count, plural, one {# hora} other {# horas}}",
1887+
"periodMinutes": "{count, plural, one {# minuto} other {# minutos}}",
1888+
"periodSeconds": "{count, plural, one {# segundo} other {# segundos}}",
1889+
"choicesLockedHelp": "Las opciones solo se pueden cambiar a través del panel de administración una vez que haya comenzado la previsión.",
18851890
"thousandsOfOpenQuestions": "20,000+ preguntas abiertas"
18861891
}

front_end/messages/pt.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,5 +1880,10 @@
18801880
"futureEval": "FutureEval",
18811881
"launchATournament": "Lançar um Torneio",
18821882
"allCategoriesTopQuestions": "Principais perguntas em cada categoria",
1883+
"periodDays": "{count, plural, one {# dia} other {# dias}}",
1884+
"periodHours": "{count, plural, one {# hora} other {# horas}}",
1885+
"periodMinutes": "{count, plural, one {# minuto} other {# minutos}}",
1886+
"periodSeconds": "{count, plural, one {# segundo} other {# segundos}}",
1887+
"choicesLockedHelp": "As opções só podem ser alteradas através do painel de administração uma vez iniciado o processo de previsão.",
18831888
"thousandsOfOpenQuestions": "20.000+ perguntas abertas"
18841889
}

front_end/messages/zh-TW.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,5 +1879,10 @@
18791879
"tournamentsInfoScoringLink": "什麼是預測得分?",
18801880
"tournamentsInfoPrizesLink": "獎品如何分配?",
18811881
"allCategoriesTopQuestions": "每個類別中的熱門問題",
1882+
"periodDays": "{count, plural, one {# 天} other {# 天}}",
1883+
"periodHours": "{count, plural, one {# 小時} other {# 小時}}",
1884+
"periodMinutes": "{count, plural, one {# 分鐘} other {# 分鐘}}",
1885+
"periodSeconds": "{count, plural, one {# 秒} other {# 秒}}",
1886+
"choicesLockedHelp": "一旦預測開始後,選項只能透過管理平台進行更改。",
18821887
"thousandsOfOpenQuestions": "20,000+ 開放問題"
18831888
}

front_end/messages/zh.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,5 +1884,10 @@
18841884
"futureEval": "未来评估",
18851885
"launchATournament": "发起比赛",
18861886
"allCategoriesTopQuestions": "每个类别的热门问题",
1887+
"periodDays": "{count, plural, one {# 天} other {# 天}}",
1888+
"periodHours": "{count, plural, one {# 小时} other {# 小时}}",
1889+
"periodMinutes": "{count, plural, one {# 分钟} other {# 分钟}}",
1890+
"periodSeconds": "{count, plural, one {# 秒} other {# 秒}}",
1891+
"choicesLockedHelp": "选项一旦预测开始,只能通过管理面板进行更改。",
18871892
"thousandsOfOpenQuestions": "20,000+ 开放问题"
18881893
}

front_end/src/app/(main)/questions/[id]/components/multiple_choices_chart_view/choices_legend/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ const ChoicesLegend: FC<Props> = ({
7878
color={color.DEFAULT}
7979
checked={active}
8080
onChange={(checked) => onChoiceChange(choice, checked)}
81-
onHighlight={(highlighted) => onChoiceHighlight(choice, highlighted)}
81+
onHighlight={(highlighted) =>
82+
onChoiceHighlight(choice, highlighted)
83+
}
8284
/>
8385
);
8486
})}

front_end/src/app/(main)/questions/components/question_form.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ const QuestionForm: FC<Props> = ({
309309
const router = useRouter();
310310
const t = useTranslations();
311311
const { isDone, hasForecasts } = getQuestionStatus(post);
312+
const optionsLocked = hasForecasts && mode !== "create";
312313
const [isLoading, setIsLoading] = useState<boolean>();
313314
const [error, setError] = useState<
314315
(Error & { digest?: string }) | undefined
@@ -782,19 +783,25 @@ const QuestionForm: FC<Props> = ({
782783
/>
783784
</InputContainer>
784785
<div className="flex-col">
785-
<InputContainer labelText={t("choices")} />
786+
<InputContainer
787+
labelText={t("choices")}
788+
explanation={optionsLocked ? t("choicesLockedHelp") : undefined}
789+
/>
786790
{optionsList && (
787791
<div className="flex flex-col">
788792
{optionsList.map((option, opt_index) => (
789793
<div key={opt_index} className="flex">
790794
<div className="w-full">
791795
<Input
792796
{...form.register(`options.${opt_index}`)}
793-
readOnly={hasForecasts && mode !== "create"}
797+
readOnly={optionsLocked}
794798
className="my-2 w-full min-w-32 rounded border border-gray-500 p-2 px-3 py-2 text-base dark:border-gray-500-dark dark:bg-blue-50-dark"
795799
value={option}
796800
placeholder={`Option ${opt_index + 1}`}
797801
onChange={(e) => {
802+
if (optionsLocked) {
803+
return;
804+
}
798805
setOptionsList(
799806
optionsList.map((opt, index) => {
800807
if (index === opt_index) {
@@ -810,7 +817,7 @@ const QuestionForm: FC<Props> = ({
810817
}
811818
/>
812819
</div>
813-
{opt_index >= MIN_OPTIONS_AMOUNT && !hasForecasts && (
820+
{opt_index >= MIN_OPTIONS_AMOUNT && !optionsLocked && (
814821
<Button
815822
className="my-2 h-[42px] w-max self-start capitalize"
816823
variant="text"
@@ -833,6 +840,7 @@ const QuestionForm: FC<Props> = ({
833840
)}
834841
<Button
835842
className="w-max capitalize"
843+
disabled={optionsLocked}
836844
onClick={() => setOptionsList([...optionsList, ""])}
837845
>
838846
+ {t("addOption")}

notifications/templates/emails/multiple_choice_option_addition.html

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -158,30 +158,6 @@
158158
</table>
159159
</div>
160160
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" bgcolor="#ffffff" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
161-
<div style="background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;">
162-
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;">
163-
<tbody>
164-
<tr>
165-
<td style="direction:ltr;font-size:0px;padding:20px 0;padding-bottom:16px;padding-top:10px;text-align:center;">
166-
<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->
167-
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
168-
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
169-
<tbody>
170-
<tr>
171-
<td align="left" class="general-text" style="font-size:0px;padding:10px 25px;padding-bottom:8px;word-break:break-word;">
172-
<div style="font-family:Inter Variable, Inter, Arial, sans-serif;font-size:16px;line-height:24px;text-align:left;color:#161C22;">Hello {{recipient.username}},</div>
173-
</td>
174-
</tr>
175-
</tbody>
176-
</table>
177-
</div>
178-
<!--[if mso | IE]></td></tr></table><![endif]-->
179-
</td>
180-
</tr>
181-
</tbody>
182-
</table>
183-
</div>
184-
<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" bgcolor="#ffffff" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
185161
<div style="background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;">
186162
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;">
187163
<tbody>

notifications/templates/emails/multiple_choice_option_addition.mjml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
<mj-body>
55
<mj-include path="../../../templates/emails/email_top.mjml"/>
66

7-
<mj-section background-color="#ffffff" padding-bottom="16px">
8-
<mj-column>
9-
<mj-text font-size="16px" color="#161C22" padding-bottom="8px">
10-
Hello {{recipient.username}},
11-
</mj-text>
12-
</mj-column>
13-
</mj-section>
14-
157
<mj-section background-color="#ffffff" padding="0px">
168
<mj-column>
179
<mj-text padding="0px">

0 commit comments

Comments
 (0)