Skip to content
Snippets Groups Projects
Commit 43f7d900 authored by Enzo Simonnet's avatar Enzo Simonnet Committed by Mathieu Loiseau
Browse files

oulala

parent 72fbf64c
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,7 @@ class AccountCreationTeacherCommand extends Command ...@@ -75,7 +75,7 @@ class AccountCreationTeacherCommand extends Command
$user = new User($this->translator); $user = new User();
$user->setPseudo($username); $user->setPseudo($username);
$user->setEmail($email); $user->setEmail($email);
$user->setUuid(new UuidV1()); $user->setUuid(new UuidV1());
......
...@@ -63,7 +63,7 @@ class BootstrapCommand extends Command ...@@ -63,7 +63,7 @@ class BootstrapCommand extends Command
$redirectUris = explode(',', $input->getOption('redirect-uris')); $redirectUris = explode(',', $input->getOption('redirect-uris'));
// Create the user // Create the user
$user = new User($this->translator); $user = new User();
$user->setEmail($email); $user->setEmail($email);
$user->setPassword($this->passwordHasher->hashPassword($user, $password)); $user->setPassword($this->passwordHasher->hashPassword($user, $password));
$user->setRoles(['ROLE_SUPER_ADMIN']); $user->setRoles(['ROLE_SUPER_ADMIN']);
......
...@@ -36,7 +36,7 @@ class RegistrationController extends AbstractController ...@@ -36,7 +36,7 @@ class RegistrationController extends AbstractController
VerifyEmailHelperInterface $verifyEmailHelper, VerifyEmailHelperInterface $verifyEmailHelper,
MailerInterface $mailer): Response MailerInterface $mailer): Response
{ {
$user = new User($this->translator); $user = new User();
$form = $this->createForm(RegistrationFormType::class, $user); $form = $this->createForm(RegistrationFormType::class, $user);
$form->handleRequest($request); $form->handleRequest($request);
......
...@@ -16,7 +16,6 @@ use Symfony\Component\Uid\UuidV1; ...@@ -16,7 +16,6 @@ use Symfony\Component\Uid\UuidV1;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich; use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Serializer\Annotation\Ignore; use Symfony\Component\Serializer\Annotation\Ignore;
use Symfony\Contracts\Translation\TranslatorInterface;
/** /**
* @ORM\Entity(repositoryClass=UserRepository::class) * @ORM\Entity(repositoryClass=UserRepository::class)
...@@ -270,14 +269,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -270,14 +269,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
*/ */
private $lastDailyQuestUpdate; private $lastDailyQuestUpdate;
private $translator;
public function __toString() public function __toString()
{ {
return $this->getPseudo(); return $this->getPseudo();
} }
public function __construct(TranslatorInterface $translator) public function __construct()
{ {
$this->oAuth2UserConsents = new ArrayCollection(); $this->oAuth2UserConsents = new ArrayCollection();
$this->uuid = new UuidV1(); $this->uuid = new UuidV1();
...@@ -301,7 +298,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -301,7 +298,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$this->lexicons = new ArrayCollection(); $this->lexicons = new ArrayCollection();
$this->userPoints = 0; $this->userPoints = 0;
$this->successes = new ArrayCollection(); $this->successes = new ArrayCollection();
$this->translator = $translator;
$this->initializeSuccesses(); $this->initializeSuccesses();
$this->dailyQuestStrike = 0; $this->dailyQuestStrike = 0;
} }
...@@ -315,7 +311,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -315,7 +311,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$success->setSuccessMilestones([0, 1, 10, 25, 50, 100]); // Set the initial success milestones to 0 $success->setSuccessMilestones([0, 1, 10, 25, 50, 100]); // Set the initial success milestones to 0
$success->setCurrentMilestone(0); // Set the initial current milestone to 0 $success->setCurrentMilestone(0); // Set the initial current milestone to 0
$success->setUser($this); // Bind the Success entity to the current user $success->setUser($this); // Bind the Success entity to the current user
$success->setExplanation($this->translator->trans('Nombre de mots ajoutés par vous dans tous vos lexiques')); $success->setExplanation('Nombre de mots ajoutés par vous dans tous vos lexiques');
$success->setColors(['#181893', '#E5E8F9']); $success->setColors(['#181893', '#E5E8F9']);
// $success->setIcon('assets/images/success_icons/vocabulord.png'); // Set the icon attribute // $success->setIcon('assets/images/success_icons/vocabulord.png'); // Set the icon attribute
// Add the Success entity to the user's $successes collection // Add the Success entity to the user's $successes collection
...@@ -327,7 +323,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -327,7 +323,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$success->setSuccessMilestones([0, 1, 10, 25, 50, 100]); // Set the initial success milestones to 0 $success->setSuccessMilestones([0, 1, 10, 25, 50, 100]); // Set the initial success milestones to 0
$success->setCurrentMilestone(0); // Set the initial current milestone to 0 $success->setCurrentMilestone(0); // Set the initial current milestone to 0
$success->setUser($this); // Bind the Success entity to the current user $success->setUser($this); // Bind the Success entity to the current user
$success->setExplanation($this->translator->trans('Nombre de mots auquel vous avez ajouté au moins un label')); $success->setExplanation('Nombre de mots auquel vous avez ajouté au moins un label');
$success->setColors(['#E52322', '#FFE5D9']); $success->setColors(['#E52322', '#FFE5D9']);
// $success->setIcon('assets/images/success_icons/labelliciste.png'); // Set the icon attribute // $success->setIcon('assets/images/success_icons/labelliciste.png'); // Set the icon attribute
$this->successes->add($success); $this->successes->add($success);
...@@ -338,7 +334,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -338,7 +334,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$success->setSuccessMilestones([0, 5, 25, 50, 100, 250]); // Set the initial success milestones to 0 $success->setSuccessMilestones([0, 5, 25, 50, 100, 250]); // Set the initial success milestones to 0
$success->setCurrentMilestone(0); // Set the initial current milestone to 0 $success->setCurrentMilestone(0); // Set the initial current milestone to 0
$success->setUser($this); // Bind the Success entity to the current user $success->setUser($this); // Bind the Success entity to the current user
$success->setExplanation($this->translator->trans('Nombre total de consultations de toutes vos entrées')); $success->setExplanation('Nombre total de consultations de toutes vos entrées');
$success->setColors(['#93184A', '#FFE1EF']); $success->setColors(['#93184A', '#FFE1EF']);
// $success->setIcon('assets/images/success_icons/gardien_du_savoir.png'); // Set the icon attribute // $success->setIcon('assets/images/success_icons/gardien_du_savoir.png'); // Set the icon attribute
$this->successes->add($success); $this->successes->add($success);
...@@ -349,7 +345,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -349,7 +345,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$success->setSuccessMilestones([0, 2, 5, 10, 20, 35]); // Set the initial success milestones to 0 $success->setSuccessMilestones([0, 2, 5, 10, 20, 35]); // Set the initial success milestones to 0
$success->setCurrentMilestone(0); // Set the initial current milestone to 0 $success->setCurrentMilestone(0); // Set the initial current milestone to 0
$success->setUser($this); // Bind the Success entity to the current user $success->setUser($this); // Bind the Success entity to the current user
$success->setExplanation($this->translator->trans('Nombre de jours consécutifs où vous avez réussi la quête journalière')); $success->setExplanation('Nombre de jours consécutifs où vous avez réussi la quête journalière');
$success->setColors(['#412666', '#E7D5E9']); $success->setColors(['#412666', '#E7D5E9']);
// $success->setIcon('assets/images/success_icons/maitre_du_temps.png'); // Set the icon attribute // $success->setIcon('assets/images/success_icons/maitre_du_temps.png'); // Set the icon attribute
$this->successes->add($success); $this->successes->add($success);
...@@ -360,7 +356,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -360,7 +356,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$success->setSuccessMilestones([0, 1, 5, 10, 20, 35]); // Set the initial success milestones to 0 $success->setSuccessMilestones([0, 1, 5, 10, 20, 35]); // Set the initial success milestones to 0
$success->setCurrentMilestone(0); // Set the initial current milestone to 0 $success->setCurrentMilestone(0); // Set the initial current milestone to 0
$success->setUser($this); // Bind the Success entity to the current user $success->setUser($this); // Bind the Success entity to the current user
$success->setExplanation($this->translator->trans('Nombre de mots ajoutés par vous à un label public')); $success->setExplanation('Nombre de mots ajoutés par vous à un label public');
$success->setColors(['#009FE3', '#D0EBFC']); $success->setColors(['#009FE3', '#D0EBFC']);
// $success->setIcon('assets/images/success_icons/altruiste.png'); // Set the icon attribute // $success->setIcon('assets/images/success_icons/altruiste.png'); // Set the icon attribute
$this->successes->add($success); $this->successes->add($success);
...@@ -371,7 +367,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -371,7 +367,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$success->setSuccessMilestones([0, 1, 5, 10, 20, 35]); // Set the initial success milestones to 0 $success->setSuccessMilestones([0, 1, 5, 10, 20, 35]); // Set the initial success milestones to 0
$success->setCurrentMilestone(0); // Set the initial current milestone to 0 $success->setCurrentMilestone(0); // Set the initial current milestone to 0
$success->setUser($this); // Bind the Success entity to the current user $success->setUser($this); // Bind the Success entity to the current user
$success->setExplanation($this->translator->trans("Nombre d'entrées modifiées par vous dans vos lexiques de groupe")); $success->setExplanation("Nombre d'entrées modifiées par vous dans vos lexiques de groupe");
$success->setColors(['#E9580C', '#FFE8D9']); $success->setColors(['#E9580C', '#FFE8D9']);
// $success->setIcon('assets/images/success_icons/acolyte_anonyme.png'); // Set the icon attribute // $success->setIcon('assets/images/success_icons/acolyte_anonyme.png'); // Set the icon attribute
$this->successes->add($success); $this->successes->add($success);
...@@ -382,7 +378,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -382,7 +378,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$success->setSuccessMilestones([0, 1, 5, 10, 20, 35]); // Set the initial success milestones to 0 $success->setSuccessMilestones([0, 1, 5, 10, 20, 35]); // Set the initial success milestones to 0
$success->setCurrentMilestone(0); // Set the initial current milestone to 0 $success->setCurrentMilestone(0); // Set the initial current milestone to 0
$success->setUser($this); // Bind the Success entity to the current user $success->setUser($this); // Bind the Success entity to the current user
$success->setExplanation($this->translator->trans('Nombre de messages écrits dans les discussions de groupe')); $success->setExplanation('Nombre de messages écrits dans les discussions de groupe');
$success->setColors(['#05993C', '#EAF3E3']); $success->setColors(['#05993C', '#EAF3E3']);
// $success->setIcon('assets/images/success_icons/messager.png'); // Set the icon attribute // $success->setIcon('assets/images/success_icons/messager.png'); // Set the icon attribute
$this->successes->add($success); $this->successes->add($success);
...@@ -393,7 +389,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -393,7 +389,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$success->setSuccessMilestones([0, 1, 5, 10, 20, 35]); // Set the initial success milestones to 0 $success->setSuccessMilestones([0, 1, 5, 10, 20, 35]); // Set the initial success milestones to 0
$success->setCurrentMilestone(0); // Set the initial current milestone to 0 $success->setCurrentMilestone(0); // Set the initial current milestone to 0
$success->setUser($this); // Bind the Success entity to the current user $success->setUser($this); // Bind the Success entity to the current user
$success->setExplanation($this->translator->trans('Nombre de commentaires écrits dans les entrées')); $success->setExplanation('Nombre de commentaires écrits dans les entrées');
$success->setColors(['#F6A600', '#FBF6DB']); $success->setColors(['#F6A600', '#FBF6DB']);
// $success->setIcon('assets/images/success_icons/commentateur_sportif.png'); // Set the icon attribute // $success->setIcon('assets/images/success_icons/commentateur_sportif.png'); // Set the icon attribute
$this->successes->add($success); $this->successes->add($success);
......
...@@ -60,8 +60,7 @@ ...@@ -60,8 +60,7 @@
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
{% set counter = counter + 1 %} </div>
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
{# <img src="{{ asset(successData.icon) }}" alt="{{ successData.successName }}" class="success-icon-img">#} {# <img src="{{ asset(successData.icon) }}" alt="{{ successData.successName }}" class="success-icon-img">#}
</div> </div>
<div class="success-info"> <div class="success-info">
<div class="success-title" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ successData.explanation }}"> <div class="success-title" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ successData.explanation |trans}}">
{{ successData.successName|trans }} {{ successData.successName|trans }}
</div> </div>
<div class="success-progress"> <div class="success-progress">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment