better dashboard

This commit is contained in:
Olivier PARPAILLON
2024-11-27 13:31:25 +01:00
parent 806a023670
commit 6a429984d1
9 changed files with 201 additions and 7 deletions

2
.idea/php.xml generated
View File

@@ -148,6 +148,8 @@
<path value="$PROJECT_DIR$/vendor/doctrine/data-fixtures" />
<path value="$PROJECT_DIR$/vendor/doctrine/doctrine-fixtures-bundle" />
<path value="$PROJECT_DIR$/vendor/fzaninotto/faker" />
<path value="$PROJECT_DIR$/vendor/jms/metadata" />
<path value="$PROJECT_DIR$/vendor/vich/uploader-bundle" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.2" />

3
.idea/sortir.iml generated
View File

@@ -3,7 +3,6 @@
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="App\Tests\" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/cache" />
@@ -141,6 +140,8 @@
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/data-fixtures" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/doctrine-fixtures-bundle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fzaninotto/faker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jms/metadata" />
<excludeFolder url="file://$MODULE_DIR$/vendor/vich/uploader-bundle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@@ -47,7 +47,8 @@
"symfony/yaml": "6.4.*",
"symfonycasts/verify-email-bundle": "^1.17",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
"twig/twig": "^2.12|^3.0",
"vich/uploader-bundle": "*"
},
"config": {
"allow-plugins": {

175
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e172d72b9dfb496cd9861e9141efa997",
"content-hash": "e11349ecdee967fa84856ce5d140b441",
"packages": [
{
"name": "composer/semver",
@@ -1437,6 +1437,70 @@
"abandoned": true,
"time": "2015-05-29T06:29:14+00:00"
},
{
"name": "jms/metadata",
"version": "2.8.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/metadata.git",
"reference": "7ca240dcac0c655eb15933ee55736ccd2ea0d7a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/metadata/zipball/7ca240dcac0c655eb15933ee55736ccd2ea0d7a6",
"reference": "7ca240dcac0c655eb15933ee55736ccd2ea0d7a6",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0"
},
"require-dev": {
"doctrine/cache": "^1.0",
"doctrine/coding-standard": "^8.0",
"mikey179/vfsstream": "^1.6.7",
"phpunit/phpunit": "^8.5|^9.0",
"psr/container": "^1.0|^2.0",
"symfony/cache": "^3.1|^4.0|^5.0",
"symfony/dependency-injection": "^3.1|^4.0|^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Metadata\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Johannes M. Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Asmir Mustafic",
"email": "goetas@gmail.com"
}
],
"description": "Class/method/property metadata management in PHP",
"keywords": [
"annotations",
"metadata",
"xml",
"yaml"
],
"support": {
"issues": "https://github.com/schmittjoh/metadata/issues",
"source": "https://github.com/schmittjoh/metadata/tree/2.8.0"
},
"time": "2023-02-15T13:44:18+00:00"
},
{
"name": "monolog/monolog",
"version": "3.8.0",
@@ -7765,6 +7829,115 @@
],
"time": "2024-11-17T15:59:19+00:00"
},
{
"name": "vich/uploader-bundle",
"version": "v2.4.3",
"source": {
"type": "git",
"url": "https://github.com/dustin10/VichUploaderBundle.git",
"reference": "7925bea64df77991caacf8967f602efb268a3724"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dustin10/VichUploaderBundle/zipball/7925bea64df77991caacf8967f602efb268a3724",
"reference": "7925bea64df77991caacf8967f602efb268a3724",
"shasum": ""
},
"require": {
"doctrine/persistence": "^3.0",
"ext-simplexml": "*",
"jms/metadata": "^2.4",
"php": "^8.1",
"symfony/config": "^5.4 || ^6.0 || ^7.0",
"symfony/console": "^5.4 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/event-dispatcher-contracts": "^3.1",
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
"symfony/mime": "^5.4 || ^6.0 || ^7.0",
"symfony/property-access": "^5.4 || ^6.0 || ^7.0",
"symfony/string": "^5.4 || ^6.0 || ^7.0"
},
"conflict": {
"doctrine/annotations": "<1.12",
"league/flysystem": "<2.0"
},
"require-dev": {
"dg/bypass-finals": "^1.8",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/mongodb-odm": "^2.4",
"doctrine/orm": "^2.13",
"ext-sqlite3": "*",
"knplabs/knp-gaufrette-bundle": "dev-master",
"league/flysystem-bundle": "^2.4 || ^3.0",
"league/flysystem-memory": "^2.0 || ^3.0",
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
"mikey179/vfsstream": "^1.6.11",
"phpunit/phpunit": "^9.6",
"symfony/asset": "^5.4 || ^6.0 || ^7.0",
"symfony/browser-kit": "^5.4 || ^6.0 || ^7.0",
"symfony/css-selector": "^5.4 || ^6.0 || ^7.0",
"symfony/doctrine-bridge": "^5.4 || ^6.0 || ^7.0",
"symfony/dom-crawler": "^5.4 || ^6.0 || ^7.0",
"symfony/form": "^5.4 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^7.0",
"symfony/security-csrf": "^5.4 || ^6.0 || ^7.0",
"symfony/translation": "^5.4 || ^6.0 || ^7.0",
"symfony/twig-bridge": "^5.4 || ^6.0 || ^7.0",
"symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0",
"symfony/validator": "^5.4 || ^6.0 || ^7.0",
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
"yoast/phpunit-polyfills": "^2.0"
},
"suggest": {
"doctrine/annotations": "If you use doctrine/doctrine-bundle >2.7, this package is required to use annotations",
"doctrine/doctrine-bundle": "For integration with Doctrine",
"doctrine/mongodb-odm-bundle": "For integration with Doctrine ODM",
"doctrine/orm": "For integration with Doctrine ORM",
"doctrine/phpcr-odm": "For integration with Doctrine PHPCR",
"knplabs/knp-gaufrette-bundle": "For integration with Gaufrette",
"league/flysystem-bundle": "For integration with Flysystem",
"liip/imagine-bundle": "To generate image thumbnails",
"oneup/flysystem-bundle": "For integration with Flysystem",
"symfony/asset": "To generate better links",
"symfony/form": "To handle uploads in forms",
"symfony/yaml": "To use YAML mapping"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Vich\\UploaderBundle\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dustin Dobervich",
"email": "ddobervich@gmail.com"
}
],
"description": "Ease file uploads attached to entities",
"homepage": "https://github.com/dustin10/VichUploaderBundle",
"keywords": [
"file uploads",
"upload"
],
"support": {
"issues": "https://github.com/dustin10/VichUploaderBundle/issues",
"source": "https://github.com/dustin10/VichUploaderBundle/tree/v2.4.3"
},
"time": "2024-11-18T06:29:52+00:00"
},
{
"name": "webmozart/assert",
"version": "1.11.0",

View File

@@ -16,4 +16,5 @@ return [
SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
Symfony\UX\Turbo\TurboBundle::class => ['all' => true],
Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true],
];

View File

@@ -4,6 +4,7 @@ namespace App\Controller;
use App\Entity\Participant;
use App\Form\ProfileFormType;
use App\Repository\SortieRepository;
use App\Service\FileUploader;
use App\Form\RegistrationFormType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@@ -18,9 +19,11 @@ class ProfileController extends AbstractController
{
private FileUploader $fileUploader;
private ParticipantRepository $profileRepo;
public function __construct(FileUploader $fileUploader, ParticipantRepository $profileRepo) {
private SortieRepository $sortieRepo;
public function __construct(FileUploader $fileUploader, ParticipantRepository $profileRepo, SortieRepository $sortieRepo) {
$this->fileUploader = $fileUploader;
$this->profileRepo = $profileRepo;
$this->sortieRepo = $sortieRepo;
}
#[Route('/profile/{uuid}', name: 'profile_view', methods: ['GET'])]
public function viewProfile(string $uuid, ParticipantRepository $profileRepo, TokenStorageInterface $tokenStorage): Response
@@ -28,6 +31,8 @@ class ProfileController extends AbstractController
$token = $tokenStorage->getToken();
$userConnect = $token?->getUser();
$currentProfile = $profileRepo->findOneBy(['idParticipant' => $uuid]);
$sortiesOrganisation = $this->sortieRepo->findUserOrganisation($userConnect);
$sortiesParticipation =$this->sortieRepo->findUserParticipation($userConnect);
if ($userConnect->getIdParticipant() !== $currentProfile->getIdParticipant()) {
$isActiveUser = false;
} else {
@@ -36,6 +41,8 @@ class ProfileController extends AbstractController
return $this->render('profile/view.html.twig', [
'profile' => $currentProfile,
'isActiveUser' => $isActiveUser,
'sortiesOrganisation' => $sortiesOrganisation,
'sortiesParticipation' => $sortiesParticipation
]);
}

View File

@@ -327,5 +327,14 @@
},
"twig/extra-bundle": {
"version": "v3.15.0"
},
"vich/uploader-bundle": {
"version": "2.4",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "1.13",
"ref": "1b3064c2f6b255c2bc2f56461aaeb76b11e07e36"
}
}
}

View File

@@ -46,15 +46,15 @@
<div class="relative">
{% if app.user %}
<button id="profile-menu" class="flex items-center space-x-2 focus:outline-none">
<span class="text-white font-medium hidden md:inline">{{ profile.prenom }}</span>
<img src="{{ profile.fileName ? asset('upload/image/profile/' ~ profile.fileName) : asset('upload/image/profile/default.png') }}"
class="w-10 h-10 rounded-full border-2 border-white">
<span class="text-white font-medium hidden md:inline">Profil</span>
</button>
<!-- Menu déroulant -->
<div id="dropdown" class="hidden absolute right-0 mt-2 w-48 bg-white shadow-md rounded-lg">
<ul class="py-2 text-gray-700">
<li><a href="{{ path('profile_view', {'uuid': app.user.idParticipant}) }}" class="block px-4 py-2 hover:bg-gray-100">Mon profil</a></li>
<li><a href="{{ path('dashboard', {'uuid': app.user.idParticipant}) }}" class="block px-4 py-2 hover:bg-gray-100">Dashboard</a></li>
{# <li><a href="{{ path('dashboard', {'uuid': app.user.idParticipant}) }}" class="block px-4 py-2 hover:bg-gray-100">Dashboard</a></li>#}
{% if 'ROLE_ADMIN' in app.user.roles %}
<li><a href="{{ path('app_admin') }}" class="block px-4 py-2 hover:bg-gray-100">Administration</a></li>
{% endif %}

View File

@@ -10,7 +10,7 @@
{% endblock %}
{% block content %}
<div class="relative mx-auto md:max-w-xl py-48 min-w-0 break-words">
<div class="relative mx-auto md:max-w-xl pt-24 pb-8 min-w-0 break-words">
<div class="flex flex-wrap justify-center mb-16">
<div class="w-full flex justify-center">
<div class="relative">