here
continuous-integration/drone/push Build is failing Details

issue_022_AjoutAmis
David D'ALMEIDA 1 year ago
parent 4ea6f09766
commit f7c8793301

@ -0,0 +1,177 @@
<?php
// namespace App\Controller;
// use App\Container;
// use App\Router\Request\IRequest;
// use App\Router\Response\Response;
// use Shared\Attributes\Route;
// use Twig\Environment;
// use Data\Core\Preferences;
// use Shared\Log;
// class AthleteController extends BaseController
// {
// #[Route(path: '/search-user', name: 'search-user', methods: ['GET'])]
// public function searchUser(string $username, IRequest $req): Response
// {
// $taberror = [];
// $utiliArray = [
// [
// 'nom' => 'John',
// 'prenom' => 'Doe',
// 'img' => 'john_doe',
// 'username' => 'johndoe',
// ],
// [
// 'nom' => 'Alice',
// 'prenom' => 'Smith',
// 'img' => 'alice_smith',
// 'username' => 'alicesmith',
// ],
// ];
// // if(!Validation::val_string($name)){
// try {
// //code...
// // $model->userMgr->getUser($name);
// return $this->render('./page/addfriend.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => $utiliArray,
// 'infoUser' => [],
// 'exos' => [],
// 'member' => [],
// 'responce' => "Notification d'ajout envoyée à $username"
// ]);
// } catch (\Throwable $th) {
// //throw $th;
// // return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
// }
// // }
// }
// #[Route(path: '/analyses', name: 'analyses', methods: ['GET'])]
// public function analyses(): Response
// {
// return $this->render('./page/analyze.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// #[Route(path: '/exercice', name: 'exercice', methods: ['GET'])] // 8
// public function exercice(): Response
// {
// return $this->render('./page/exercice.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// #[Route(path: '/add-friend', name: 'add-friend', methods: ['POST'])]
// public function addFriend(string $username, IRequest $req): Response
// {
// $taberror = [];
// $utiliArray = [
// [
// 'nom' => 'John',
// 'prenom' => 'Doe',
// 'img' => 'john_doe',
// 'username' => 'johndoe',
// ],
// [
// 'nom' => 'Alice',
// 'prenom' => 'Smith',
// 'img' => 'alice_smith',
// 'username' => 'alicesmith',
// ],
// ];
// // if(!Validation::val_string($name)){
// try {
// //code...
// // $model->userMgr->addFriend($name);
// return $this->render('./page/addfriend.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => $utiliArray,
// 'infoUser' => [],
// 'exos' => [],
// 'member' => [],
// 'responce' => "Notification d'ajout envoyée à $username"
// ]);
// } catch (\Throwable $th) {
// //throw $th;
// // return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
// }
// // }
// }
// #[Route(path: '/delete-friend', name: 'delete-friend', methods: ['POST'])]
// #[Route(path: '/friend', name: 'friend', methods: ['GET'])]
// public function friend(): Response
// {
// $utiliArray = [
// [
// 'nom' => 'John',
// 'prenom' => 'Doe',
// 'img' => 'john_doe',
// 'username' => 'johndoe',
// ],
// [
// 'nom' => 'Alice',
// 'prenom' => 'Smith',
// 'img' => 'alice_smith',
// 'username' => 'alicesmith',
// ],
// ];
// // $this->Auth->getUser->role->getFriends
// return $this->render('./page/addfriend.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => $utiliArray,
// 'infoUser' => [],
// 'exos' => [],
// 'member' => [],
// ]);
// }
// }

