Interface/Conception 'history/view' CSS à revoir et améliorer pour que tout soit aligné correctement

This commit is contained in:
xdrm-brackets 2016-07-21 16:25:29 +02:00
parent 5eb766e030
commit daa1750665
4 changed files with 598 additions and 424 deletions

View File

@ -9,13 +9,9 @@
flex-grow: 1; flex-grow: 1;
} }
// @active
& > section.active{
display: block;
}
// @active + .list // @active + .list
& > section.active.list{ & > section.active{
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: flex-start; align-items: flex-start;
@ -26,6 +22,10 @@
flex: 0 0 1; flex: 0 0 1;
} }
.inline-row{
flex: 3em 0 1;
}
// Barre de recherche // Barre de recherche
.searchbar{ .searchbar{
display: inline-block; display: inline-block;
@ -75,7 +75,8 @@
/* [2] INLINE-BOX pour afficher les listes de donnees /* [2] INLINE-BOX pour afficher les listes de donnees
=========================================================*/ =========================================================*/
& > section > .inline-box{ & > section > .inline-box,
& > section > .inline-row{
display: inline-block; display: inline-block;
position: relative; position: relative;
// width: calc( 50% - 2*1em - 2*1em ); // width: calc( 50% - 2*1em - 2*1em );
@ -287,9 +288,70 @@
} }
/* [2-2] INLINE-ROW pour afficher des lignes
=========================================================*/
& > section.fstart{
flex-direction: column;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.searchbar{
flex: 1em 0 0;
width: calc( 100% - 3em - 2*2em );
}
}
& > section > .inline-row{
width: calc( 100% - 4em - 2*1em );
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
overflow: hidden;
// Sur la même ligne répartis équitablement
& > span,
& > span.row{
display: flex;
flex-direction: column;
justify-content: space-around;
flex: 100% 1 1;
border-left: 1px solid #ddd;
text-align: center;
&:first-child{
border-left: 0;
}
}
& > span.column{
flex-direction: row;
padding: 0 .5em;
}
button{
flex: auto;
width: 5em;
}
}
/* [3] Formulaires /* [3] Formulaires
=========================================================*/ =========================================================*/
& > section > form{ & > section > form, .form{
display: inline-block; display: inline-block;
position: relative; position: relative;
left: 50%; left: 50%;
@ -332,6 +394,8 @@
} }
} }
}
/* (1) Champs de texte */ /* (1) Champs de texte */
input[type=text], input[type=text],
@ -376,10 +440,10 @@
// Champs valides // Champs valides
&.valid > input[type=text], .valid > input[type=text],
&.valid > input[type=mail], .valid > input[type=mail],
&.valid > input[type=password], .valid > input[type=password],
&.valid > select, .valid > select,
input.valid[type=text], input.valid[type=text],
input.valid[type=mail], input.valid[type=mail],
input.valid[type=password], input.valid[type=password],
@ -391,10 +455,10 @@
} }
// Champs neutres // Champs neutres
&.neutral > input[type=text], .neutral > input[type=text],
&.neutral > input[type=mail], .neutral > input[type=mail],
&.neutral > input[type=password], .neutral > input[type=password],
&.neutral > select, .neutral > select,
input.neutral[type=text], input.neutral[type=text],
input.neutral[type=mail], input.neutral[type=mail],
input.neutral[type=password], input.neutral[type=password],
@ -406,10 +470,10 @@
} }
// Champs neutres // Champs neutres
&.search > input[type=text], .search > input[type=text],
&.search > input[type=mail], .search > input[type=mail],
&.search > input[type=password], .search > input[type=password],
&.search > select, .search > select,
input.search[type=text], input.search[type=text],
input.search[type=mail], input.search[type=mail],
input.search[type=password]{ input.search[type=password]{
@ -424,7 +488,7 @@
/* (2) Boutons */ /* (2) Boutons */
button, button,
button.invalid, button.invalid,
&.invalid > button{ .invalid > button{
display: inline-block; display: inline-block;
position: relative; position: relative;
left: 50%; left: 50%;
@ -453,7 +517,7 @@
// Boutons valides // Boutons valides
button.valid, button.valid,
&.valid > button{ .valid > button{
border-color: $form-valid-color; border-color: $form-valid-color;
background-color: $form-valid-color; background-color: $form-valid-color;
@ -468,7 +532,7 @@
// Boutons neutres // Boutons neutres
button.neutral, button.neutral,
&.neutral > button{ .neutral > button{
border-color: $form-neutral-color; border-color: $form-neutral-color;
background-color: $form-neutral-color; background-color: $form-neutral-color;
@ -483,7 +547,7 @@
// Boutons recherche // Boutons recherche
button.search, button.search,
&.search > button{ .search > button{
border-color: $form-search-color; border-color: $form-search-color;
background-color: $form-search-color; background-color: $form-search-color;
@ -498,7 +562,7 @@
// Boutons quand action validee // Boutons quand action validee
&.invalid > button.active, .invalid > button.active,
button.invalid.active, button.invalid.active,
button.active{ button.active{
background-color: #fff; background-color: #fff;
@ -510,15 +574,15 @@
button.valid.active, button.valid.active,
&.valid > button.active{ .valid > button.active{
background-image: url('/src/static/container/active@#{$rd-form-valid-color}.svg') !important; background-image: url('/src/static/container/active@#{$rd-form-valid-color}.svg') !important;
} }
button.neutral.active, button.neutral.active,
&.neutral > button.active{ .neutral > button.active{
background-image: url('/src/static/container/active@#{$rd-form-neutral-color}.svg') !important; background-image: url('/src/static/container/active@#{$rd-form-neutral-color}.svg') !important;
} }
button.search.active, button.search.active,
&.search > button.active{ .search > button.active{
background-image: url('/src/static/container/active@#{$rd-form-search-color}.svg') !important; background-image: url('/src/static/container/active@#{$rd-form-search-color}.svg') !important;
} }
@ -580,7 +644,7 @@
} }
} }
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -47,7 +47,7 @@
$getmachines = new ModuleRequest('machineDefault/getAll'); // On utilise la methode 'getAll' du module 'machineDefault' $getmachines = new ModuleRequest('machineDefault/getAll'); // On utilise la methode 'getAll' du module 'machineDefault'
$nbmachines = count( $getmachines->dispatch()->get('machines') ); // On recupere la reponse $nbmachines = count( $getmachines->dispatch()->get('machines') ); // On recupere la reponse
echo "<section data-sublink='view' class='list'>"; echo "<section data-sublink='view' class='list fstart'>";
// Barre de recherche // Barre de recherche
echo "<input type='text' class='searchbar' placeholder='Recherche'>"; echo "<input type='text' class='searchbar' placeholder='Recherche'>";
@ -55,15 +55,42 @@
/* (1) On récupère les données /* (1) On récupère les données
---------------------------------------------------------*/ ---------------------------------------------------------*/
$selReq = Database::getPDO()->query("select count(distinct id_user) as users, max(timestamp) as last from history group by id_machine"); $selReq = Database::getPDO()->query("select m.*, count(distinct h.id_user) as users, max(h.timestamp) as last
from history as h, machine as m
where h.id_machine = m.id_machine
group by h.id_machine");
$selected = Database::delNumeric( $selReq->fetchAll() ); $selected = Database::delNumeric( $selReq->fetchAll() );
echo "<article class='inline-row'>";
echo "<span>Machine</span>";
echo "<span>Dernière utilisation</span>";
echo "<span>Conducteurs</span>";
echo "<span>Historique détaillé</span>";
echo "</article>";
foreach($selected as $m=>$mac){ foreach($selected as $m=>$mac){
echo "<article class='inline-box'>" echo "<article class='inline-row'>";
echo "<span class='title'><span>#".$mac['name']."</span></span>";
echo "<span class='row'>";
echo "<span>".date('d/m/Y H:i:s', $mac['last'])."</span>";
echo "<span style='color:#aaa;'>Il y a xx jours et yy heures</span>";
echo "</span>";
echo "<span class='column'>";
echo "<span>".$mac['users']." conducteur(s)</span>";
echo "<span>".$mac['users']."</span>";
echo "</span>";
echo "<span>";
echo "<button class='search'>Détails</button>";
echo "</span>";
echo "</article>";
} }