display choices grouped in consult vote

This commit is contained in:
Tykayn 2022-02-07 16:12:32 +01:00 committed by tykayn
parent c3bdc1a015
commit e74ea2dfd4
35 changed files with 284 additions and 174 deletions

View File

@ -40,12 +40,12 @@ export class PollConfig {
myEmail: string = environment.production ? '' : 'tktest@tktest.com';
myPolls: any = []; // list of retrieved polls from the backend api
/*
date specific poll, we have the choice to setup different hours (timeSlices) for all possible dates (dateChoices), or use the same hours for all dates
date specific poll, we have the group_choice to setup different hours (timeSlices) for all possible dates (dateChoices), or use the same hours for all dates
*/
allowSeveralHours = 'true';
// access
visibility = 'link_only'; // visible to anyone with the link:
voteChoices = 'only_yes'; // possible answers to a vote choice: only "yes", "yes, maybe, no"
voteChoices = 'only_yes'; // possible answers to a vote group_choice: only "yes", "yes, maybe, no"
creationDate = new Date();
expirationDate = ''; // expiracy date
voteStackId = null; // id of the vote stack to update

View File

@ -1074,7 +1074,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr ""
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr ""
#: .Poll+results.Best+choices
@ -1114,7 +1114,7 @@ msgid "Scroll to the right"
msgstr ""
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr ""
#: .Poll+results.The+current+best+choices+are:
@ -1460,7 +1460,7 @@ msgid "Return to step 1"
msgstr ""
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr ""
#: .Step+2+classic.Add+a+link+or+an+image
@ -1484,7 +1484,7 @@ msgid "Poll options (2 of 3)"
msgstr ""
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr ""
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link,+an+image+or+both.
@ -1647,7 +1647,7 @@ msgid "Choice added"
msgstr ""
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
#: .adminstuds.Column+deleted
@ -1784,7 +1784,7 @@ msgstr ""
#: .studs.If+you+want+to+vote+in+this+poll,+you+have+to+give+your+name,+make+your+choice,+and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
#: .studs.The+administrator+locked+this+poll.+Votes+and+comments+are+frozen,+it+is+no+longer+possible+to+participate

View File

@ -1146,7 +1146,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr ""
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Dibab gwellañ"
#: .Poll+results.Best+choices
@ -1186,7 +1186,7 @@ msgid "Scroll to the right"
msgstr "Dibunañ d'an tu dehou"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "Evit ar mare, an dibab gant ar muiañ a vouezhioù a zo:"
#: .Poll+results.The+current+best+choices+are:
@ -1541,7 +1541,7 @@ msgid "Return to step 1"
msgstr "Distreiñ d'ar bazenn 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Ouzhpennañ un dibab"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1565,7 +1565,7 @@ msgid "Poll options (2 of 3)"
msgstr "Dibab an danvezioù (2 War 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Dilemel an dibab diwezhañ"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1756,7 +1756,7 @@ msgid "Choice added"
msgstr "Dibab ouzhpennet"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
#: .adminstuds.Column+deleted
@ -1901,7 +1901,7 @@ msgstr "Deiziad dilemel:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Evit kemer perzh er sontadeg-mañ, enankit hoc'h anv, grit ho tibab ha "
"kadarnait gant an afell e dibenn al linenn."

View File

@ -1159,7 +1159,7 @@ msgstr ""
"que hàgiu votat"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Millor elecció"
#: .Poll+results.Best+choices
@ -1199,7 +1199,7 @@ msgid "Scroll to the right"
msgstr "Desplaça't cap a la dreta"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "Ara per ara, l'opció més votada és:"
#: .Poll+results.The+current+best+choices+are:
@ -1561,7 +1561,7 @@ msgid "Return to step 1"
msgstr "Torna al pas 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Afegeix una elecció"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1585,7 +1585,7 @@ msgid "Poll options (2 of 3)"
msgstr "Opcions de votació (2 de 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Elimina una elecció"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1772,7 +1772,7 @@ msgid "Choice added"
msgstr "S'ha afegit una opció"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
"Recopila els correus electrònics dels usuaris enquestats per a l'elecció"
@ -1922,7 +1922,7 @@ msgstr "Data de supressió:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Si voleu votar en aquesta enquesta, cal que indiqueu el vostre nom, feu "
"l'elecció i envieu-la seleccionant el botó de desar al final de la línia."

View File

@ -1095,7 +1095,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr ""
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr ""
#: .Poll+results.Best+choices
@ -1135,7 +1135,7 @@ msgid "Scroll to the right"
msgstr ""
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr ""
#: .Poll+results.The+current+best+choices+are:
@ -1481,7 +1481,7 @@ msgid "Return to step 1"
msgstr ""
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr ""
#: .Step+2+classic.Add+a+link+or+an+image
@ -1505,7 +1505,7 @@ msgid "Poll options (2 of 3)"
msgstr ""
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr ""
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link,+an+image+or+both.
@ -1668,7 +1668,7 @@ msgid "Choice added"
msgstr ""
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
#: .adminstuds.Column+deleted
@ -1805,7 +1805,7 @@ msgstr "Datum smazání:"
#: .studs.If+you+want+to+vote+in+this+poll,+you+have+to+give+your+name,+make+your+choice,+and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
#: .studs.The+administrator+locked+this+poll.+Votes+and+comments+are+frozen,+it+is+no+longer+possible+to+participate

View File

@ -1167,7 +1167,7 @@ msgstr ""
"Jeder wird Ihre E-Mail-Adresse sehen können nachdem Sie abgestimmt haben"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Beste Alternative"
#: .Poll+results.Best+choices
@ -1207,7 +1207,7 @@ msgid "Scroll to the right"
msgstr "Nach rechts scrollen"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "Die beste Option ist derzeit:"
#: .Poll+results.The+current+best+choices+are:
@ -1567,7 +1567,7 @@ msgid "Return to step 1"
msgstr "Zurück zum 1. Schritt"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Eine Auswahlmöglichkeit hinzufügen"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1593,7 +1593,7 @@ msgid "Poll options (2 of 3)"
msgstr "Umfrageoptionen (2 von 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Eine Auswahlmöglichkeit entfernen"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1787,7 +1787,7 @@ msgid "Choice added"
msgstr "Option hinzugefügt"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
"Sammeln der E-Mail-Adressen der zur Abstimmung eingeladenen Benutzer für die "
"Auswahl"
@ -1942,7 +1942,7 @@ msgstr "Löschdatum:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Wenn Sie an dieser Umfrage teilnehmen möchten, müssen Sie ihren Namen "
"angeben, die Auswahl treffen, die Ihnen am ehesten zusagt und mit dem "

View File

@ -1155,7 +1155,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr "Οποιοσδήποτε θα μπορεί να δει το email σας αφού ψηφήσετε"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Βέλτιστη επιλογή"
#: .Poll+results.Best+choices
@ -1195,7 +1195,7 @@ msgid "Scroll to the right"
msgstr "Κύλιση προς τα δεξιά"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "Η τρέχουσα καλύτερη επιλογή είναι:"
#: .Poll+results.The+current+best+choices+are:
@ -1556,7 +1556,7 @@ msgid "Return to step 1"
msgstr "Επιστροφή στο βήμα 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Προσθήκη επιλογής"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1580,7 +1580,7 @@ msgid "Poll options (2 of 3)"
msgstr "Επιλογές ψηφοφορίας (2 από 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Αφαίρεση επιλογής"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link,+an+image+or+both.
@ -1758,7 +1758,7 @@ msgid "Choice added"
msgstr "Η επιλογή προστέθηκε"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr "Συλλογή των email των ψηφισάντων χρηστών για την επιλογή"
#: .adminstuds.Column+deleted
@ -1904,7 +1904,7 @@ msgstr "Ημερομηνία διαγραφής:"
#: .studs.If+you+want+to+vote+in+this+poll,+you+have+to+give+your+name,+make+your+choice,+and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Αν θέλετε να συμμετέχετε σε αυτήν την ψηφοφορία, πρέπει να συμπληρώσετε το "
"όνομά σας, να κάνετε την επιλογή σας, και να την υποβάλλετε επιλέγοντας το "

View File

@ -1152,8 +1152,8 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr "Anyone will be able to see your email address after you voted"
#: .Poll+results.Best+choice
msgid "Best choice"
msgstr "Best choice"
msgid "Best group_choice"
msgstr "Best group_choice"
#: .Poll+results.Best+choices
msgid "Best choices"
@ -1192,8 +1192,8 @@ msgid "Scroll to the right"
msgstr "Scroll to the right"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgstr "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "The current best group_choice is:"
#: .Poll+results.The+current+best+choices+are:
msgid "The current best choices are:"
@ -1548,8 +1548,8 @@ msgid "Return to step 1"
msgstr "Return to step 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgstr "Add a choice"
msgid "Add a group_choice"
msgstr "Add a group_choice"
#: .Step+2+classic.Add+a+link+or+an+image
msgid "Add a link or an image"
@ -1572,8 +1572,8 @@ msgid "Poll options (2 of 3)"
msgstr "Poll options (2 of 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgstr "Remove a choice"
msgid "Remove a group_choice"
msgstr "Remove a group_choice"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
#: +an+image+or+both.
@ -1757,8 +1757,8 @@ msgid "Choice added"
msgstr "Choice added"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgstr "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr "Collect the emails of the polled users for the group_choice"
#: .adminstuds.Column+deleted
msgid "Column deleted"
@ -1907,10 +1907,10 @@ msgstr "Deletion date:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
#: .studs.The+administrator+locked+this+poll.+Votes+and+comments+are+frozen
#: +it+is+no+longer+possible+to+participate

View File

@ -1172,7 +1172,7 @@ msgstr ""
"Cualquiera podrá ver tu dirección de correo electrónico después de votar"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Elección más popular"
#: .Poll+results.Best+choices
@ -1212,7 +1212,7 @@ msgid "Scroll to the right"
msgstr "Desplazar hacia la derecha"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "La elección más popular actualmente es:"
#: .Poll+results.The+current+best+choices+are:
@ -1575,7 +1575,7 @@ msgid "Return to step 1"
msgstr "Volver al paso número 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Añadir una opción"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1599,7 +1599,7 @@ msgid "Poll options (2 of 3)"
msgstr "Elegir los temas (2 de 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Eliminar una opción"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1786,7 +1786,7 @@ msgid "Choice added"
msgstr "Elección añadida"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
"Recopilar los correos electrónicos de los usuarios encuestados para la "
"elección"
@ -1937,7 +1937,7 @@ msgstr "Fecha de supresión:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Si quieres votar en esta encuesta, tienes que dar tu nombre, hacer tu "
"elección y enviarla seleccionando el botón guardar al final de la línea."

View File

@ -1181,7 +1181,7 @@ msgstr ""
"Tout le monde pourra accéder à votre courriel après que vous ayez voté"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Meilleur choix"
#: .Poll+results.Best+choices
@ -1221,7 +1221,7 @@ msgid "Scroll to the right"
msgstr "Faire défiler à droite"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr ""
"Pour l'instant, le choix ayant reçu le plus grand nombre de votes est :"
@ -1582,7 +1582,7 @@ msgid "Return to step 1"
msgstr "Revenir à létape 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Ajouter un choix"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1606,7 +1606,7 @@ msgid "Poll options (2 of 3)"
msgstr "Choix des sujets (2 sur 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Supprimer le dernier choix"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1799,7 +1799,7 @@ msgid "Choice added"
msgstr "Choix ajouté"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr "Collecter les courriels des utilisateurs pour ce choix"
#: .adminstuds.Column+deleted
@ -1950,7 +1950,7 @@ msgstr "Date de suppression :"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Pour participer à ce sondage, veuillez entrer votre nom, choisir toutes les "
"valeurs qui vous conviennent et valider votre choix avec le bouton en bout "

View File

@ -1074,7 +1074,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr ""
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr ""
#: .Poll+results.Best+choices
@ -1114,7 +1114,7 @@ msgid "Scroll to the right"
msgstr ""
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr ""
#: .Poll+results.The+current+best+choices+are:
@ -1460,7 +1460,7 @@ msgid "Return to step 1"
msgstr ""
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr ""
#: .Step+2+classic.Add+a+link+or+an+image
@ -1484,7 +1484,7 @@ msgid "Poll options (2 of 3)"
msgstr ""
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr ""
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link,+an+image+or+both.
@ -1647,7 +1647,7 @@ msgid "Choice added"
msgstr ""
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
#: .adminstuds.Column+deleted
@ -1784,7 +1784,7 @@ msgstr ""
#: .studs.If+you+want+to+vote+in+this+poll,+you+have+to+give+your+name,+make+your+choice,+and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
#: .studs.The+administrator+locked+this+poll.+Votes+and+comments+are+frozen,+it+is+no+longer+possible+to+participate

View File

@ -1138,7 +1138,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr "Calquera pode ver o seu enderezo de correo electrónico despois de votar"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "A mellor escolla"
#: .Poll+results.Best+choices
@ -1178,7 +1178,7 @@ msgid "Scroll to the right"
msgstr "Desprazarse cada a dereita"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "Actualmente a mellor escolla é:"
#: .Poll+results.The+current+best+choices+are:
@ -1536,7 +1536,7 @@ msgid "Return to step 1"
msgstr "Volver ao paso 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Engadir unha opción"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1560,7 +1560,7 @@ msgid "Poll options (2 of 3)"
msgstr "Opcións da enquisa (2 de 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Borrar unha opción"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link,+an+image+or+both.
@ -1736,7 +1736,7 @@ msgid "Choice added"
msgstr "Engadiuse unha opción"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr "Recoller os correos electrónicos dos usuarios enquisados para a escolla"
#: .adminstuds.Column+deleted
@ -1881,7 +1881,7 @@ msgstr "Data de borrado:"
#: .studs.If+you+want+to+vote+in+this+poll,+you+have+to+give+your+name,+make+your+choice,+and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Se quere votar nesta enquisa, ten que fornecer o seu nome, marcar a súa "
"escolla, e enviala seleccionando o botón gardar ao final da liña."

View File

@ -1150,7 +1150,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr "Ha szavaz, akkor az e-mail címét bárki megtekintheti"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Legjobb választás"
#: .Poll+results.Best+choices
@ -1190,7 +1190,7 @@ msgid "Scroll to the right"
msgstr "Görgetés jobbra"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "Jelenlegi legjobb lehetőség:"
#: .Poll+results.The+current+best+choices+are:
@ -1547,7 +1547,7 @@ msgid "Return to step 1"
msgstr "Vissza az 1. lépéshez"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Lehetőség hozzáadása"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1571,7 +1571,7 @@ msgid "Poll options (2 of 3)"
msgstr "Szavazási beállítások (2/3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Lehetőség eltávolítása"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1757,7 +1757,7 @@ msgid "Choice added"
msgstr "Lehetőség hozzáadva"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr "Az erre szavazó felhasználók e-mail címének begyűjtése"
#: .adminstuds.Column+deleted
@ -1905,7 +1905,7 @@ msgstr "Törlési idő:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Ha szeretne részt venni ebben a szavazásban, meg kell adnia a nevét, a "
"válaszait, és a sor végén lévő mentés gombra kattintva be kell küldenie."

View File

@ -1165,7 +1165,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr "Chiunque può vedere il tuo indirizzo mail dopo il tuo voto"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Scelta migliore"
#: .Poll+results.Best+choices
@ -1205,7 +1205,7 @@ msgid "Scroll to the right"
msgstr "Spostare a destra"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "La migliore scelta per ora è:"
#: .Poll+results.The+current+best+choices+are:
@ -1562,7 +1562,7 @@ msgid "Return to step 1"
msgstr "Torna al punto 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Aggiungere un scelta"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1586,7 +1586,7 @@ msgid "Poll options (2 of 3)"
msgstr "Scelta delle opzioni (2 di 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Eliminare l'ultima scelta"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1776,7 +1776,7 @@ msgid "Choice added"
msgstr "Scelta aggiunta"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr "Raccogli le mail degli utenti che hanno scelto questa opzione"
#: .adminstuds.Column+deleted
@ -1927,7 +1927,7 @@ msgstr "Data di cancellazione:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Per partecipare a questo sondaggio, è necessario inserire vostro nome, "
"scegliere tutti i parametri che preferite e confermare la vostra scelta con "

View File

@ -1153,7 +1153,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr "Iedereen zal je e-mailadres kunnen zien nadat je gestemd hebt"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Beste keuze"
#: .Poll+results.Best+choices
@ -1193,7 +1193,7 @@ msgid "Scroll to the right"
msgstr "Scroll naar rechts"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "De beste keuze is op dit moment:"
#: .Poll+results.The+current+best+choices+are:
@ -1551,7 +1551,7 @@ msgid "Return to step 1"
msgstr "Terug naar stap 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Voeg een keuze toe"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1575,7 +1575,7 @@ msgid "Poll options (2 of 3)"
msgstr "Poll keuzes (2 van 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Verwijder een keuze"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1761,7 +1761,7 @@ msgid "Choice added"
msgstr "Keuze toegevoegd"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
"Verzamel de e-mailadressen van de ondervraagde gebruikers voor de optie"
@ -1911,7 +1911,7 @@ msgstr "Verwijderdatum:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Als je wilt stemmen in deze poll, moet je je naam ingeven, een keuze maken "
"en indienen door op de opslaan-knop op het einde van de lijn te klikken."

View File

@ -1170,7 +1170,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr "Tot lo monde poirà veire vòstra adreça de corrièl aprèp vòstre vòte"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Milhora causida"
#: .Poll+results.Best+choices
@ -1210,7 +1210,7 @@ msgid "Scroll to the right"
msgstr "Far desfilar a man drecha"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "Pel moment, la causida amb lo mai de vòtes es:"
#: .Poll+results.The+current+best+choices+are:
@ -1569,7 +1569,7 @@ msgid "Return to step 1"
msgstr "Tornar a letapa 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Apondre una causida"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1593,7 +1593,7 @@ msgid "Poll options (2 of 3)"
msgstr "Causida dels tèmas (2 sus 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Suprimir la darrièra causida"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link
@ -1783,7 +1783,7 @@ msgid "Choice added"
msgstr "Causida aponduda"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr "Collècta de las adreças dels votants per la causida"
#: .adminstuds.Column+deleted
@ -1928,7 +1928,7 @@ msgstr "Data de supression:"
#: +and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Se volètz votar per aqueste sondatge, avètz de donar vòstre nom, far una "
"causida, e lenviar en seleccionar lo boton de salvagarda al cap de la linha."

View File

@ -1127,7 +1127,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr ""
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr ""
#: .Poll+results.Best+choices
@ -1167,7 +1167,7 @@ msgid "Scroll to the right"
msgstr ""
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr ""
#: .Poll+results.The+current+best+choices+are:
@ -1513,7 +1513,7 @@ msgid "Return to step 1"
msgstr ""
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr ""
#: .Step+2+classic.Add+a+link+or+an+image
@ -1537,7 +1537,7 @@ msgid "Poll options (2 of 3)"
msgstr ""
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr ""
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link,+an+image+or+both.
@ -1700,7 +1700,7 @@ msgid "Choice added"
msgstr ""
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
#: .adminstuds.Column+deleted
@ -1837,7 +1837,7 @@ msgstr ""
#: .studs.If+you+want+to+vote+in+this+poll,+you+have+to+give+your+name,+make+your+choice,+and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
#: .studs.The+administrator+locked+this+poll.+Votes+and+comments+are+frozen,+it+is+no+longer+possible+to+participate

View File

@ -1077,7 +1077,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr ""
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr ""
#: .Poll+results.Best+choices
@ -1117,7 +1117,7 @@ msgid "Scroll to the right"
msgstr ""
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr ""
#: .Poll+results.The+current+best+choices+are:
@ -1463,7 +1463,7 @@ msgid "Return to step 1"
msgstr ""
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr ""
#: .Step+2+classic.Add+a+link+or+an+image
@ -1487,7 +1487,7 @@ msgid "Poll options (2 of 3)"
msgstr ""
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr ""
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link,+an+image+or+both.
@ -1650,7 +1650,7 @@ msgid "Choice added"
msgstr ""
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr ""
#: .adminstuds.Column+deleted
@ -1787,7 +1787,7 @@ msgstr ""
#: .studs.If+you+want+to+vote+in+this+poll,+you+have+to+give+your+name,+make+your+choice,+and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
#: .studs.The+administrator+locked+this+poll.+Votes+and+comments+are+frozen,+it+is+no+longer+possible+to+participate

View File

@ -1136,7 +1136,7 @@ msgid "Anyone will be able to see your email address after you voted"
msgstr "Vem som helst kan se din e-postadress när du har röstat"
#: .Poll+results.Best+choice
msgid "Best choice"
msgid "Best group_choice"
msgstr "Bästa val"
#: .Poll+results.Best+choices
@ -1176,7 +1176,7 @@ msgid "Scroll to the right"
msgstr "Rulla åt höger"
#: .Poll+results.The+current+best+choice+is:
msgid "The current best choice is:"
msgid "The current best group_choice is:"
msgstr "Det bästa valet är för tillfället:"
#: .Poll+results.The+current+best+choices+are:
@ -1526,7 +1526,7 @@ msgid "Return to step 1"
msgstr "Gå tillbaka till steg 1"
#: .Step+2+classic.Add+a+choice
msgid "Add a choice"
msgid "Add a group_choice"
msgstr "Lägg till ett alternativ"
#: .Step+2+classic.Add+a+link+or+an+image
@ -1550,7 +1550,7 @@ msgid "Poll options (2 of 3)"
msgstr "Alternativ för undersökningen (2 av 3)"
#: .Step+2+classic.Remove+a+choice
msgid "Remove a choice"
msgid "Remove a group_choice"
msgstr "Ta bort ett alternativ"
#: .Step+2+classic.These+fields+are+optional.+You+can+add+a+link,+an+image+or+both.
@ -1724,7 +1724,7 @@ msgid "Choice added"
msgstr "Alternativ tillagt"
#: .adminstuds.Collect+the+emails+of+the+polled+users+for+the+choice
msgid "Collect the emails of the polled users for the choice"
msgid "Collect the emails of the polled users for the group_choice"
msgstr "Samla in e-postadresserna till de deltagare som röstade om alternativet"
#: .adminstuds.Column+deleted
@ -1869,7 +1869,7 @@ msgstr "Raderingsdatum:"
#: .studs.If+you+want+to+vote+in+this+poll,+you+have+to+give+your+name,+make+your+choice,+and+submit+it+by+selecting+the+save+button+at+the+end+of+the+line.
msgid ""
"If you want to vote in this poll, you have to give your name, make your "
"choice, and submit it by selecting the save button at the end of the line."
"group_choice, and submit it by selecting the save button at the end of the line."
msgstr ""
"Om du vill delta i den här undersökningen måste du uppge ditt namn, lägga "
"din röst och skicka den genom att klicka på spara-knappen vid slutet av "

View File

@ -30,6 +30,7 @@ import { ErrorsListComponent } from './features/shared/components/ui/form/errors
import { KeyboardShortcutsModule } from 'ng-keyboard-shortcuts';
import { AdministrationModule } from './features/administration/administration.module';
import { EditComponent } from './features/consultation/edit/edit.component';
import { ChoiceButtonDinumComponent } from './features/shared/components/choice-button-dinum/choice-button-dinum.component';
// register languages files for translation
// import localeEn from '@angular/common/locales/en';
@ -82,6 +83,6 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
],
providers: [Title, TranslateService],
bootstrap: [AppComponent],
exports: [ErrorsListComponent],
exports: [ErrorsListComponent, ChoiceButtonDinumComponent],
})
export class AppModule {}