@ -0,0 +1,80 @@
<?php
// namespace App\Controller;
// use App\Container;
// use App\Router\Request\IRequest;
// use App\Router\Response\Response;
// use Shared\Attributes\Route;
// use Twig\Environment;
// use Data\Core\Preferences;
// use Shared\Log;
// class AuthController extends BaseController
// {
// #[Route('/login', name: 'login')]
// public function login(?string $username, ?string $password ,IRequest $request): Response {
// // if user is already logged in, don't display the login page again
// if ($user) {
// return $this->redirectToRoute('blog_index');
// }
// // this statement solves an edge-case: if you change the locale in the login
// // page, after a successful login you are redirected to a page in the previous
// // locale. This code regenerates the referrer URL whenever the login page is
// // browsed, to ensure that its locale is always the current one.
// $this->saveTargetPath($request->getSession(), 'main', $this->generateUrl('admin_index'));
// return $this->render('security/login.html.twig', [
// // last username entered by the user (if any)
// 'last_username' => $helper->getLastUsername(),
// // last authentication error (if any)
// 'error' => $helper->getLastAuthenticationError(),
// ]);
// }
// #[Route('/login', name: 'login')]
// public function login(?string $username, ?string $password ,IRequest $request): Response {
// // if user is already logged in, don't display the login page again
// if ($user) {
// return $this->redirectToRoute('blog_index');
// }
// // this statement solves an edge-case: if you change the locale in the login
// // page, after a successful login you are redirected to a page in the previous
// // locale. This code regenerates the referrer URL whenever the login page is
// // browsed, to ensure that its locale is always the current one.
// $this->saveTargetPath($request->getSession(), 'main', $this->generateUrl('admin_index'));
// return $this->render('security/login.html.twig', [
// // last username entered by the user (if any)
// 'last_username' => $helper->getLastUsername(),
// // last authentication error (if any)
// 'error' => $helper->getLastAuthenticationError(),
// ]);
// }
// function inscription() {
// $model = new ModelVisitor();
// $log=Validation::clean_string($_POST['pseudo']);
// $mdp=Validation::clean_string($_POST['password']);
// if($model->createAUser($log,$mdp)){
// if(ModelUser::login($log, $mdp)){
// UserControler::displayView();
// }
// }
// }
// function login() {
// $model = new ModelVisitor();
// if(!isset($_POST['pseudo']) || !isset($_POST['password'])) throw new Exception(" some wrong with credentials !!!!!");
// $log=Validation::clean_string($_POST['pseudo']);
// $mdp=Validation::clean_string($_POST['password']);
// if(ModelUser::login($log, $mdp)){
// UserControler::displayView();
// }
// }
// }

