Fix nav bar

Manque des fonctionnalités à régler avec l'altorouteur + gérer Front
php
Antoine JOURDAIN 1 year ago
parent 32043c5f8c
commit 945263d1f0

@ -18,4 +18,4 @@ global $password;
$password = 'achanger'; $password = 'achanger';
global $altorouterPath; global $altorouterPath;
$altorouterPath = "/~lugoigoux1/SAE_2A_Anglais/Project/php"; $altorouterPath = "/SAE_2A_Anglais/Project/php";

@ -88,6 +88,12 @@ class FrontController
public static function home(): void { public static function home(): void {
global $twig; global $twig;
echo $twig->render('home.html'); global $user;
if(isset($user)){
echo $twig->render('home.html', ['userID' => $user->getId(), 'userRole' => $user->getRoles()]);
}
else{
echo $twig->render('home.html', );
}
} }
} }

@ -87,6 +87,7 @@ class VisitorController
} }
public function confirmLogin(): void { public function confirmLogin(): void {
global $user;
$model = new MdlUser(); $model = new MdlUser();
if($_POST['logemail']!=null && $_POST['logpass']!=null) { if($_POST['logemail']!=null && $_POST['logpass']!=null) {
$login = strip_tags($_POST['logemail']); $login = strip_tags($_POST['logemail']);

@ -2,10 +2,9 @@ body {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100vh; height: 90vh;
background-color: #f0f0f0; background-color: #f0f0f0;
margin-left: 15vh; margin: 2vh 15vh;
margin-right: 15vh;
overflow: hidden; overflow: hidden;
} }
@ -31,8 +30,8 @@ body {
cursor: pointer; cursor: pointer;
transition: transform 0.6s ease; transition: transform 0.6s ease;
transform-style: preserve-3d; transform-style: preserve-3d;
min-height: 10vh; min-height: 5vh;
min-width: 20vh; max-width: 100%;
aspect-ratio: 1/1; aspect-ratio: 1/1;
} }

@ -616,7 +616,7 @@ progress {
.logo { .logo {
margin-top: 10%; margin-top: 10%;
height: 10vh; max-height: 8vh;
} }
.figure-caption { .figure-caption {
@ -11070,7 +11070,7 @@ body {
padding: 0.9rem 0; padding: 0.9rem 0;
} }
#secondNav .navbar-nav .nav-item:hover { #secondNav .navbar-nav .nav-item:hover {
color: fade(#fff, 80%); color: #7464a1;
outline: none; outline: none;
background-color: transparent; background-color: transparent;
} }
@ -11101,13 +11101,13 @@ body {
color: #fff; color: #fff;
} }
#secondNav.navbar-shrink { #secondNav.navbar-shrink {
background-color: #fff; background-color: #7464a1;
} }
#secondNav.navbar-shrink .navbar-brand { #secondNav.navbar-shrink .navbar-brand {
color: #000; color: #000;
} }
#secondNav.navbar-shrink .nav-link { #secondNav.navbar-shrink .nav-link {
color: #000; color: #fff;
padding: 1.5rem 1.5rem 1.25rem; padding: 1.5rem 1.5rem 1.25rem;
border-bottom: 0.25rem solid transparent; border-bottom: 0.25rem solid transparent;
} }
@ -11339,3 +11339,7 @@ body {
.app-badge { .app-badge {
height: 3rem; height: 3rem;
} }
.content{
padding : 12vh;
}

@ -11,7 +11,7 @@ window.addEventListener('DOMContentLoaded', event => {
// Navbar shrink function // Navbar shrink function
var navbarShrink = function () { var navbarShrink = function () {
const navbarCollapsible = document.body.querySelector('#mainNav'); const navbarCollapsible = document.body.querySelector('#secondNav');
if (!navbarCollapsible) { if (!navbarCollapsible) {
return; return;
} }
@ -30,10 +30,10 @@ window.addEventListener('DOMContentLoaded', event => {
document.addEventListener('scroll', navbarShrink); document.addEventListener('scroll', navbarShrink);
// Activate Bootstrap scrollspy on the main nav element // Activate Bootstrap scrollspy on the main nav element
const mainNav = document.body.querySelector('#mainNav'); const mainNav = document.body.querySelector('#secondNav');
if (mainNav) { if (mainNav) {
new bootstrap.ScrollSpy(document.body, { new bootstrap.ScrollSpy(document.body, {
target: '#mainNav', target: '#secondNav',
rootMargin: '0px 0px -40%', rootMargin: '0px 0px -40%',
}); });
}; };

@ -17,7 +17,8 @@
<!-- Core theme CSS (includes Bootstrap)--> <!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles.css" rel="stylesheet" /> <link href="css/styles.css" rel="stylesheet" />
</head> </head>
{% include 'navbar.twig' %}
<div class="content">
<section> <section>
<h1>Add words</h1> <h1>Add words</h1>
{% if user is defined %} {% if user is defined %}
@ -40,6 +41,6 @@
</form> </form>
{% endif %} {% endif %}
</section> </section>
</div>
</body> </body>
</html> </html>

@ -21,24 +21,7 @@
<body id="page-top"> <body id="page-top">
<!-- Navigation--> <!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav"> {% include 'navbar.twig' %}
<div class="container">
<a class="navbar-brand" href="#page-top"><img class="logo" src="{{base}}/assets/img/logo.png"/></a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
aria-label="Toggle navigation">
Menu
<i class="fas fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="#game">Game</a></li>
<li class="nav-item"><a class="nav-link" href="#download">Download</a></li>
<li class="nav-item"><a class="nav-link" href="{{base}}/visitor/login">My account</a></li>
</ul>
</div>
</div>
</nav>
<!-- Masthead--> <!-- Masthead-->
<header class="masthead"> <header class="masthead">
<div class="container px-4 px-lg-5 d-flex h-100 align-items-center justify-content-center"> <div class="container px-4 px-lg-5 d-flex h-100 align-items-center justify-content-center">

@ -15,7 +15,7 @@
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet" /> rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)--> <!-- Core theme CSS (includes Bootstrap)-->
<link href="css/styles.css" rel="stylesheet" /> <link href="{{base}}/css/styles.css" rel="stylesheet" />
</head> </head>
<style> <style>
section { section {
@ -24,6 +24,8 @@
} }
</style> </style>
<body> <body>
{% include 'navbar.twig' %}
<div class="content">
<section class="groupList"> <section class="groupList">
<h2>Group list</h2> <h2>Group list</h2>
{% include 'groupContainer.twig' with {'actions' : ['showGroupDetails', 'removeGroup']} %} {% include 'groupContainer.twig' with {'actions' : ['showGroupDetails', 'removeGroup']} %}
@ -40,5 +42,8 @@
<h1>Unassigned users</h1> <h1>Unassigned users</h1>
{% include 'userContainer.twig' with {'users' : unassignedUsers, 'action' : 'addUserToGroup'} %} {% include 'userContainer.twig' with {'users' : unassignedUsers, 'action' : 'addUserToGroup'} %}
</section> </section>
</div>
<script src="{{base}}/js/scripts.js"></script>
</body> </body>
</html> </html>

@ -25,6 +25,8 @@
} }
</style> </style>
<body> <body>
{% include 'navbar.twig' %}
<div class="content">
<div class="section"> <div class="section">
<section class="VocabularyList"> <section class="VocabularyList">
<h2>Vocab list</h2> <h2>Vocab list</h2>
@ -46,5 +48,6 @@
{% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'delById', 'userId' : userId } %} {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'delById', 'userId' : userId } %}
</section> </section>
</div> </div>
</div>
</body> </body>
</html> </html>

@ -1,43 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>In English Please !</title>
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" />
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet" />
<link
href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
rel="stylesheet" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="../css/styles.css" rel="stylesheet" />
</head>
<body id="navBar">
<!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="secondNav">
<div class="container px-4 px-lg-5">
<a class="navbar-brand" href="index.html">Logo</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
aria-label="Toggle navigation">
Menu
<i class="fas fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="#game">Game</a></li>
<li class="nav-item"><a class="nav-link" href="#download">Download</a></li>
<li class="nav-item"><a class="nav-link" href="login.html">My account</a></li>
</ul>
</div>
</div>
</nav>
</body>
</html>

@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="secondNav"> <nav class="navbar navbar-expand-lg navbar-light fixed-top" id="secondNav">
<div class="container px-4 px-lg-5"> <div class="container px-4 px-lg-5">
<a class="navbar-brand" href="index.html">Logo</a> <a class="navbar-brand" href="{{base}}"><img class="logo" src="{{base}}/assets/img/logo.png"/></a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" <button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
aria-label="Toggle navigation"> aria-label="Toggle navigation">
@ -15,8 +15,8 @@
<li class="nav-item"><a class="nav-link" href="{{ base }}/admin/{{ userID }}/showAccountInfos">My account</a></li> <li class="nav-item"><a class="nav-link" href="{{ base }}/admin/{{ userID }}/showAccountInfos">My account</a></li>
{% endif %} {% endif %}
{% if 'student' in userRole%} {% if 'student' in userRole%}
<li class="nav-item"><a class="nav-link" href="{{ base }}/user/memory">Learn a lesson</a></li> <li class="nav-item"><a class="nav-link" href="{{ base }}/visitor/memory">Learn a lesson</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/user/game">Play</a></li> <li class="nav-item"><a class="nav-link" href="{{ base }}/visitor/game">Play</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/createFC}}">Create flashcards</a></li> <li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/createFC}}">Create flashcards</a></li>
<li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/showAccountInfos">My account</a></li> <li class="nav-item"><a class="nav-link" href="{{ base }}/student/{{ userID }}/showAccountInfos">My account</a></li>
{% endif %} {% endif %}
@ -27,9 +27,9 @@
<li class="nav-item"><a class="nav-link" href="{{ base }}/teacher/{{ userID }}/showAccountInfos">My account</a></li> <li class="nav-item"><a class="nav-link" href="{{ base }}/teacher/{{ userID }}/showAccountInfos">My account</a></li>
{% endif %} {% endif %}
{% if userRole is empty %} {% if userRole is empty %}
<li class="nav-item"><a class="nav-link" href="{{base}}/user/login">Login</a></li> <li class="nav-item"><a class="nav-link" href="{{base}}/visitor/login">Login</a></li>
{% endif %} {% endif %}
<li class="nav-item"><a class="nav-link" href="{{ base }}/user/disconnect">Log out</a></li> <li class="nav-item"><a class="nav-link" href="{{ base }}/visitor/disconnect">Log out</a></li>
</ul> </ul>
</div> </div>
</div> </div>

@ -43,11 +43,14 @@
</head> </head>
<body> <body>
{% include 'navbar.twig' %}
<div class="content">
<div class="container"> <div class="container">
<div class="message"> <div class="message">
Bravo ! Vous avez gagné 125 points !! Bravo ! Vous avez gagné 125 points !!
</div> </div>
<img class="celebration-image" src="../assets/img/celeb.png" alt="Célébration"> <img class="celebration-image" src="../assets/img/celeb.png" alt="Célébration">
</div> </div>
</div>
</body> </body>
</html> </html>

@ -3,11 +3,20 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Users</title> <title>Users</title>
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<link href="{{base}}/css/styles.css" rel="stylesheet" />
</head> </head>
<body> <body>
{% include 'navbar.twig' %}
<div class="content">
<section> <section>
{% include 'userContainer.twig' with {'users' : users, 'action' : 'removeUser'} %} {% include 'userContainer.twig' with {'users' : users, 'action' : 'removeUser'} %}
</section> </section>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="{{base}}/js/scripts.js"></script>
</body> </body>
</html> </html>
Loading…
Cancel
Save