Merge branch 'master' of gogs-figureslibres.io:bachir/popsu-d9

This commit is contained in:
Bachir Soussi Chiadmi 2021-06-28 21:33:08 +02:00
commit 48454bd99e
4 changed files with 180 additions and 87 deletions

View File

@ -1339,40 +1339,75 @@ footer {
text-align: center; }
.path-centre-de-ressources {
background-color: #f2f6fc; }
background-color: #f8f8fb; }
.path-centre-de-ressources .content_container > div > h2:first-child {
text-align: center; }
text-align: center;
background-color: #98d0d9;
padding: 1rem 0; }
.path-centre-de-ressources form {
background-color: #98d0d9;
display: grid;
grid-template-columns: 10% repeat(4, 20%); }
padding: 0 0 5rem 0;
column-gap: 1rem;
grid-template-columns: calc(10% - 3em) repeat(4, 20%); }
.path-centre-de-ressources form > div:first-child {
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;
width: auto;
width: 100%;
font-size: 0.6rem;
padding: .3rem .1rem;
padding: .3rem 1rem;
height: auto; }
.path-centre-de-ressources form div {
display: inline-block;
width: auto;
padding: .5rem 1rem; }
width: auto; }
.path-centre-de-ressources form .form-actions {
grid-column: 4 / span 2;
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
column-gap: 1rem; }
.path-centre-de-ressources form .form-actions input {
background-color: transparent;
border: solid 1px black;
box-shadow: none; }
.path-centre-de-ressources .views-view-grid {
margin-top: 3rem; }
.path-centre-de-ressources .views-view-grid .views-row {
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%); }
.path-centre-de-ressources .views-view-grid .views-row .views-col:first-child {
grid-column-start: 2; }
.path-centre-de-ressources .views-view-grid .views-col {
display: grid;
grid-template-columns: 20% 80%;
align-items: stretch;
background-color: white;
background-clip: content-box;
width: 100% !important;
padding: .3rem; }
.path-centre-de-ressources .views-view-grid .views-col a {
text-decoration: none; }
.path-centre-de-ressources .views-view-grid .views-col a:hover {
text-decoration: underline; }
.path-centre-de-ressources .views-view-grid .views-col .views-field:not(:first-child) {
padding: 0 0 0 .4rem; }
.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;
@ -1382,13 +1417,22 @@ footer {
margin-bottom: 1rem; }
.path-centre-de-ressources .views-view-grid .views-col .views-field-field-type-de-ressource {
text-transform: uppercase;
font-size: 500;
margin-bottom: .5rem; }
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; }
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; }
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 {

File diff suppressed because one or more lines are too long

View File

@ -20,17 +20,6 @@ function popsu_preprocess_views_view_unformatted(&$variables) {
$view = $variables['view'];
if($view->id() == "programmes"){
$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);
//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();
@ -39,7 +28,6 @@ function popsu_preprocess_views_view_unformatted(&$variables) {
}
}
}
};
/* implements template_preprocess_region() */
@ -49,30 +37,25 @@ function popsu_preprocess_region(&$variables) {
if (isset($variables['region'])) {
$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().
*/
// function popsu_preprocess_block(&$variables) {
// $t="t";
// }
function popsu_preprocess_views_view_fields(&$variables){
$entity = $variables['row']->_entity;
if($entity->hasField('field_programme')){
$target_id = $entity->get('field_programme')->getString();
//kint($variables['row']);die();
// $variables['row']['attributes'] = new Attribute();
// $variables['row']['attributes']->addClass("pouet-node-".$target_id);
}
}
function popsu_preprocess_views_view_field(&$variables){
// check if link to entoty option is true
@ -80,14 +63,16 @@ function popsu_preprocess_views_view_field(&$variables){
if ($settings && isset($settings['link_to_entity']) && $settings['link_to_entity']) {
// get the entity and build the classes
$entity = $variables['row']->_entity;
// $target_id = $entity;
// build new classes
$new_classes = array(
$entity->getEntityTypeId(),
$entity->getEntityTypeId().'-'.$entity->bundle(),
$entity->getEntityTypeId().'-'.$entity->bundle().'-'.$entity->id()
$entity->getEntityTypeId().'-'.$entity->bundle().'-'.$entity->id(),
);
// get the entity link and url
$link = $entity->toLink();
$url = $entity->toLink()->getUrl();

View File

@ -1,42 +1,85 @@
.path-centre-de-ressources{
background-color: rgb(242, 246, 252);
background-color: #f8f8fb;
.content_container{
&>div>h2:first-child{
text-align: center;
background-color: #98d0d9;
padding: 1rem 0;
}
}
form{
background-color: #98d0d9;
display: grid;
grid-template-columns: 10% repeat(4, 20%);
padding: 0 0 5rem 0;
column-gap: 1rem;
grid-template-columns: calc(10% - 3em) repeat(4, 20%);
&>div:first-child{
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;
width: auto;
width: 100%;
font-size: $font-normal;
padding: .3rem .1rem;
padding: .3rem 1rem;
height: auto;
}
div{
display: inline-block;
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: transparent;
border: solid 1px black;
box-shadow: none;
&:first-child{
// margin-right: .5rem;
}
&:last-child{
// margin-left: .5rem;
}
}
}
}
.views-view-grid{
margin-top: 3rem;
.views-row{
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{
grid-column-start: 2;
}
}
.views-col{
display: grid;
grid-template-columns: 20% 80%;
align-items: stretch;
a{
text-decoration: none;
&:hover{
text-decoration: underline;
}
}
background-color: rgb(255, 255, 255);
background-clip: content-box;
@ -45,7 +88,15 @@
.views-field:not(:first-child){
padding: 0 0 0 .4rem;
}
.views-field-field-image{
grid-row: 2 / span 2;
}
.views-field-field-programme{
grid-row: 1 / span 1;
grid-column: 1 / span 2;
.field-content{
font-weight: 600;
display: inline-block;
width: auto;
@ -54,24 +105,37 @@
padding: .15rem .3rem;
margin-bottom: 1rem;
}
}
.views-field-field-type-de-ressource{
text-transform: uppercase;
font-size: 500;
font-size: 600;
margin-bottom: .5rem;
font-size: $font-small;
grid-row: 2 / span 1;
grid-column: 2 / span 1;
}
.views-field-title{
font-style: italic;
grid-row: 3 / span 1;
grid-column: 2 / span 1;
}
.views-field-field-sous-titre{
margin-bottom: 1rem;
grid-row: 4 / span 1;
grid-column: 2 / span 1;
}
.views-field-field-theme{
grid-row: 5 / span 1;
grid-column: 1 / span 2;
font-size: $font-small;
}
}
}
}