display imporovement (fonts) + agenda nav + prod linked events nav

This commit is contained in:
2018-04-15 21:45:13 +02:00
parent 4967111a0e
commit c5ae3d6b00
15 changed files with 505 additions and 331 deletions
@@ -93,8 +93,9 @@ function edlp_ajax_theme($existing, $type, $theme, $path) {
'edlp_ajax' => array(
'file' => 'includes/edlp_ajax.inc',
'variables' => array(
'entity_type' => 'node',
'entity' => NULL,
'entity_type' => null,
'bundle' => null,
'entity' => null,
'view_mode' => 'default',
'aside' => array(),
),
@@ -110,6 +111,7 @@ function edlp_ajax_theme_suggestions_edlp_ajax(array $vars) {
$suggestions = [];
// $node = $variables['elements']['#node'];
$sanitized_view_mode = strtr($vars['view_mode'], '.', '_');
// $entity = $vars['entity'];
//
$suggestions[] = 'edlp_ajax__' . $vars['entity_type'];
$suggestions[] = 'edlp_ajax__' . $vars['entity_type'] . '__' . $sanitized_view_mode;
@@ -117,5 +119,8 @@ function edlp_ajax_theme_suggestions_edlp_ajax(array $vars) {
$suggestions[] = 'edlp_ajax__' . $vars['entity_type'] . '__' . $vars['entity']->id();
$suggestions[] = 'edlp_ajax__' . $vars['entity_type'] . '__' . $vars['entity']->id() . '__' . $sanitized_view_mode;
$suggestions[] = 'edlp_ajax__' . $vars['entity_type'] . '__' . $vars['bundle'];
$suggestions[] = 'edlp_ajax__' . $vars['entity_type'] . '__' . $vars['bundle'] . '__' . $sanitized_view_mode;
return $suggestions;
}
@@ -59,7 +59,10 @@ class EdlpAjaxController extends ControllerBase {
if(count($future_nids) || count($past_nids)){
$aside = array(
'#type'=>'container'
'#type'=>'container',
"#attributes"=>array(
"class"=>['agenda']
)
);
$node_view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
@@ -71,7 +74,7 @@ class EdlpAjaxController extends ControllerBase {
'#items' => [],
);
foreach($future_nodes as $node){
$future_list['#items'][] = $node_view_builder->view($node, 'teaser');
$future_list['#items'][] = $node_view_builder->view($node, 'aside');
}
$aside['future_events'] = array(
"#type"=>"container",
@@ -90,12 +93,12 @@ class EdlpAjaxController extends ControllerBase {
'#items' => [],
);
foreach($past_nodes as $node){
$past_list['#items'][] = $node_view_builder->view($node, 'teaser');
$past_list['#items'][] = $node_view_builder->view($node, 'aside');
}
$aside['past_events'] = array(
"#type"=>"container",
"#attributes"=>array(
"class"=>['future-events']
"class"=>['past-events']
),
"#markup"=>"<h3>" . t("Past events") . "</h3>",
"past_events"=>$past_list
@@ -130,6 +133,7 @@ class EdlpAjaxController extends ControllerBase {
'#entity' => $this->entity,
'#view_mode' => $this->viewmode,
'#aside' => $this->getAside(),
'#bundle' => $this->bundle,
);
}else{
return array(