Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajouter Licence dans la page du Profil #29

Merged
merged 3 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added backend/assets/img/logo/logo-ffessm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added backend/assets/img/site/compte/troll-qr-code.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion backend/src/DataFixtures/AppFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function load(ObjectManager $manager): void
// Ajouter une licence à l'admin
$licence = new Licence();
$licence
->setNumber(number: '123456')
->setNumber(number: 'A-17-776251')
->setUserLicence(user_licence: $admin);

$manager->persist($licence);
Expand Down
12 changes: 12 additions & 0 deletions backend/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $account_deletion_request = null;

/**
* @throws \Exception
*/
public function __construct()
{
$this->createdAt = new \DateTimeImmutable(timezone: new \DateTimeZone(timezone: self::TIMEZONE));
Expand All @@ -132,6 +135,15 @@ public function __construct()
}
}

public function getFullname(): string
{
// Capitalize the first letter of the firstname and the lastname
$firstname = ucfirst(strtolower($this->firstname));
$lastname = ucfirst(strtolower($this->lastname));

return $firstname.' '.$lastname;
}

public function getId(): ?int
{
return $this->id;
Expand Down
50 changes: 43 additions & 7 deletions backend/templates/pages/account/account-overview.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,52 @@
</tr>
</table>
</div>
{# --------------------------Composant Licence FFESSM------------------------ #}

<div class="col-md-6 d-md-flex justify-content-end">
<div class="w-100 border rounded-3 p-4" style="max-width: 212px;">
<img class="d-block mb-2"
width="48" alt="Entrainement piscine icône"
src="{{ asset('assets/img/site/compte/icon-swim.png') }}">
<h4 class="h5 lh-base mb-0">Entrainement</h4>
<p class="fs-sm text-muted mb-0">Mardi à 19h00</p>
<p class="fs-sm text-muted mb-0">Jeudi à 20h00</p>
<div class="card w-100 rounded-0 bg-light" style="max-width: 212px;">
<div class="mt-3">
<img class="mx-auto d-block" src="{{ asset('assets/img/logo/logo-ffessm.png') }}" alt="Logo FFESSM">
<p class="m-0 text-center text-primary" style="font-size: 5px">IMMERSION & EMOTION</p>
</div>
<div class="mt-3">
<div class="text-uppercase text-primary bold h4 text-center">licence</div>
<img class="d-block mx-auto" src="{{ asset('assets/img/site/compte/troll-qr-code.jpg') }}" width="50" alt="troll qr-code">
<h2 class="h6 my-1 text-center">{{ app.user.fullname }}</h2>
{% if app.user.divingLevel is null %}
<div class="text-center my-1" style="font-size: 12px;">
<i class="ai-triangle-alert text-primary"></i> <!-- Icône pour le niveau débutant -->
<span class="text-primary" style="font-size: 12px; font-weight: 700; text-align: center">Plongeur débutant</span>
</div>
{% else %}
<div class="text-center" style="font-size: 12px;">
{% if app.user.divingLevel == 1 %}
<i class="ai-star text-success"></i> <!-- Icône pour le niveau 1 -->
{% elseif app.user.divingLevel == 2 %}
<i class="ai-star text-primary"></i> <!-- Icône pour le niveau 2 -->
<i class="ai-star text-primary"></i> <!-- Icône pour le niveau 2 -->
{% elseif app.user.divingLevel == 3 %}
<i class="ai-star text-danger"></i> <!-- Icône pour le niveau expert -->
<i class="ai-star text-danger"></i> <!-- Icône pour le niveau expert -->
<i class="ai-star text-danger"></i> <!-- Icône pour le niveau expert -->
{% endif %}
</div>
{% endif %}
<h3 style="font-size: 12px; font-weight: 700; text-align: center">{{ app.user.licence }}</h3>
<hr>
</div>
<div class="card-footer">
<div class="d-flex flex-column m-0" style="font-size: 12px">
<span class="mx-auto" style="font-size: 9px">Club de plongée maubeugeois <br></span>
<strong class="text-center" style="font-size: 10px">09590020</strong>
<span class="mx-auto m-0" style="font-size: 9px">Piscine tournesol épinette</span>
<strong class="text-center" style="font-size: 10px">59600 Maubeuge.</strong>
<span class="mx-auto m-0" style="font-size: 9px">Tel: +33 3 27 65 03 72</span>
</div>
</div>
</div>
</div>

</div>
<div class="alert alert-info d-flex mb-0" role="alert"><i class="ai-circle-info fs-xl"></i>
<div class="ps-2">En cas de problème, veuillez contacter le responsable du club.
Expand Down
Loading