@ -17,8 +17,6 @@ abstract class BaseController
$this->container = $container; $this->container = $container;
} }
abstract public function index(): Response;
protected function renderView(string $view, array $parameters = []): string protected function renderView(string $view, array $parameters = []): string
{ {
if (!$this->container->has(\Twig\Environment::class)) { if (!$this->container->has(\Twig\Environment::class)) {

@ -0,0 +1,128 @@
<?php
// namespace App\Controller;
// use App\Container;
// use App\Router\Request\IRequest;
// use App\Router\Response\Response;
// use App\Router\Response\IResponse;
// use Shared\Attributes\Route;
// use Twig\Environment;
// use Data\Core\Preferences;
// use Shared\Log;
// #[Route(path: '/coach', name: 'coach')]
// class CoachController extends BaseController
// {
// private ICoachManager $coachManager;
// private $security;
// public function __construct(DataManager $dataManager, Security $security)
// {
// $this->coachManager = $dataManager->coachMgr;
// $this->security = $security;
// }
// #[Route(path: '/', name: 'home', methods: ['GET'])]
// public function index(): Response
// {
// return $this->render('./page/home.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// #[Route('/global-stats', name: 'coach_global_stats', methods: ['GET'])]
// public function globalStats(): Response
// {
// // Add logic to fetch and process global stats
// return $this->render('coach/global_stats.html.twig');
// }
// #[Route(path: '/exercice', name: 'exercice', methods: ['GET'])] // 8
// public function exercice(): Response
// {
// return $this->render('./page/exercice.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// #[Route(path: '/coaching', name: 'coaching', methods: ['GET'])]
// public function coaching(): Response
// {
// return $this->render('./page/coaching.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// #[Route('/list-athletes', name: 'coach_list_athletes')]
// public function listAthletes(): Response
// {
// $coach = $this->security->getUser();
// $athletes = $this->coachManager->getAthletesForCoach($coach);
// return $this->render('coach/list_athletes.html.twig', [
// 'athletes' => $athletes,
// ]);
// }
// #[Route('/athlete-analysis/{athleteId}', name: 'coach_athlete_analysis', methods: ['GET'])]
// public function athleteAnalysis($athleteId): Response
// {
// // Fetch and process data specific to the athlete
// return $this->render('coach/athlete_analysis.html.twig', [
// 'athleteId' => $athleteId,
// ]);
// }
// #[Route('/add-athlete/{athleteId}', name: 'coach_add_athlete', methods: ['POST'])]
// public function addAthlete(IRequest $request, $athleteId): IResponse
// {
// // Implement logic to add athlete
// // ...
// return $this->redirectToRoute('coach_list_athletes');
// }
// // #[Route('/remove-athlete', name: 'coach_remove_athlete', methods: ['POST'])]
// // public function removeAthlete(int $athleteId, IRequest $request): IResponse
// // {
// // return $this->redirectToRoute("/athletes");
// // }
// }

@ -20,18 +20,33 @@ class Controller extends BaseController
{ {
session_start(); session_start();
$this->preference = new Preferences(); $this->preference = new Preferences();
setcookie('toto', 'wallah connard', time()+3600);
} }
#[Route(path: '/', name: 'home', methods: ['GET'])] // 8 #[Route(path: '/', name: 'home', methods: ['GET'])]
public function index(): Response public function index(): Response
{ {
return $this->render('./page/settings.html.twig',[ return $this->render('./page/home.html.twig',[
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'cook' => "home",
'css' => 'pink_theme',
'pp' => "test2", 'pp' => "test2",
'user' => "Ladmion le Cochon", 'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
}
#[Route(path: '/analyses', name: 'analyses', methods: ['GET'])]
public function analyses(): Response
{
return $this->render('./page/analyze.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
@ -47,9 +62,9 @@ class Controller extends BaseController
public function exercice(): Response public function exercice(): Response
{ {
return $this->render('./page/exercice.html.twig',[ return $this->render('./page/exercice.html.twig',[
'css' => $preference.getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Ladmion le Cochon", 'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
@ -60,32 +75,133 @@ class Controller extends BaseController
'member' => [] 'member' => []
]); ]);
} }
#[Route(path: '/search-user', name: 'search-user', methods: ['GET'])]
public function searchUser(string $username, IRequest $req): Response
{
$taberror = [];
$utiliArray = [
[
'nom' => 'John',
'prenom' => 'Doe',
'img' => 'john_doe',
'username' => 'johndoe',
],
[
'nom' => 'Alice',
'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
];
// if(!Validation::val_string($name)){
try {
//code...
// $model->userMgr->addFriend($name);
return $this->render('./page/addfriend.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => $utiliArray,
'infoUser' => [],
'exos' => [],
'member' => [],
'responce' => "Notification d'ajout envoyée à $username"
]);
} catch (\Throwable $th) {
//throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
}
// }
}
#[Route(path: '/add-friend', name: 'add-friend', methods: ['POST'])]
public function addFriend(string $username, IRequest $req): Response
{
$taberror = [];
$utiliArray = [
[
'nom' => 'John',
'prenom' => 'Doe',
'img' => 'john_doe',
'username' => 'johndoe',
],
[
'nom' => 'Alice',
'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
];
// if(!Validation::val_string($name)){
try {
//code...
// $model->userMgr->addFriend($name);
return $this->render('./page/addfriend.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => $utiliArray,
'infoUser' => [],
'exos' => [],
'member' => [],
'responce' => "Notification d'ajout envoyée à $username"
]);
} catch (\Throwable $th) {
//throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
}
// }
}
#[Route(path: '/friend', name: 'friend', methods: ['GET'])] // 8 #[Route(path: '/friend', name: 'friend', methods: ['GET'])]
public function friend(): Response public function friend(): Response
{ {
return $this->render('./page/friend.html.twig',[ $utiliArray = [
'css' => $preference.getCookie(), [
'nom' => 'John',
'prenom' => 'Doe',
'img' => 'john_doe',
'username' => 'johndoe',
],
[
'nom' => 'Alice',
'prenom' => 'Smith',
'img' => 'alice_smith',
'username' => 'alicesmith',
],
];
return $this->render('./page/addfriend.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Ladmion le Cochon", 'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
'mails' => [], 'mails' => [],
'users' => [], 'users' => $utiliArray,
'infoUser' => [], 'infoUser' => [],
'exos' => [], 'exos' => [],
'member' => [] 'member' => [],
]); ]);
} }
#[Route(path: '/coaching', name: 'coaching', methods: ['GET'])] // 8 #[Route(path: '/coaching', name: 'coaching', methods: ['GET'])]
public function coaching(): Response public function coaching(): Response
{ {
return $this->render('./page/coaching.html.twig',[ return $this->render('./page/coaching.html.twig',[
'css' => $preference.getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Ladmion le Cochon", 'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
@ -97,13 +213,13 @@ class Controller extends BaseController
]); ]);
} }
#[Route(path: '/mail', name: 'mail', methods: ['GET'])] // 8 #[Route(path: '/mail', name: 'mail', methods: ['GET'])]
public function mail(): Response public function mail(): Response
{ {
return $this->render('./page/mail.html.twig',[ return $this->render('./page/mail.html.twig',[
'css' => $preference.getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Ladmion le Cochon", 'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
@ -115,13 +231,13 @@ class Controller extends BaseController
]); ]);
} }
#[Route(path: '/import', name: 'import', methods: ['GET'])] // 8 #[Route(path: '/import', name: 'import', methods: ['GET'])]
public function import(): Response public function import(): Response
{ {
return $this->render('./page/import.html.twig',[ return $this->render('./page/import.html.twig',[
'css' => $preference.getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Ladmion le Cochon", 'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],
@ -133,28 +249,36 @@ class Controller extends BaseController
]); ]);
} }
#[Route(path: '/hello', name: 'hello', methods: ['GET'])] #[Route(path: '/settings', name: 'settings', methods: ['GET'])]
public function hello(): Response public function settings(IRequest $req): Response
{ {
return new Response('Hello'); return $this->render('./page/settings.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
} }
#[Route(path: '/', name: 'preferences', methods: ['POST'])] #[Route(path: '/preferences', name: 'preferences', methods: ['POST'])]
public function preferences(string $theme, IRequest $req): Response public function preferences(string $theme, IRequest $req): Response
{ {
/*TODO*/ /*TODO*/
// FAUT VALIDER LES DONNEES BATARD // VALIDER LES DONNEES
$this->preference->majCookie($theme); $this->preference->majCookie($theme);
// throw new \Exception("connard");
// return new Response("");
return $this->render('./page/settings.html.twig',[ return $this->render('./page/settings.html.twig',[
'css' => $this->preference->getCookie(),
'cook' => $_COOKIE['preferences'] ?? "salopard",
'css' => $this->preference->getCookie(), 'css' => $this->preference->getCookie(),
'pp' => "test2", 'pp' => "test2",
'user' => "Ladmion le Cochon", 'user' => "Doe",
'role' => "Athlète", 'role' => "Athlète",
'friendship' => [], 'friendship' => [],
'analyzes' => [], 'analyzes' => [],

@ -0,0 +1,36 @@
<?php
// namespace App\Controller;
// use App\Container;
// use App\Router\Request\IRequest;
// use App\Router\Response\Response;
// use Shared\Attributes\Route;
// use Twig\Environment;
// use Data\Core\Preferences;
// use Shared\Log;
// class HeartRateController extends BaseController
// {
// #[Route(path: '/import', name: 'import', methods: ['GET'])]
// public function import(): Response
// {
// return $this->render('./page/import.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// }

@ -0,0 +1,17 @@
<!-- #[Route(path: '/mail', name: 'mail', methods: ['GET'])]
public function mail(): Response
{
return $this->render('./page/mail.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => [],
'infoUser' => [],
'exos' => [],
'member' => []
]);
} -->

@ -0,0 +1,80 @@
<?php
// namespace App\Controller;
// use App\Container;
// use App\Router\Request\IRequest;
// use App\Router\Response\Response;
// use Shared\Attributes\Route;
// use Twig\Environment;
// use Data\Core\Preferences;
// use Shared\Log;
// class UserController extends BaseController
// {
// #[Route(path: '/', name: 'home', methods: ['GET'])]
// public function index(): Response
// {
// return $this->render('./page/home.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// #[Route(path: '/settings', name: 'settings', methods: ['GET'])]
// public function settings(IRequest $req): Response
// {
// return $this->render('./page/settings.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// #[Route(path: '/preferences', name: 'preferences', methods: ['POST'])]
// public function preferences(string $theme, IRequest $req): Response
// {
// /*TODO*/
// // VALIDER LES DONNEES
// $this->preference->majCookie($theme);
// return $this->render('./page/settings.html.twig',[
// 'css' => $this->preference->getCookie(),
// 'pp' => "test2",
// 'user' => "Doe",
// 'role' => "Athlète",
// 'friendship' => [],
// 'analyzes' => [],
// 'mails' => [],
// 'users' => [],
// 'infoUser' => [],
// 'exos' => [],
// 'member' => []
// ]);
// }
// }

@ -32,10 +32,10 @@
<img src="/assets/img/person/{% block pp %}test{% endblock %}.png" width="30px" height="30px" class="image-ronde"></i> <img src="/assets/img/person/{% block pp %}test{% endblock %}.png" width="30px" height="30px" class="image-ronde"></i>
</a> </a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown"> <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#!">Profile</a></li> <li><a class="dropdown-item" href="/profile">Profile</a></li>
<li><a class="dropdown-item" href="#!">Paramètres</a></li> <li><a class="dropdown-item" href="/settings">Paramètres</a></li>
<li><hr class="dropdown-divider" /></li> <li><hr class="dropdown-divider" /></li>
<li><a class="dropdown-item" href="#!">Déconnexion</a></li> <li><a class="dropdown-item" href="/logout">Déconnexion</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -55,7 +55,7 @@
<div class="sb-nav-link-icon"><img src="/assets/img/sprinter.png"></div> <div class="sb-nav-link-icon"><img src="/assets/img/sprinter.png"></div>
Exercices Exercices
</a> </a>
<a class="nav-link" href="analyze.html"> <a class="nav-link" href="/analyses">
<div class="sb-nav-link-icon"><i class="fas fa-chart-area"></i></div> <div class="sb-nav-link-icon"><i class="fas fa-chart-area"></i></div>
Analyses Analyses
</a> </a>

@ -45,10 +45,18 @@
<td>{{utili.prenom}}</td> <td>{{utili.prenom}}</td>
<td style=" <td style="
padding-left: 45%;"> padding-left: 45%;">
<button class="btn btn-primary" id="btnNavbarSearch" type="button">Ajouter un ami</button> <form method="post" action="/add-friend">
<input type="hidden" name="username" value="{{ utili.username }}">
<button class="btn btn-primary" type="submit">Ajouter un ami</button>
</form>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
{% if responce is defined %}
<p>{{ responce }}</p>
{% endif %}
</tbody> </tbody>
</table> </table>
</div> </div>

@ -21,6 +21,9 @@
<div class="card-body"> <div class="card-body">
<div class="datatable-container"> <div class="datatable-container">
<table id="datatablesSimple" class="datatable-table"> <table id="datatablesSimple" class="datatable-table">
{% if friendship is empty %}
<p>Vous n'avez aucun ami .</p>
{% else %}
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
@ -31,20 +34,21 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for ami in friendship %} {% for ami in friendship %}
<tr> <tr>
<td><style> .image-ronde{ clip-path:ellipse(50% 50%); } </style> <td><style> .image-ronde{ clip-path:ellipse(50% 50%); } </style>
<img src="/assets/img/person/{{ami.img}}.png" width="35px" height="35px" class="image-ronde"></td> <img src="/assets/img/person/{{ami.img}}.png" width="35px" height="35px" class="image-ronde"></td>
<td>{{ami.nom}}</td> <td>{{ami.nom}}</td>
<td>{{ami.prenom}}</td> <td>{{ami.prenom}}</td>
<td>{{ami.status}}</td> <td>{{ami.status}}</td>
<td> <td>
<a href="#"><img src="/assets/img/msg.png"></a> <a href="#"><img src="/assets/img/msg.png"></a>
<a href="#"><img src="/assets/img/block.png"></a> <a href="#"><img src="/assets/img/block.png"></a>
<a href="#"><img src="/assets/img/delete.png"></a> <a href="#"><img src="/assets/img/delete.png"></a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
{% endif %}
</tbody> </tbody>
</table> </table>
</div> </div>

@ -55,7 +55,7 @@
Générale Générale
</div> </div>
<div class="card-body"> <div class="card-body">
<form id="preferencesForm" method="post"> <form id="preferencesForm" method="post" action="/preferences">
<div> <div>
<label for="notif">Notifications:</label> <label for="notif">Notifications:</label>
<input type="checkbox" id="notif" name="notifications"> <input type="checkbox" id="notif" name="notifications">
@ -68,7 +68,6 @@
<option value="pink_theme">Rose</option> <option value="pink_theme">Rose</option>
</select> </select>
</div> </div>
<p>{{cook}}</p>
<button type="submit" id="saveButton" class="btn btn-primary">Enregistrer</button> <button type="submit" id="saveButton" class="btn btn-primary">Enregistrer</button>
</form> </form>
</div> </div>

Loading…
Cancel
Save