View File

@ -40,6 +40,7 @@ export class Poll {
public stacks = [];
public timeSlices: TimeSlices[] = Object.create(defaultTimeOfDay); // ranges of time expressed as strings
public votes = [];
public votes_allowed: boolean = true;
constructor(public owner: Owner = new Owner(), public title = 'mon titre', public custom_url: string = '') {}
}

View File

@ -64,8 +64,6 @@ export class StorageService {
if (!this.vote_stack.id) {
this.vote_stack = new Stack();
console.log('choices_list', choices_list);
for (const choice of choices_list) {
// if (environment.autofill_participation) {
// console.log('autofill au hasard des votes à ce sondage');

View File

@ -17,8 +17,8 @@
<div class="top">
<label class="pull-left" for="dateChoices_{{ id }}">
{{ 'dates.element' | translate }} {{ id + 1 }}
<!-- ( weekend : {{ isWeekendDay(choice.date_input) }} )-->
<!-- - {{ choice.date_object | date: 'E':'Europe/Paris':'fr_FR' }}-->
<!-- ( weekend : {{ isWeekendDay(group_choice.date_input) }} )-->
<!-- - {{ group_choice.date_object | date: 'E':'Europe/Paris':'fr_FR' }}-->
</label>
<span class="format-helper pull-right">{{ 'dates.format_helper' | translate }}</span>

View File

@ -19,8 +19,8 @@ const routes: Routes = [
{ path: 'secure/:pass_hash', component: ConsultationComponent },
{ path: 'prompt', component: PasswordPromptComponent },
{ path: 'table', component: WipTodoComponent },
{ path: 'user-info', component: ConsultationUserComponent },
{ path: 'vote', component: EditComponent },
{ path: 'vote/user-infos', component: ConsultationUserComponent },
{ path: 'edit/:voteStackId', component: EditComponent },
{ path: 'success', component: SuccessComponent },
{ path: 'page-not-found', component: PageNotFoundComponent },

View File

@ -64,9 +64,16 @@
<p class="description">
{{ poll.description }}
</p>
<button class="vote-button is-primary button" [routerLink]="'/poll/' + poll.custom_url + '/vote'">
<button
class="vote-button is-primary button"
*ngIf="poll.votes_allowed"
[routerLink]="'/poll/' + poll.custom_url + '/consultation/vote'"
>
{{ 'participation.fav_title' | translate }}
</button>
<span *ngIf="!poll.votes_allowed">
Les votes sont désactivés
</span>
</section>
<section class="favourite">
<h2 class="title is-3">

View File

@ -60,7 +60,7 @@ export class ConsultationComponent implements OnInit, OnDestroy {
console.log('this.pass_hash ', this.pass_hash);
if (this.pass_hash) {
this.pollService.loadPollByCustomUrlWithPasswordHash(this.pollSlug, this.pass_hash).then((resp) => {
console.log('loadPollByCustomUrlWithPasswordHash resp', resp);
console.log('loadPollByCustomUrlWithPasswordHash resp', this.pollService._poll.getValue());
this.fetching = false;
this.storageService.vote_stack.id = null;
this.storageService.setChoicesForVoteStack(this.pollService._poll.getValue().choices);

View File

@ -9,8 +9,6 @@ import { PollResultsCompactComponent } from './poll-results-compact/poll-results
import { PollResultsDetailedComponent } from './poll-results-detailed/poll-results-detailed.component';
import { ChoiceButtonComponent } from '../../shared/components/choice-item/choice-button.component';
import { PasswordPromptComponent } from './password/password-prompt/password-prompt.component';
import { ChoiceDetailsComponent } from '../../shared/components/choice-details/choice-details.component';
import { CoreModule } from '../../core/core.module';
import { ConsultationLandingComponent } from './consultation-landing/consultation-landing.component';
import { ConsultationUserComponent } from './consultation-user/consultation-user.component';
import { SuccessComponent } from './success/success.component';

View File

@ -1,36 +1,60 @@
<app-stepper [step_current]="4" [step_max]="pollService.step_max"></app-stepper>
<app-stepper [step_current]="1" [step_max]="2"></app-stepper>
<div class="step">
<h3 class="title is-3">
{{ 'participation.voting_title' | translate }}
</h3>
<div class="date-choices" *ngIf="pollService.poll.kind == 'date'">
<div class="box" *ngFor="let group of poll.choices_grouped"></div>
</div>
<div class="rounded-block">
<div class="time-slice-choice" *ngFor="let choice of group.choices">
<h4 class="title is-4 choice-label">
{{ choice.name }}
</h4>
<app-choice-button
[poll]="poll"
[choice]="choice"
[answerKind]="'YES'"
*ngIf="poll.allowed_answers.indexOf('yes') !== -1"
></app-choice-button>
<app-choice-button
[poll]="poll"
[choice]="choice"
[answerKind]="'MAYBE'"
*ngIf="poll.allowed_answers.indexOf('maybe') !== -1"
></app-choice-button>
<app-choice-button
[poll]="poll"
[choice]="choice"
[answerKind]="'NO'"
*ngIf="poll.allowed_answers.indexOf('no') !== -1"
></app-choice-button>
<!-- <div class="date-choices" *ngIf="pollService.poll.kind == 'date'">-->
<!-- <div class="box" *ngFor="let group of poll.choices"></div>-->
<!-- </div>-->
<div class="rounded-block" *ngIf="poll">
{{ poll.title }}
<div class="time-slice-choice" *ngFor="let group_choice of poll.choices_grouped">
<h4 class="title is-4 choice-label">
{{ group_choice.name }}
</h4>
<div class="choice-subset" *ngFor="let choice of group_choice.choices">
<div class="choice-label">
{{ choice.name }}
</div>
<div class="choice-buttons" *ngIf="poll.allowed_answers">
<app-choice-button-dinum
[poll]="poll"
[choice]="choice"
[answerKind]="'YES'"
></app-choice-button-dinum>
<!-- *ngIf="poll.allowed_answers?.indexOf('yes') !== -1"-->
<app-choice-button-dinum
[poll]="poll"
[choice]="choice"
[answerKind]="'MAYBE'"
></app-choice-button-dinum>
<!-- *ngIf="poll.allowed_answers?.indexOf('maybe') !== -1"-->
<app-choice-button-dinum
[poll]="poll"
[choice]="choice"
[answerKind]="'NO'"
></app-choice-button-dinum>
<!-- *ngIf="poll.allowed_answers?.indexOf('no') !== -1"-->
</div>
</div>
</div>
</div>
</div>
<app-nav-steps [next_step_number]="2" [previous_step_number]="0"></app-nav-steps>
<div class="no-poll" *ngIf="!poll">
no poll
</div>
<div class="bottom-step-buttons" *ngIf="poll">
<div class="contained-in-main-column">
<button
class="button-next pull-right"
[routerLink]="['/poll/' + poll.custom_url + '/consultation/vote/user-infos']"
>
<b>
{{ 'nav.next' | translate }}
</b>
</button>
</div>
</div>

View File

@ -1,10 +1,14 @@
import { ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core';
import { DateUtilitiesService } from '../../../core/services/date.utilities.service';
import { Router } from '@angular/router';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { ToastService } from '../../../core/services/toast.service';
import { DOCUMENT } from '@angular/common';
import { StorageService } from '../../../core/services/storage.service';
import { PollService } from '../../../core/services/poll.service';
import { Poll } from '../../../core/models/poll.model';
import { PollUtilitiesService } from '../../../core/services/poll.utilities.service';
import { ApiService } from '../../../core/services/api.service';
import { DateService } from '../../../core/services/date.service';
@Component({
selector: 'app-edit',
@ -12,17 +16,49 @@ import { PollService } from '../../../core/services/poll.service';
styleUrls: ['./edit.component.scss'],
})
export class EditComponent implements OnInit {
public poll: Poll;
public fetching = true;
private pollSlug: string;
private pass_hash: string;
constructor(
private dateUtilitiesService: DateUtilitiesService,
private router: Router,
private toastService: ToastService,
private cd: ChangeDetectorRef,
@Inject(DOCUMENT) private document: any,
private storageService: StorageService,
public pollService: PollService
private utils: PollUtilitiesService,
private _Activatedroute: ActivatedRoute,
public storageService: StorageService,
public api: ApiService,
public pollService: PollService,
public dateService: DateService,
public toastService: ToastService
) {
this.pollService.step_current = 4;
this.pollService.poll.subscribe((newpoll: Poll) => {
console.log('newpoll', newpoll);
this.poll = newpoll;
});
}
ngOnInit(): void {}
ngOnInit(): void {
this._Activatedroute.paramMap.subscribe((params: ParamMap) => {
console.log('params _Activatedroute', params);
this.pollSlug = params.get('custom_url');
this.pass_hash = params.get('pass_hash');
console.log('this.pass_hash ', this.pass_hash);
if (this.pass_hash) {
this.pollService.loadPollByCustomUrlWithPasswordHash(this.pollSlug, this.pass_hash).then((resp) => {
console.log('loadPollByCustomUrlWithPasswordHash resp', this.pollService._poll.getValue());
this.fetching = false;
this.storageService.vote_stack.id = null;
this.storageService.setChoicesForVoteStack(this.pollService._poll.getValue().choices);
});
} else {
this.pollService.loadPollByCustomUrl(this.pollSlug).then((resp) => {
console.log('loadPollByCustomUrl resp', resp);
this.fetching = false;
this.storageService.vote_stack.id = null;
this.storageService.setChoicesForVoteStack(this.pollService._poll.getValue().choices);
});
}
});
}
}

View File

@ -0,0 +1,8 @@
<button
class="choice-button is-white"
[ngClass]="{ 'is-primary': storageService.choiceHasAnswerOfValue(choice.id, answerEnum[answerKind]) }"
(click)="storageService.toggleAnswer(choice.id, answerEnum[answerKind])"
*ngIf="poll.allowed_answers.indexOf(answerEnum[answerKind]) !== -1"
>
{{ 'participation.' + answerEnum[answerKind] | translate }}
</button>

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ChoiceButtonDinumComponent } from './choice-button-dinum.component';
describe('ChoiceButtonDinumComponent', () => {
let component: ChoiceButtonDinumComponent;
let fixture: ComponentFixture<ChoiceButtonDinumComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ChoiceButtonDinumComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ChoiceButtonDinumComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,22 @@
import { Component, Input, OnInit } from '@angular/core';
import { Poll } from '../../../../core/models/poll.model';
import { Choice } from '../../../../core/models/choice.model';
import { Answer } from '../../../../core/enums/answer.enum';
import { StorageService } from '../../../../core/services/storage.service';
@Component({
selector: 'app-choice-button-dinum',
templateUrl: './choice-button-dinum.component.html',
styleUrls: ['./choice-button-dinum.component.scss'],
})
export class ChoiceButtonDinumComponent implements OnInit {
@Input() public poll: Poll;
@Input() public choice: Choice;
@Input() public answerKind: string = 'yes';
public answerEnum = Answer;
constructor(public storageService: StorageService) {}
ngOnInit(): void {}
}

View File

@ -18,8 +18,6 @@ export class LanguageSelectorComponent implements OnInit {
ngOnInit(): void {
this.availableLanguages = this.languageService.getAvailableLanguages();
console.log('this.availableLanguages', this.availableLanguages);
this.currentLang = this.languageService.getLangage();
if (this.storageService.language && this.availableLanguages.indexOf(this.storageService.language) !== -1) {
this.languageService.setLanguage(this.storageService.language);
@ -33,25 +31,16 @@ export class LanguageSelectorComponent implements OnInit {
nextLang(): void {
const index = this.availableLanguages.indexOf(this.currentLang);
console.log('this.currentLang ', this.currentLang, 'index', index);
if (index !== -1) {
// on passe au language suivant si il existe, sinon on revient au numéro 0
const nextlang = console.log('this.availableLanguages[index + 1]', this.availableLanguages[index + 1]);
console.log('nextlang', nextlang);
if (this.availableLanguages[index + 1]) {
console.log('lang suivante', this.availableLanguages[index + 1]);
this.currentLang = this.availableLanguages[index + 1];
} else {
console.log('retour à la langue 0');
this.currentLang = this.availableLanguages[0];
}
this.setLang();
}
console.log('this.currentLang ', this.currentLang);
console.log('this.availableLanguages', this.availableLanguages);
console.log('TODO');
}
}

View File

@ -32,6 +32,7 @@ import { ConfirmDialogModule } from 'primeng/confirmdialog';
import { ConfirmationService } from 'primeng/api';
import { AboutComponent } from '../features/shared/components/ui/static-pages/about/about.component';
import { RouterModule } from '@angular/router';
import { ChoiceButtonDinumComponent } from '../features/shared/components/choice-button-dinum/choice-button-dinum.component';
const COMPONENTS = [
AboutComponent,
@ -48,6 +49,7 @@ const COMPONENTS = [
ErrorsListComponent,
WipTodoComponent,
ShortcutsHelpComponent,
ChoiceButtonDinumComponent,
];
const ANGULAR_MODULES = [CommonModule, ChartsModule, FormsModule, TranslateModule];