diff --git a/Project/php/config/config.php b/Project/php/config/config.php index ae9c833..0fbb5bc 100755 --- a/Project/php/config/config.php +++ b/Project/php/config/config.php @@ -18,4 +18,4 @@ global $password; $password = 'achanger'; global $altorouterPath; -$altorouterPath = "/~lugoigoux1/SAE_2A_Anglais/Project/php"; +$altorouterPath = "/SAE_2A_Anglais/Project/php"; diff --git a/Project/php/controller/FrontController.php b/Project/php/controller/FrontController.php index 1d3873d..2d69b2e 100755 --- a/Project/php/controller/FrontController.php +++ b/Project/php/controller/FrontController.php @@ -88,6 +88,12 @@ class FrontController public static function home(): void { 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', ); + } } } \ No newline at end of file diff --git a/Project/php/controller/VisitorController.php b/Project/php/controller/VisitorController.php index 3db78b2..5d6d07b 100755 --- a/Project/php/controller/VisitorController.php +++ b/Project/php/controller/VisitorController.php @@ -87,6 +87,7 @@ class VisitorController } public function confirmLogin(): void { + global $user; $model = new MdlUser(); if($_POST['logemail']!=null && $_POST['logpass']!=null) { $login = strip_tags($_POST['logemail']); diff --git a/Project/php/css/memory.css b/Project/php/css/memory.css index 00968b9..a68874f 100755 --- a/Project/php/css/memory.css +++ b/Project/php/css/memory.css @@ -2,10 +2,9 @@ body { display: flex; justify-content: center; align-items: center; - height: 100vh; + height: 90vh; background-color: #f0f0f0; - margin-left: 15vh; - margin-right: 15vh; + margin: 2vh 15vh; overflow: hidden; } @@ -31,8 +30,8 @@ body { cursor: pointer; transition: transform 0.6s ease; transform-style: preserve-3d; - min-height: 10vh; - min-width: 20vh; + min-height: 5vh; + max-width: 100%; aspect-ratio: 1/1; } diff --git a/Project/php/css/styles.css b/Project/php/css/styles.css index af587db..dc9fd35 100755 --- a/Project/php/css/styles.css +++ b/Project/php/css/styles.css @@ -616,7 +616,7 @@ progress { .logo { margin-top: 10%; - height: 10vh; + max-height: 8vh; } .figure-caption { @@ -11070,7 +11070,7 @@ body { padding: 0.9rem 0; } #secondNav .navbar-nav .nav-item:hover { - color: fade(#fff, 80%); + color: #7464a1; outline: none; background-color: transparent; } @@ -11101,13 +11101,13 @@ body { color: #fff; } #secondNav.navbar-shrink { - background-color: #fff; + background-color: #7464a1; } #secondNav.navbar-shrink .navbar-brand { color: #000; } #secondNav.navbar-shrink .nav-link { - color: #000; + color: #fff; padding: 1.5rem 1.5rem 1.25rem; border-bottom: 0.25rem solid transparent; } @@ -11338,4 +11338,8 @@ body { .app-badge { height: 3rem; +} + +.content{ + padding : 12vh; } \ No newline at end of file diff --git a/Project/php/js/scripts.js b/Project/php/js/scripts.js index 80e45f3..d9af6e5 100755 --- a/Project/php/js/scripts.js +++ b/Project/php/js/scripts.js @@ -11,7 +11,7 @@ window.addEventListener('DOMContentLoaded', event => { // Navbar shrink function var navbarShrink = function () { - const navbarCollapsible = document.body.querySelector('#mainNav'); + const navbarCollapsible = document.body.querySelector('#secondNav'); if (!navbarCollapsible) { return; } @@ -30,10 +30,10 @@ window.addEventListener('DOMContentLoaded', event => { document.addEventListener('scroll', navbarShrink); // Activate Bootstrap scrollspy on the main nav element - const mainNav = document.body.querySelector('#mainNav'); + const mainNav = document.body.querySelector('#secondNav'); if (mainNav) { new bootstrap.ScrollSpy(document.body, { - target: '#mainNav', + target: '#secondNav', rootMargin: '0px 0px -40%', }); }; diff --git a/Project/php/templates/addVocabList.html b/Project/php/templates/addVocabList.html index 461ebc3..3f6da50 100755 --- a/Project/php/templates/addVocabList.html +++ b/Project/php/templates/addVocabList.html @@ -17,29 +17,30 @@ - -
-

Add words

- {% if user is defined %} -
- - - - - {% for i in 0..1 %} - - - - - {% endfor %} - -
- - -
-
- {% endif %} -
- +{% include 'navbar.twig' %} +
+
+

Add words

+ {% if user is defined %} +
+ + + + + {% for i in 0..1 %} + + + + + {% endfor %} + +
+ + +
+
+ {% endif %} +
+
\ No newline at end of file diff --git a/Project/php/templates/home.html b/Project/php/templates/home.html index 016b973..40dd435 100755 --- a/Project/php/templates/home.html +++ b/Project/php/templates/home.html @@ -21,24 +21,7 @@ - + {% include 'navbar.twig' %}
diff --git a/Project/php/templates/manageGroupView.html b/Project/php/templates/manageGroupView.html index fd06196..a5e35eb 100755 --- a/Project/php/templates/manageGroupView.html +++ b/Project/php/templates/manageGroupView.html @@ -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" rel="stylesheet" /> - + -
-

Group list

- {% include 'groupContainer.twig' with {'actions' : ['showGroupDetails', 'removeGroup']} %} -
-
-

Users of the group

- {% include 'userContainer.twig' with {'users' : users, 'action' : 'removeUserFromGroup'} %} -
-
-

Add group

- {% include 'addGroupForm.twig' %} -
-
-

Unassigned users

- {% include 'userContainer.twig' with {'users' : unassignedUsers, 'action' : 'addUserToGroup'} %} -
+{% include 'navbar.twig' %} +
+
+

Group list

+ {% include 'groupContainer.twig' with {'actions' : ['showGroupDetails', 'removeGroup']} %} +
+
+

Users of the group

+ {% include 'userContainer.twig' with {'users' : users, 'action' : 'removeUserFromGroup'} %} +
+
+

Add group

+ {% include 'addGroupForm.twig' %} +
+
+

Unassigned users

+ {% include 'userContainer.twig' with {'users' : unassignedUsers, 'action' : 'addUserToGroup'} %} +
+
+ + \ No newline at end of file diff --git a/Project/php/templates/manageVocabListView.html b/Project/php/templates/manageVocabListView.html index 3fe2ddf..69ddc23 100755 --- a/Project/php/templates/manageVocabListView.html +++ b/Project/php/templates/manageVocabListView.html @@ -25,26 +25,29 @@ } -
-
-

