callage des élément dans la page de ressources

This commit is contained in:
armansansd 2021-06-28 19:53:18 +02:00
parent 2dceaa7394
commit 91cb62aaf9
4 changed files with 150 additions and 76 deletions

View File

@ -1344,10 +1344,18 @@ footer {
text-align: center; } text-align: center; }
.path-centre-de-ressources form { .path-centre-de-ressources form {
display: grid; display: grid;
grid-template-columns: 10% repeat(4, 20%); } column-gap: 1rem;
grid-template-columns: calc(10% - 3em) repeat(4, 20%); }
.path-centre-de-ressources form > div:first-child { .path-centre-de-ressources form > div:first-child {
grid-column-start: 2; } grid-column-start: 2; }
.path-centre-de-ressources form select { .path-centre-de-ressources form .form-item-combine {
grid-row: 1 / span 1;
grid-column-start: 2; }
.path-centre-de-ressources form .form-item-programme {
grid-column-start: 2; }
.path-centre-de-ressources form .form-item-items-per-page {
grid-column-start: 2; }
.path-centre-de-ressources form select, .path-centre-de-ressources form input {
display: inline-block; display: inline-block;
width: auto; width: auto;
width: 100%; width: 100%;
@ -1356,41 +1364,72 @@ footer {
height: auto; } height: auto; }
.path-centre-de-ressources form div { .path-centre-de-ressources form div {
display: inline-block; display: inline-block;
width: auto; width: auto; }
padding: .5rem 1rem; } .path-centre-de-ressources form .form-actions {
.path-centre-de-ressources .views-view-grid .views-row { grid-column: 4 / span 2;
display: grid; display: grid;
grid-template-columns: 10% 20% 20% 20% 20% 10%; } grid-template-columns: 1fr 1fr;
.path-centre-de-ressources .views-view-grid .views-row .views-col:first-child { align-items: center;
grid-column-start: 2; } column-gap: 1rem; }
.path-centre-de-ressources .views-view-grid .views-col { .path-centre-de-ressources form .form-actions input {
background-color: white; background-color: white;
background-clip: content-box; border: solid 1px black;
width: 100% !important; box-shadow: none; }
padding: .3rem; } .path-centre-de-ressources .views-view-grid {
.path-centre-de-ressources .views-view-grid .views-col a { margin-top: 3rem; }
text-decoration: none; } .path-centre-de-ressources .views-view-grid .views-row {
.path-centre-de-ressources .views-view-grid .views-col .views-field:not(:first-child) { display: grid;
padding: 0 0 0 .4rem; } column-gap: 1rem;
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-programme { row-gap: 1rem;
font-weight: 600; grid-template-columns: calc(10% - 3em) repeat(4, 20%); }
display: inline-block; .path-centre-de-ressources .views-view-grid .views-row .views-col:first-child {
width: auto; grid-column-start: 2; }
color: white; .path-centre-de-ressources .views-view-grid .views-col {
background: red; display: grid;
padding: .15rem .3rem; grid-template-columns: 20% 80%;
margin-bottom: 1rem; } align-items: stretch;
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-type-de-ressource { background-color: white;
text-transform: uppercase; background-clip: content-box;
font-size: 600; width: 100% !important;
margin-bottom: .5rem; padding: .3rem; }
font-size: 0.45rem; } .path-centre-de-ressources .views-view-grid .views-col a {
.path-centre-de-ressources .views-view-grid .views-col .views-field-title { text-decoration: none; }
font-style: italic; } .path-centre-de-ressources .views-view-grid .views-col a:hover {
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-sous-titre { text-decoration: underline; }
margin-bottom: 1rem; } .path-centre-de-ressources .views-view-grid .views-col .views-field:not(:first-child) {
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-theme { padding: 0 0 0 .4rem; }
font-size: 0.45rem; } .path-centre-de-ressources .views-view-grid .views-col .views-field-field-image {
grid-row: 2 / span 2; }
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-programme {
grid-row: 1 / span 1;
grid-column: 1 / span 2; }
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-programme .field-content {
font-weight: 600;
display: inline-block;
width: auto;
color: white;
background: red;
padding: .15rem .3rem;
margin-bottom: 1rem; }
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-type-de-ressource {
text-transform: uppercase;
font-size: 600;
margin-bottom: .5rem;
font-size: 0.45rem;
grid-row: 2 / span 1;
grid-column: 2 / span 1; }
.path-centre-de-ressources .views-view-grid .views-col .views-field-title {
font-style: italic;
grid-row: 3 / span 1;
grid-column: 2 / span 1; }
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-sous-titre {
margin-bottom: 1rem;
grid-row: 4 / span 1;
grid-column: 2 / span 1; }
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-theme {
grid-row: 5 / span 1;
grid-column: 1 / span 2;
font-size: 0.45rem; }
article h2 { article h2 {
font-family: "trueno"; font-family: "trueno";

File diff suppressed because one or more lines are too long

View File

@ -25,20 +25,9 @@ function popsu_preprocess_views_view_unformatted(&$variables) {
$variables['rows'][$id]['attributes'] = new Attribute(); $variables['rows'][$id]['attributes'] = new Attribute();
$c = $variables['rows'][$id]['content']["#row"]->nid; $c = $variables['rows'][$id]['content']["#row"]->nid;
$variables['rows'][$id]['attributes']->addClass("popsu-node-".$c); $variables['rows'][$id]['attributes']->addClass("popsu-node-".$c);
//kint($variables['rows'][$id]['content']["#row"]->nid);
} }
} }
// else{
// if ($view->current_display == "block_1") {
// $rows = $variables['rows'];
// foreach ($rows as $id => $row) {
// $variables['rows'][$id]['attributes'] = new Attribute();
// $c = $variables['rows'][$id]['content']["#row"]->nid;
// $variables['rows'][$id]['attributes']->addClass("popsu-node-".$c);
// }
// }
}
}; };
/* implements template_preprocess_region() */ /* implements template_preprocess_region() */
@ -48,23 +37,9 @@ function popsu_preprocess_region(&$variables) {
if (isset($variables['region'])) { if (isset($variables['region'])) {
$variables['attributes']['class'][] = $variables['region'].'_container'; $variables['attributes']['class'][] = $variables['region'].'_container';
} }
// if ($variables['region'] == 'footer_bottom_right') {
// if ($node = \Drupal::routeMatch()->getParameter('node')) {
// $t = $node->getType();
// }
// }
} }
// function popsu_preprocess_field(&$variables){
// $v = $variables;
// }
// function popsu_theme_suggestions_views_view_alter(array &$suggestions, array $variables) {
// $v = $variables;
// $suggestions[] = 'views_view__headerView';
// }
/** /**
* Implements hook_preprocess_block(). * Implements hook_preprocess_block().
@ -75,7 +50,7 @@ function popsu_preprocess_views_view_fields(&$variables){
$entity = $variables['row']->_entity; $entity = $variables['row']->_entity;
if($entity->hasField('field_programme')){ if($entity->hasField('field_programme')){
$target_id = $entity->get('field_programme')->getString(); $target_id = $entity->get('field_programme')->getString();
// kint($variables);die(); //kint($variables['row']);die();
// $variables['row']['attributes'] = new Attribute(); // $variables['row']['attributes'] = new Attribute();
// $variables['row']['attributes']->addClass("pouet-node-".$target_id); // $variables['row']['attributes']->addClass("pouet-node-".$target_id);
} }

View File

@ -8,11 +8,23 @@
form{ form{
display: grid; display: grid;
grid-template-columns: 10% repeat(4, 20%); column-gap: 1rem;
grid-template-columns: calc(10% - 3em) repeat(4, 20%);
&>div:first-child{ &>div:first-child{
grid-column-start: 2; grid-column-start: 2;
} }
select{ .form-item-combine{
grid-row: 1 / span 1 ;
grid-column-start: 2;
}
.form-item-programme{
grid-column-start: 2;
}
.form-item-items-per-page{
grid-column-start: 2;
}
select, input{
display: inline-block; display: inline-block;
width: auto; width: auto;
width: 100%; width: 100%;
@ -23,20 +35,48 @@
div{ div{
display: inline-block; display: inline-block;
width: auto; width: auto;
padding: .5rem 1rem; // padding: .5rem 1rem;
}
.form-actions{
grid-column: 4 / span 2;
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
column-gap: 1rem;
input{
background-color: white;
border: solid 1px black;
box-shadow: none;
&:first-child{
// margin-right: .5rem;
}
&:last-child{
// margin-left: .5rem;
}
}
} }
} }
.views-view-grid{ .views-view-grid{
margin-top: 3rem;
.views-row{ .views-row{
display: grid; display: grid;
grid-template-columns: 10% 20% 20% 20% 20% 10%; column-gap: 1rem;
row-gap: 1rem;
grid-template-columns: calc(10% - 3em) repeat(4, 20%);
.views-col:first-child{ .views-col:first-child{
grid-column-start: 2; grid-column-start: 2;
} }
} }
.views-col{ .views-col{
display: grid;
grid-template-columns: 20% 80%;
align-items: stretch;
a{ a{
text-decoration: none; text-decoration: none;
&:hover{
text-decoration: underline;
}
} }
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
background-clip: content-box; background-clip: content-box;
@ -45,34 +85,54 @@
.views-field:not(:first-child){ .views-field:not(:first-child){
padding: 0 0 0 .4rem; padding: 0 0 0 .4rem;
} }
.views-field-field-image{
grid-row: 2 / span 2;
}
.views-field-field-programme{ .views-field-field-programme{
font-weight: 600; grid-row: 1 / span 1;
display: inline-block; grid-column: 1 / span 2;
width: auto; .field-content{
color: white; font-weight: 600;
background: red; display: inline-block;
padding: .15rem .3rem; width: auto;
margin-bottom: 1rem; color: white;
background: red;
padding: .15rem .3rem;
margin-bottom: 1rem;
}
} }
.views-field-field-type-de-ressource{ .views-field-field-type-de-ressource{
text-transform: uppercase; text-transform: uppercase;
font-size: 600; font-size: 600;
margin-bottom: .5rem; margin-bottom: .5rem;
font-size: $font-small; font-size: $font-small;
grid-row: 2 / span 1;
grid-column: 2 / span 1;
} }
.views-field-title{ .views-field-title{
font-style: italic; font-style: italic;
grid-row: 3 / span 1;
grid-column: 2 / span 1;
} }
.views-field-field-sous-titre{ .views-field-field-sous-titre{
margin-bottom: 1rem; margin-bottom: 1rem;
grid-row: 4 / span 1;
grid-column: 2 / span 1;
} }
.views-field-field-theme{ .views-field-field-theme{
grid-row: 5 / span 1;
grid-column: 1 / span 2;
font-size: $font-small; font-size: $font-small;
} }
} }
} }
} }