From 5fff67c9b3bc907f7ee6167dc166888f9e88cfcc Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 19 Feb 2016 13:42:28 +0100 Subject: [PATCH] - [x] [index] Gestion avec tableau des redirections - [ ] [view/clusters] Interface de gestion des groupes - [x] [src/static/menu-side][view] Ajout de l'icone des groupes - [x] [action-script] Ajout de la page a page-manager - [x] [view/groups] Ajout de la page physique --- css/menu-side.css | 2 +- css/menu-side.scss | 4 +- index.php | 27 ++-- js/action-script.js | 2 +- src/static/menu-side/groups.svg | 65 +++++++++ todo.md | 5 + view.php | 1 + view/groups.php | 249 ++++++++++++++++++++++++++++++++ 8 files changed, 336 insertions(+), 19 deletions(-) create mode 100644 src/static/menu-side/groups.svg create mode 100755 view/groups.php diff --git a/css/menu-side.css b/css/menu-side.css index 1b4a993..e03a073 100755 --- a/css/menu-side.css +++ b/css/menu-side.css @@ -1,2 +1,2 @@ -#WRAPPER>#MENU-SIDE>span[data-link]{display:block;position:relative;width:calc( 4em - 2*.7em - 2*.55em - 2*.01em );height:calc( 4em - 2*.7em - 2*.55em - 2*.01em );margin:2em .7em;padding:.55em;border:.01em solid transparent;border-radius:2px;color:#a2a2a2;line-height:calc( 4em - 2*.7em - 2*.55em - 2*.01em );transition:color .3s, border .3s;cursor:pointer}#WRAPPER>#MENU-SIDE>span[data-link].mt{margin-top:3em}#WRAPPER>#MENU-SIDE>span[data-link].mb{margin-bottom:3em}#WRAPPER>#MENU-SIDE>span[data-link] svg,#WRAPPER>#MENU-SIDE>span[data-link] svg *{width:calc( 4em / 2.5 );height:calc( 4em / 2.5 );transition:fill .3s;pointer-events:none}#WRAPPER>#MENU-SIDE>span[data-link][data-desc]:after{content:attr(data-desc);display:block;position:absolute;top:calc( .7em - 2*.3em );left:calc( 4.6em - 2*.3em );padding:.3em;border-radius:3px;background-color:#2a2a2a;color:#e2e2e2;white-space:nowrap;transition:transform .1s;transform-origin:0 0;transform:scaleX(0)}#WRAPPER>#MENU-SIDE>span[data-link]:hover,#WRAPPER>#MENU-SIDE>span[data-link].active{color:#e63321;border-color:#e6e6e6;box-shadow:inset 0 0 .5em #eee}#WRAPPER>#MENU-SIDE>span[data-link]:hover:hover:after,#WRAPPER>#MENU-SIDE>span[data-link].active:hover:after{transform:scaleX(1);color:#fff}#WRAPPER>#MENU-SIDE>span[data-link]:hover svg #stylisable,#WRAPPER>#MENU-SIDE>span[data-link].active svg #stylisable{fill:#000 !important}#WRAPPER>#MENU-SIDE>span[data-link]:hover svg #stroke-stylisable,#WRAPPER>#MENU-SIDE>span[data-link].active svg #stroke-stylisable{stroke:#000 !important} +#WRAPPER>#MENU-SIDE>span[data-link]{display:block;position:relative;width:calc( 4em - 2*.7em - 2*.55em - 2*.01em );height:calc( 4em - 2*.7em - 2*.55em - 2*.01em );margin:2em .7em;padding:.55em;border:.01em solid transparent;border-radius:2px;color:#a2a2a2;line-height:calc( 4em - 2*.7em - 2*.55em - 2*.01em );transition:color .3s, border .3s;cursor:pointer}#WRAPPER>#MENU-SIDE>span[data-link].mt{margin-top:3em}#WRAPPER>#MENU-SIDE>span[data-link].mb{margin-bottom:3em}#WRAPPER>#MENU-SIDE>span[data-link] svg,#WRAPPER>#MENU-SIDE>span[data-link] svg *{width:calc( 4em / 2.5 );height:calc( 4em / 2.5 );transition:fill .3s;pointer-events:none}#WRAPPER>#MENU-SIDE>span[data-link][data-desc]:after{content:attr(data-desc);display:block;position:absolute;top:calc( 4em / 4 - 2*.3em );left:calc( 4em * 1.15 - 2*.3em );padding:.3em;border-radius:3px;background-color:#2a2a2a;color:#e2e2e2;white-space:nowrap;transition:transform .1s;transform-origin:0 0;transform:scaleX(0)}#WRAPPER>#MENU-SIDE>span[data-link]:hover,#WRAPPER>#MENU-SIDE>span[data-link].active{color:#e63321;border-color:#e6e6e6;box-shadow:inset 0 0 .5em #eee}#WRAPPER>#MENU-SIDE>span[data-link]:hover:hover:after,#WRAPPER>#MENU-SIDE>span[data-link].active:hover:after{transform:scaleX(1);color:#fff}#WRAPPER>#MENU-SIDE>span[data-link]:hover svg #stylisable,#WRAPPER>#MENU-SIDE>span[data-link].active svg #stylisable{fill:#000 !important}#WRAPPER>#MENU-SIDE>span[data-link]:hover svg #stroke-stylisable,#WRAPPER>#MENU-SIDE>span[data-link].active svg #stroke-stylisable{stroke:#000 !important} /*# sourceMappingURL=menu-side.css.map */ diff --git a/css/menu-side.scss b/css/menu-side.scss index 9268aff..98026cb 100755 --- a/css/menu-side.scss +++ b/css/menu-side.scss @@ -48,8 +48,8 @@ content: attr(data-desc); display: block; position: absolute; - top: calc( .7em - 2*.3em ); - left: calc( 4.6em - 2*.3em ); + top: calc( #{$menu-side-width} / 4 - 2*.3em ); + left: calc( #{$menu-side-width} * 1.15 - 2*.3em ); padding: .3em; border-radius: 3px; diff --git a/index.php b/index.php index 4572487..0f0ba8b 100755 --- a/index.php +++ b/index.php @@ -23,22 +23,19 @@ // Racine -> page d'accueil $R->get('/?', function(){ header('Location: /dashboard/'); }); + // Liste des pages du site + $page_list = array( + 'dashboard', + 'profile', + 'machines', + 'users', + 'groups', + 'analytics', + 'settings' + ); + // nomPage/arg1/arg2 -> inclusion de la page - $R->get('dashboard(?:/[\w-]+)*/?', function(){ include __ROOT__.'/view.php'; }); - $R->get('profile(?:/[\w-]+)*/?', function(){ include __ROOT__.'/view.php'; }); - $R->get('machines(?:/[\w-]+)*/?', function(){ include __ROOT__.'/view.php'; }); - $R->get('users(?:/[\w-]+)*/?', function(){ include __ROOT__.'/view.php'; }); - $R->get('analytics(?:/[\w-]+)*/?', function(){ include __ROOT__.'/view.php'; }); - $R->get('settings(?:/[\w-]+)*/?', function(){ include __ROOT__.'/view.php'; }); - - // nomPage -> nomPage/ - - - // $R->get('dashboard/', function(){ include __ROOT__.'/view.php'; }); - // $R->get('machines/', function(){ include __ROOT__.'/view.php'; }); - // $R->get('users/', function(){ include __ROOT__.'/view.php'; }); - // $R->get('analytics/', function(){ include __ROOT__.'/view.php'; }); - // $R->get('settings/', function(){ include __ROOT__.'/view.php'; }); + $R->get('(?:'.implode('|', $page_list).')(?:/[\w-]+)*/?', function(){ include __ROOT__.'/view.php'; }); // Dispatcher $R->get('f(?:/([\w-]+))*/?', function(){ new ResourceDispatcher($_GET['url'], true); }); diff --git a/js/action-script.js b/js/action-script.js index eec9865..148c506 100755 --- a/js/action-script.js +++ b/js/action-script.js @@ -9,7 +9,7 @@ DOM = { /* [0] Instanciation ===========================================*/ var pageManager = new pageManagerClass(); -pageManager.setPage(null, '/view', DOM.CONTAINER, ['profile', 'dashboard', 'machines', 'users', 'analytics', 'settings'] ); +pageManager.setPage(null, '/view', DOM.CONTAINER, ['profile', 'dashboard', 'machines', 'users', 'groups', 'analytics', 'settings'] ); var api = new APIClass('/api/'); diff --git a/src/static/menu-side/groups.svg b/src/static/menu-side/groups.svg new file mode 100644 index 0000000..6d47c75 --- /dev/null +++ b/src/static/menu-side/groups.svg @@ -0,0 +1,65 @@ + +image/svg+xml \ No newline at end of file diff --git a/todo.md b/todo.md index 6affeb7..8768d74 100755 --- a/todo.md +++ b/todo.md @@ -7,6 +7,10 @@ ############ # EN COURS # ############ +- [ ] [view/clusters] Interface de gestion des groupes + - [x] [src/static/menu-side][view] Ajout de l'icone des groupes + - [x] [action-script] Ajout de la page a page-manager + - [x] [view/groups] Ajout de la page physique - [ ] [view/users] Gestion des filtres - [ ] [view/machines] Gestion des filtres @@ -17,6 +21,7 @@ ######## # FAIT # ######## +- [x] [index] Gestion avec tableau des redirections - [x] [menu-side.scss] Icone + svg pour icone du profile - [x] [container.scss] Alignement sur les listes des icones de modif+suppr - [x] [view/js/*] animation pour les recherches (modif/suppr) diff --git a/view.php b/view.php index e6b331c..9033fe2 100755 --- a/view.php +++ b/view.php @@ -49,6 +49,7 @@ + diff --git a/view/groups.php b/view/groups.php new file mode 100755 index 0000000..87710f4 --- /dev/null +++ b/view/groups.php @@ -0,0 +1,249 @@ + + + + + + + + + +$v) + array_push($post, $k); + + $sublink = $post[0]; + + + + /* [1] VIEW -> Liste des utilisateurs + =========================================================*/ + $request = new ModuleRequest('userDefault/getAll'); // On utilise la methode 'getAll' du module 'userDefault' + $answer = $request->dispatch(); // On recupere la reponse + + echo "
"; + // echo 'Liste des utilisateurs:
'; + + // si erreur, on affiche l'explicitation + if( $answer->error != ManagerError::Success ){ + // var_dump( ManagerError::explicit($answer->error) ); + + echo "Une erreur est survenue, veuilez contacter le webmaster si cette erreur persiste."; + } + + // Si aucune erreur, on affiche les resultats + else{ + + // Barre de recherche + echo ""; + + // Liste des utilisateurs + foreach( $answer->get('users') as $user){ + $clusters = new Repo('user/getClusters', array($user['id_user'])); + $clusters = $clusters->answer(); + + echo "
"; + + // Prenom Nom + echo "".$user['firstname']." ".$user['lastname']." #".$user['username'].""; + + + + // Icone vers la suppression + echo ""; + echo ResourceDispatcher::getResource('f/svg/remove/st/sub-menu-side'); + echo ""; + + // Icone vers la modification + echo ""; + echo ResourceDispatcher::getResource('f/svg/edit/st/sub-menu-side'); + echo ""; + + + + // Code RFID + echo ""; + echo ResourceDispatcher::getResource('f/svg/card/st/container'); + + echo ""; + echo $user['code']; + echo ""; + echo""; + + // Adresse email + echo ""; + echo ResourceDispatcher::getResource('f/svg/mail/st/container'); + + echo ""; + echo $user['mail']; + echo ""; + echo""; + + // Groupes de la machine + echo ""; + echo ResourceDispatcher::getResource('f/svg/group/st/container'); + + if( $clusters != false ) + foreach($clusters as $cluster) + echo "".$cluster['name'].""; + echo""; + + + echo "
"; + } + + } + + echo '
'; + + + + + + + + + + + + + /* [2] Creation d'utilisateur + =========================================================*/ + echo "
"; + + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo ""; + echo "
"; + + echo '
'; + + + + + + + + + + + + + /* [3] Suppression d'utilisateur + =========================================================*/ + echo "
"; + + echo "
"; + // Recherche d'utilisateur + echo "
"; + echo ""; + // Indice du resultat + echo "utilisateur 0 sur 0

"; + echo "
"; + + + echo "




"; + + // Suppression d'utilisateur + echo "
"; + echo "
"; + echo ""; + echo "
"; + + echo '
'; + + + + + + + + + + + + + /* [4] Modification d'utilisateur + =========================================================*/ + echo "
"; + + echo "
"; + echo "
"; + echo ""; + // Indice du resultat + echo "utilisateur 0 sur 0

"; + echo "
"; + + echo "




"; + + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo "
"; + echo ""; + echo "
"; + + echo '
'; + + + + + + + + + + + + + /* [4] Gestion de filtrage + =========================================================*/ + echo "
"; + + echo "
"; + + echo "
"; + + echo '
'; \ No newline at end of file