Vocab list

- {% include 'vocabularyContainer.twig' with {'actions' : 'affAllVocab', 'vocabularies' : vocabularies , 'userId' : userId } %} -
+{% include 'navbar.twig' %} +
+
+
+

Vocab list

+ {% include 'vocabularyContainer.twig' with {'actions' : 'affAllVocab', 'vocabularies' : vocabularies , 'userId' : userId } %} +
-
-

Vocab of the user

- {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'getByName', 'selectedName' : 'selectedName', 'userId' : userId } %} -
+
+

Vocab of the user

+ {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'getByName', 'selectedName' : 'selectedName', 'userId' : userId } %} +
-
-

Add Vocabb

- {% include 'vocabularyContainer.twig' with { 'actions' : 'addVocabList' , 'userId' : userId } %} -
+
+

Add Vocabb

+ {% include 'vocabularyContainer.twig' with { 'actions' : 'addVocabList' , 'userId' : userId } %} +
-
-

Unassigned vocab

- {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'delById', 'userId' : userId } %} -
+
+

Unassigned vocab

+ {% include 'vocabularyContainer.twig' with {'vocabularies' : vocabularies , 'actions' : 'delById', 'userId' : userId } %} +
+
diff --git a/Project/php/templates/navBar.html b/Project/php/templates/navBar.html deleted file mode 100755 index 8b6aed2..0000000 --- a/Project/php/templates/navBar.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - In English Please ! - - - - - - - - - - - - - - - - diff --git a/Project/php/templates/navBar.twig b/Project/php/templates/navBar.twig index 9f1343c..f8829cc 100755 --- a/Project/php/templates/navBar.twig +++ b/Project/php/templates/navBar.twig @@ -1,36 +1,36 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Project/php/templates/resultatsJeux.html b/Project/php/templates/resultatsJeux.html index d0e8e5d..d77d353 100755 --- a/Project/php/templates/resultatsJeux.html +++ b/Project/php/templates/resultatsJeux.html @@ -43,11 +43,14 @@ +{% include 'navbar.twig' %} +
Bravo ! Vous avez gagné 125 points !!
Célébration
+
diff --git a/Project/php/templates/usersView.html b/Project/php/templates/usersView.html index 303c428..b903ee5 100755 --- a/Project/php/templates/usersView.html +++ b/Project/php/templates/usersView.html @@ -3,11 +3,20 @@ Users + + + {% include 'navbar.twig' %} +
{% include 'userContainer.twig' with {'users' : users, 'action' : 'removeUser'} %}
+
+ + + + \ No newline at end of file