diff --git a/.gitignore b/.gitignore index 7265f9e95a442d663b4457d381e5643788dd582d..a8d7487fe79cd2bdcd5087ef56783800cafa0f01 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ node_modules/ pnpm-lock.yaml target/ .direnv/ -nix-direnv-reload \ No newline at end of file +nix-direnv-reload +dist.zip diff --git a/client/dist.zip b/client/dist.zip index 14c374e5a3a5633790ef506b0673d72b7b86b7c1..a09eaf598ae56db5b645a15b5fe74efa15e0463e 100644 Binary files a/client/dist.zip and b/client/dist.zip differ diff --git a/client/public/doc/politiquebcapg.pdf b/client/public/doc/Politique_BIPCV.pdf similarity index 100% rename from client/public/doc/politiquebcapg.pdf rename to client/public/doc/Politique_BIPCV.pdf diff --git a/client/public/doc/Politique_de_disciplineEN.pdf b/client/public/doc/Politique_de_discipline_EN.pdf similarity index 100% rename from client/public/doc/Politique_de_disciplineEN.pdf rename to client/public/doc/Politique_de_discipline_EN.pdf diff --git a/client/public/doc/Politique_de_disciplineFR.pdf b/client/public/doc/Politique_de_discipline_FR.pdf similarity index 100% rename from client/public/doc/Politique_de_disciplineFR.pdf rename to client/public/doc/Politique_de_discipline_FR.pdf diff --git a/client/public/doc/Reglement_CQI_FR.pdf b/client/public/doc/Reglement_CQI_FR.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ad0ad5d3eb6eb2a18116e4b31ec37ad7afa246a6 Binary files /dev/null and b/client/public/doc/Reglement_CQI_FR.pdf differ diff --git a/client/public/doc/Rulebook_QEC_EN.pdf b/client/public/doc/Rulebook_QEC_EN.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5cca1ad9b8ce4f1ccbb6632412b26f7eada22b85 Binary files /dev/null and b/client/public/doc/Rulebook_QEC_EN.pdf differ diff --git a/client/src/binding/MinimalParticipant.ts b/client/src/binding/MinimalParticipant.ts index be03e0913a13f2898b20c7bb230da140e8104e26..28d91434ff410296b27fbf86ba2acca38b721c48 100644 --- a/client/src/binding/MinimalParticipant.ts +++ b/client/src/binding/MinimalParticipant.ts @@ -6,6 +6,7 @@ import type { University } from "./University"; export type MinimalParticipant = { first_name: string; last_name: string; + food_forms_completed: boolean | null; email: string; competition: Competition; university: University; diff --git a/client/src/binding/ParticipantInfo.ts b/client/src/binding/ParticipantInfo.ts index 478feff08608addd51019cd666ee53efeedf5137..b7789bcd627e4217d84c83a36595c588311620ce 100644 --- a/client/src/binding/ParticipantInfo.ts +++ b/client/src/binding/ParticipantInfo.ts @@ -10,6 +10,7 @@ export type ParticipantInfo = { last_name: string | null; email: string | null; role: Role | null; + food_forms_completed: boolean | null; competition: Competition | null; university: University | null; medical_conditions: string | null; diff --git a/client/src/components/forms/AdditionnalInfoForm.tsx b/client/src/components/forms/AdditionnalInfoForm.tsx index b012ecc049cb6479ed0a01fdca9f1d18ec5706dc..f983bce6739385d2be6f2a3544bb1e699e39d9b7 100644 --- a/client/src/components/forms/AdditionnalInfoForm.tsx +++ b/client/src/components/forms/AdditionnalInfoForm.tsx @@ -10,7 +10,7 @@ import { Select } from "../forms-component/Select" import { FileInput } from "../forms-component/FileInput" import { getParticipant, patchParticipantInfo } from "../../request/routes" import { createEffect, createSignal } from "solid-js" -import { t } from "../../stores/locale" +import { locale, t } from "../../stores/locale" import { SubmitError } from "../forms-component/SubmitError" import { SubmitSuccess } from "../forms-component/SubmitSuccess" import { YesNo } from "../forms-component/YesNo" @@ -58,6 +58,21 @@ export function AdditionalInfoForm() { Lien pour le formulaire des repas à remplir aussi </span> </a> + <Field + name="food_forms_completed" + type="boolean" + validate={[required(t("additionalInfo.required"))]} + > + {(field, props) => ( + <YesNo + {...props} + value={"no"} + error={field.error} + label={t("additionalInfo.food")} + required + /> + )} + </Field> <div class="flex w-full flex-col gap-1 font-medium md:text-lg lg:text-xl"> <span> Bonjour {info()?.first_name} {info()?.last_name} @@ -362,46 +377,108 @@ export function AdditionalInfoForm() { )} </Field> - <div class="text-xl"> - <p> - En cliquant sur mettre à jour les renseignements personnels - </p> - <ul class="list-disc"> - <li> - J'ai lu et j'accepte{" "} - <a - href="/public/doc/Politique_de_disciplineFR.pdf" - target="_blank" - class="text-blue-500" - > - la politique de discipline de la CREIQ. - </a> - </li> - <li> - J'ai lu et j'accepte{" "} - <a - href="/public/doc/politiquebcapg.pdf" - target="_blank" - class="text-blue-500" - > - le code de conduite du BCAPG - </a> - </li> - <li> - Je consens à ce que mon image sur les photographies - ainsi que ma voix et mon image dans les enregistrements - vidéo soient utilisés pour tout type de promotion de la - CQI ou de la CREIQ. - </li> - <li> - Je consens à ce que mon adresse courriel soit transmise - à Génium et que ceux-ci me transmettent des offres - promotionnelles. Il sera possible de se retirer de cette - liste de courriel à tout moment à la suite de la - compétition. - </li> - </ul> - </div> + {locale() == "fr" && ( + <div class="text-xl"> + <p> + En cliquant sur mettre à jour les renseignements + personnels + </p> + <ul class="list-disc"> + <li> + J'ai lu et j'accepte{" "} + <a + href="/doc/Politique_de_discipline_FR.pdf" + target="_blank" + class="text-blue-500" + > + la politique de discipline de la CREIQ. + </a> + </li> + <li> + J'ai lu et j'accepte{" "} + <a + href="/doc/Politique_BIPCV.pdf" + target="_blank" + class="text-blue-500" + > + le code de conduite du BIPCV + </a> + </li> + <li> + J'ai lu et j'accepte{" "} + <a + href="/doc/Reglement_CQI_FR.pdf" + target="_blank" + class="text-blue-500" + > + le règlement de la CQI. + </a> + </li> + <li> + Je consens à ce que mon image sur les photographies + ainsi que ma voix et mon image dans les + enregistrements vidéo soient utilisés pour tout type + de promotion de la CQI ou de la CREIQ. + </li> + <li> + Je consens à ce que mon adresse courriel soit + transmise à Génium et que ceux-ci me transmettent + des offres promotionnelles. Il sera possible de se + retirer de cette liste de courriel à tout moment à + la suite de la compétition. + </li> + </ul> + </div> + )} + + {locale() == "en" && ( + <div class="text-xl"> + <p>By clicking on "Update personal information":</p> + <ul class="list-disc"> + <li> + I have read and agree to{" "} + <a + href="/doc/Politique_de_discipline_EN.pdf" + target="_blank" + class="text-blue-500" + > + the CREIQ disciplinary policy. + </a> + </li> + <li> + I have read and agree to{" "} + <a + href="/doc/Politique_BIPCV.pdf" + target="_blank" + class="text-blue-500" + > + the BIPCV code of conduct. + </a> + </li> + <li> + I have read and agree to{" "} + <a + href="/doc/Rulebook_QEC_EN.pdf" + target="_blank" + class="text-blue-500" + > + the CQI rules. + </a> + </li> + <li> + I consent to my image in photographs, as well as my + voice and image in video recordings, being used for + any type of promotion of CQI or CREIQ. + </li> + <li> + I consent to my email address being shared with + Génium, who may send me promotional offers. It will + be possible to unsubscribe from this mailing list at + any time after the competition. + </li> + </ul> + </div> + )} <div class="flex flex-col items-center justify-center"> <button diff --git a/client/src/i18n/en.ts b/client/src/i18n/en.ts index fe18526b0360f0c2d2da2649525fa1b9abf6b1e4..92c90f74e9a2c296385f6ce5a5d7d08996ca8559 100644 --- a/client/src/i18n/en.ts +++ b/client/src/i18n/en.ts @@ -130,6 +130,7 @@ const additionalInfo = { yes: "Yes", no: "No", required: "This field is required", + food: "I confirm that I have filled out the food forms.", } const dashboard = { diff --git a/client/src/i18n/fr.ts b/client/src/i18n/fr.ts index a79b95967e85d076bd19fbdeee0f3f3b2afbc8f4..c110fb1ccb75ffc0edbe9907faf6632eab767dbb 100644 --- a/client/src/i18n/fr.ts +++ b/client/src/i18n/fr.ts @@ -131,6 +131,7 @@ const additionalInfo = { yes: "Oui", no: "Non", required: "Cette information est requise", + food: "Je confirme avoir rempli le formulaire de nourriture ci-dessus.", } const dashboard = { diff --git a/server/.sqlx/query-b619a4bd63f93ae2a43618f72b91f5ef61bb19c225bfa5714d2d3d0a94547d0a.json b/server/.sqlx/query-50b803b27e0e1fc0adb33be7c766fd5e647e451fa4baf71cb2903670c515a150.json similarity index 65% rename from server/.sqlx/query-b619a4bd63f93ae2a43618f72b91f5ef61bb19c225bfa5714d2d3d0a94547d0a.json rename to server/.sqlx/query-50b803b27e0e1fc0adb33be7c766fd5e647e451fa4baf71cb2903670c515a150.json index aa8f8773657b13368d8d58c5d02b411bf0e7cf0e..861bd6bfbb5249265abe24b01969d21c39e90e14 100644 --- a/server/.sqlx/query-b619a4bd63f93ae2a43618f72b91f5ef61bb19c225bfa5714d2d3d0a94547d0a.json +++ b/server/.sqlx/query-50b803b27e0e1fc0adb33be7c766fd5e647e451fa4baf71cb2903670c515a150.json @@ -1,10 +1,11 @@ { "db_name": "PostgreSQL", - "query": "UPDATE participants SET (medical_conditions, allergies, pronouns, phone_number, tshirt_size, comments, dietary_restrictions, emergency_contact_name, emergency_contact_phone, emergency_contact_relationship, has_monthly_opus_card, reduced_mobility, study_proof, photo, cv)\n = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) WHERE id = $16", + "query": "UPDATE participants SET (food_forms_completed, medical_conditions, allergies, pronouns, phone_number, tshirt_size, comments, dietary_restrictions, emergency_contact_name, emergency_contact_phone, emergency_contact_relationship, has_monthly_opus_card, reduced_mobility, study_proof, photo, cv)\n = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) WHERE id = $17", "describe": { "columns": [], "parameters": { "Left": [ + "Bool", "Text", "Text", "Text", @@ -52,5 +53,5 @@ }, "nullable": [] }, - "hash": "b619a4bd63f93ae2a43618f72b91f5ef61bb19c225bfa5714d2d3d0a94547d0a" + "hash": "50b803b27e0e1fc0adb33be7c766fd5e647e451fa4baf71cb2903670c515a150" } diff --git a/server/migrations/20241122164021_change_field_participants_table.sql b/server/migrations/20241122164021_change_field_participants_table.sql new file mode 100644 index 0000000000000000000000000000000000000000..0686ec8f07293e3919d194fe62fc16fcb3fda744 --- /dev/null +++ b/server/migrations/20241122164021_change_field_participants_table.sql @@ -0,0 +1,2 @@ +-- Add migration script here +ALTER TABLE participants ADD COLUMN food_forms_completed BOOLEAN; diff --git a/server/src/bin/create_admin.rs b/server/src/bin/create_admin.rs index e421db26b1c67c0d4cf1faa9feda94ececdaff18..4f9e5488d095f6d98d476a05b8df62cf6201f329 100644 --- a/server/src/bin/create_admin.rs +++ b/server/src/bin/create_admin.rs @@ -19,6 +19,7 @@ async fn main() -> Result<()> { first_name: "Marc-Antoine".to_string(), last_name: "Manningham".to_string(), email: "mamanningham@cqi-qec.qc.ca".to_string(), + food_forms_completed: None, competition: Competition::None, role: Role::Organizer, university: University::Polymtl, diff --git a/server/src/model/minimal_participant.rs b/server/src/model/minimal_participant.rs index e96af409caa681df131a24849a68ecfc3282560a..621658239bf8ea2c9a2ab419928e3f5449cb4a0b 100644 --- a/server/src/model/minimal_participant.rs +++ b/server/src/model/minimal_participant.rs @@ -12,6 +12,7 @@ use super::{competition::Competition, role::Role, university::University}; pub struct MinimalParticipant { pub first_name: String, pub last_name: String, + pub food_forms_completed: Option<bool>, pub email: String, pub competition: Competition, pub university: University, diff --git a/server/src/model/participant_info.rs b/server/src/model/participant_info.rs index 84f60a1198e491608831ed4d991f9a83d9356d5d..b1ba619c3aa5cbc32269d72067823a490b2f589e 100644 --- a/server/src/model/participant_info.rs +++ b/server/src/model/participant_info.rs @@ -19,6 +19,7 @@ pub struct ParticipantInfo { pub last_name: Option<String>, pub email: Option<String>, pub role: Option<Role>, + pub food_forms_completed: Option<bool>, pub competition: Option<Competition>, pub university: Option<University>, pub medical_conditions: Option<String>, @@ -76,8 +77,9 @@ impl ParticipantInfo { pub async fn write_to_database(&self, id: Uuid, db: &PgPool) -> Result<(), sqlx::Error> { sqlx::query!( - r#"UPDATE participants SET (medical_conditions, allergies, pronouns, phone_number, tshirt_size, comments, dietary_restrictions, emergency_contact_name, emergency_contact_phone, emergency_contact_relationship, has_monthly_opus_card, reduced_mobility, study_proof, photo, cv) - = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) WHERE id = $16"#, + r#"UPDATE participants SET (food_forms_completed, medical_conditions, allergies, pronouns, phone_number, tshirt_size, comments, dietary_restrictions, emergency_contact_name, emergency_contact_phone, emergency_contact_relationship, has_monthly_opus_card, reduced_mobility, study_proof, photo, cv) + = ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) WHERE id = $17"#, + self.food_forms_completed, self.medical_conditions, self.allergies, self.pronouns,