- [x] [container.scss] Gestion de l'affichage responsive
- [x] [container.scss] Gestion de l'affichage retour a la ligne - [x] [container.scss] Gestion de l'affichage info ne depassent plus - [x] [view/js/users] Recherche instantanee
This commit is contained in:
parent
4dd0954d71
commit
ee4444e42e
File diff suppressed because one or more lines are too long
|
@ -18,7 +18,8 @@
|
||||||
& > section.active.list{
|
& > section.active.list{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-around;
|
align-items: flex-start;
|
||||||
|
justify-content: flex-start;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.inline-box{
|
.inline-box{
|
||||||
|
@ -29,7 +30,9 @@
|
||||||
.searchbar{
|
.searchbar{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: calc( 100% - 2*1em - 2*1em );
|
// width: calc( 100% - 2*1em - 2*1em );
|
||||||
|
flex: calc( 100% - 2*1em - 2*1em );
|
||||||
|
height: 1em;
|
||||||
margin: 1em;
|
margin: 1em;
|
||||||
padding: .5em 1em;
|
padding: .5em 1em;
|
||||||
padding-left: 2em;
|
padding-left: 2em;
|
||||||
|
@ -75,7 +78,8 @@
|
||||||
& > section > .inline-box{
|
& > section > .inline-box{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: calc( 50% - 2*1em - 2*1em );
|
// width: calc( 50% - 2*1em - 2*1em );
|
||||||
|
flex: calc( 50% - 2*1em - 2*1em );
|
||||||
margin: 1em;
|
margin: 1em;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
|
|
||||||
|
@ -84,6 +88,11 @@
|
||||||
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
|
// Lors de la recherche, quand on veut en masquer
|
||||||
|
&.hidden{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
a{
|
a{
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
@ -97,6 +106,7 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
color: darken($theme-color, 10);
|
color: darken($theme-color, 10);
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
& > span{
|
& > span{
|
||||||
font-size: .8em;
|
font-size: .8em;
|
||||||
|
@ -111,6 +121,7 @@
|
||||||
display: block;
|
display: block;
|
||||||
margin: 1em;
|
margin: 1em;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
// svg (icone)
|
// svg (icone)
|
||||||
svg{
|
svg{
|
||||||
|
@ -140,6 +151,7 @@
|
||||||
display: block;
|
display: block;
|
||||||
margin: 1em;
|
margin: 1em;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
// svg (icone)
|
// svg (icone)
|
||||||
svg{
|
svg{
|
||||||
|
|
7
todo.md
7
todo.md
|
@ -7,16 +7,17 @@
|
||||||
############
|
############
|
||||||
# EN COURS #
|
# EN COURS #
|
||||||
############
|
############
|
||||||
|
|
||||||
|
|
||||||
- [ ] [view/js/machines] Recherche instantanee
|
- [ ] [view/js/machines] Recherche instantanee
|
||||||
- [ ] [view/js/users] Recherche instantanee
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
########
|
########
|
||||||
# FAIT #
|
# FAIT #
|
||||||
########
|
########
|
||||||
|
- [x] [container.scss] Gestion de l'affichage responsive
|
||||||
|
- [x] [container.scss] Gestion de l'affichage retour a la ligne
|
||||||
|
- [x] [container.scss] Gestion de l'affichage info ne depassent plus
|
||||||
|
- [x] [view/js/users] Recherche instantanee
|
||||||
- [x] [machineDefaut][machineRepo] Gestion des parametres optionnels pour la modification
|
- [x] [machineDefaut][machineRepo] Gestion des parametres optionnels pour la modification
|
||||||
- [x] [userDefault][userRepo] Gestion des parametres optionnels pour la modification
|
- [x] [userDefault][userRepo] Gestion des parametres optionnels pour la modification
|
||||||
- [x] [machines.js][machineDefault][machineRepo] Gestion de la nouvelle modification (avec recherche)
|
- [x] [machines.js][machineDefault][machineRepo] Gestion de la nouvelle modification (avec recherche)
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
var section = {
|
var section = {
|
||||||
view: {
|
view: {
|
||||||
text: '#CONTAINER > section[data-sublink="view"] ',
|
text: '#CONTAINER > section[data-sublink="view"] ',
|
||||||
element: document.querySelector('#CONTAINER > section[data-sublink="view"]')
|
element: document.querySelector('#CONTAINER > section[data-sublink="view"]'),
|
||||||
|
searchbar: document.querySelector('#CONTAINER > section[data-sublink="view"] > .searchbar')
|
||||||
},
|
},
|
||||||
|
|
||||||
create: {
|
create: {
|
||||||
|
@ -29,16 +30,51 @@ var section = {
|
||||||
|
|
||||||
/* [1] view -> AFFICHAGE DES UTILISATEURS
|
/* [1] view -> AFFICHAGE DES UTILISATEURS
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
|
|
||||||
if( section.view.element != null ){
|
if( section.view.element != null ){
|
||||||
|
|
||||||
// On recupere tous les liens
|
/* (1) On recupere tous les liens */
|
||||||
section.view.link = {
|
section.view.link = {
|
||||||
edit: document.querySelectorAll(section.view.text + '.link_edit[data-user]'),
|
edit: document.querySelectorAll(section.view.text + '.link_edit[data-user]'),
|
||||||
remove: document.querySelectorAll(section.view.text + '.link_remove[data-user]')
|
remove: document.querySelectorAll(section.view.text + '.link_remove[data-user]')
|
||||||
};
|
};
|
||||||
|
|
||||||
// On gere la "redirection" vers la modification
|
|
||||||
|
/* (2) Gestion de la recherche instantannee */
|
||||||
|
section.view.searchbar.addEventListener('keyup', function(e){
|
||||||
|
|
||||||
|
var search = {
|
||||||
|
path: 'userDefault/search',
|
||||||
|
data: [section.view.searchbar.value]
|
||||||
|
};
|
||||||
|
|
||||||
|
// On envoie la requete
|
||||||
|
api.send(search, function(result){
|
||||||
|
if( result.ModuleError == 0 && result.users.length > 0 ){ // si on a trouve qqch
|
||||||
|
|
||||||
|
// On enregistre tous les UID dans un tableau
|
||||||
|
var uid_list = [];
|
||||||
|
for( var i = 0 ; i < result.users.length ; i++ )
|
||||||
|
uid_list.push( result.users[i].id_user);
|
||||||
|
|
||||||
|
// On recupere la liste des elements correspondants aux utilisateurs
|
||||||
|
var user_list = document.querySelectorAll(section.view.text + '> article.inline-box[id]');
|
||||||
|
|
||||||
|
for( var i = 0 ; i < user_list.length ; i++ ){
|
||||||
|
console.log( user_list[i] instanceof Element );
|
||||||
|
// Si doit etre visible
|
||||||
|
if( uid_list.indexOf(user_list[i].id) > -1 )
|
||||||
|
user_list[i].remClass('hidden');
|
||||||
|
// Si ne doit pas etre visible
|
||||||
|
else
|
||||||
|
user_list[i].addClass('hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
|
/* (3) On gere la "redirection" vers la modification */
|
||||||
for( var i = 0 ; i < section.view.link.edit.length ; i++ ){
|
for( var i = 0 ; i < section.view.link.edit.length ; i++ ){
|
||||||
|
|
||||||
section.view.link.edit[i].addEventListener('click', function(e){
|
section.view.link.edit[i].addEventListener('click', function(e){
|
||||||
|
@ -49,7 +85,7 @@ if( section.view.element != null ){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// On gere la "redirection" vers la suppression
|
/* (4) On gere la "redirection" vers la suppression */
|
||||||
for( var i = 0 ; i < section.view.link.remove.length ; i++ ){
|
for( var i = 0 ; i < section.view.link.remove.length ; i++ ){
|
||||||
|
|
||||||
section.view.link.remove[i].addEventListener('click', function(e){
|
section.view.link.remove[i].addEventListener('click', function(e){
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
$clusters = new Repo('user/getClusters', array($user['id_user']));
|
$clusters = new Repo('user/getClusters', array($user['id_user']));
|
||||||
$clusters = $clusters->answer();
|
$clusters = $clusters->answer();
|
||||||
|
|
||||||
echo "<article class='inline-box'>";
|
echo "<article class='inline-box' id='".$user['id_user']."'>";
|
||||||
|
|
||||||
// Prenom Nom
|
// Prenom Nom
|
||||||
echo "<span class='title'>".$user['firstname']." ".$user['lastname']." <span>#".$user['username']."</span></span>";
|
echo "<span class='title'>".$user['firstname']." ".$user['lastname']." <span>#".$user['username']."</span></span>";
|
||||||
|
|
Loading…
Reference in New Issue