finished home contents, created edlp_fils custom module
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# @Author: Bachir Soussi Chiadmi <bach>
|
||||
# @Date: 13-12-2017
|
||||
# @Email: bachir@figureslibres.io
|
||||
# @Filename: edlp_fils.info.yml
|
||||
# @Last modified by: bach
|
||||
# @Last modified time: 20-12-2017
|
||||
# @License: GPL-V3
|
||||
|
||||
|
||||
name: Edlp Fils
|
||||
type: module
|
||||
description: Manage fils for edlp d8.
|
||||
core: 8.x
|
||||
package: Edlp
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
# @Author: Bachir Soussi Chiadmi <bach>
|
||||
# @Date: 13-12-2017
|
||||
# @Email: bachir@figureslibres.io
|
||||
# @Filename: edlp_admin.module
|
||||
# @Last modified by: bach
|
||||
# @Last modified time: 20-12-2017
|
||||
# @License: GPL-V3
|
||||
@@ -0,0 +1,23 @@
|
||||
# @Author: Bachir Soussi Chiadmi <bach>
|
||||
# @Date: 13-12-2017
|
||||
# @Email: bachir@figureslibres.io
|
||||
# @Filename: edlp_corpus.routing.yml
|
||||
# @Last modified by: bach
|
||||
# @Last modified time: 20-12-2017
|
||||
# @License: GPL-V3
|
||||
|
||||
edlp_fils.fils:
|
||||
path: '/fils'
|
||||
defaults:
|
||||
_controller: '\Drupal\edlp_fils\Controller\FilsController::fils'
|
||||
_title: 'Fils'
|
||||
requirements:
|
||||
_permission: 'access content'
|
||||
|
||||
edlp_fils.filsajax:
|
||||
path: '/fils/ajax'
|
||||
defaults:
|
||||
_controller: '\Drupal\edlp_fils\Controller\FilsController::filsjson'
|
||||
_title: 'Fils'
|
||||
requirements:
|
||||
_permission: 'access content'
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\edlp_fils\Controller;
|
||||
|
||||
use Drupal\Core\Controller\ControllerBase;
|
||||
// use Drupal\Core\Datetime\DrupalDateTime;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
|
||||
class FilsController extends ControllerBase {
|
||||
|
||||
/**
|
||||
* Display productions as a page.
|
||||
*
|
||||
* @return renderable array
|
||||
*/
|
||||
public function fils() {
|
||||
return array(
|
||||
"#markup"=>"Edlp Fils"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get agenda data as json through ajax.
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
public function filsjson() {
|
||||
|
||||
$response = new JsonResponse();
|
||||
$renderable = array(
|
||||
"#markup"=>"Edlp Fils"
|
||||
);
|
||||
$rendered = render($renderable);
|
||||
|
||||
$response->setData([
|
||||
'test'=>'hello',
|
||||
'rendered'=> $rendered
|
||||
]);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +1,71 @@
|
||||
<?php
|
||||
|
||||
use Drupal\Core\Url;
|
||||
|
||||
function template_preprocess_edlp_home(&$vars){
|
||||
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('node');
|
||||
// dpm($vars);
|
||||
|
||||
// render the presentation node
|
||||
// render the presentation column
|
||||
$vars["presentation"] = array(
|
||||
$view_builder->view($vars["presentation_node"], 'default')
|
||||
"#type"=>"container",
|
||||
"pres"=>$view_builder->view($vars["presentation_node"], 'default'),
|
||||
"link"=> array(
|
||||
'#title' => t('Visiter la collection sonore.'),
|
||||
'#type' => 'link',
|
||||
'#url' => Url::fromRoute('<front>', [], array(
|
||||
'attributes' => array(
|
||||
'class' => ['corpus-link', 'ajax-link']
|
||||
)
|
||||
))
|
||||
)
|
||||
);
|
||||
|
||||
// render the last fil node
|
||||
$vars["last_fil"] = $view_builder->view($vars['last_fil_node'], 'teaser');
|
||||
// render the last fil column
|
||||
$vars["last_fil"] = array(
|
||||
"#type" => "container",
|
||||
'fil' => $view_builder->view($vars['last_fil_node'], 'teaser'),
|
||||
'links' => array(
|
||||
'#theme' => 'item_list',
|
||||
'#items' => array(
|
||||
'link_all' => array(
|
||||
'#title' => t("Voir tous les fils de l'EP."),
|
||||
'#type' => 'link',
|
||||
'#url' => Url::fromRoute('edlp_fils.fils', [], array(
|
||||
'attributes' => array(
|
||||
'class' => ['fils-link', 'ajax-link']
|
||||
)
|
||||
))
|
||||
),
|
||||
// TODO: link posdcast fils
|
||||
'link_podcast' => array(
|
||||
'#title' => t("S'abonner au podcast des fils."),
|
||||
'#type' => 'link',
|
||||
'#url' => Url::fromRoute('<front>', [], array(
|
||||
'attributes' => array(
|
||||
'class' => ['fils-link']
|
||||
)
|
||||
))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
// render the last production node
|
||||
$vars["last_production"] = $view_builder->view($vars['last_production_node'], 'teaser');
|
||||
);
|
||||
|
||||
// render the last production column
|
||||
$vars["last_production"] = array(
|
||||
'#type' => 'container',
|
||||
'prod' => $view_builder->view($vars['last_production_node'], 'teaser'),
|
||||
'link'=> array(
|
||||
'#title' => t('Voir toutes les productions.'),
|
||||
'#type' => 'link',
|
||||
'#url' => Url::fromRoute('edlp_productions.productions', [], array(
|
||||
'attributes' => array(
|
||||
'class' => ['productions-link', 'ajax-link']
|
||||
)
|
||||
))
|
||||
)
|
||||
);
|
||||
|
||||
// render the next events of agenda as list
|
||||
$agenda = array (
|
||||
|
||||
@@ -10,7 +10,7 @@ edlp_productions.productions:
|
||||
path: '/productions'
|
||||
defaults:
|
||||
_controller: '\Drupal\edlp_productions\Controller\ProductionsController::productions'
|
||||
_title: 'Agenda'
|
||||
_title: 'Productions'
|
||||
requirements:
|
||||
_permission: 'access content'
|
||||
|
||||
@@ -18,6 +18,6 @@ edlp_productions.productionsajax:
|
||||
path: '/productions/ajax'
|
||||
defaults:
|
||||
_controller: '\Drupal\edlp_productions\Controller\ProductionsController::productionsjson'
|
||||
_title: 'Agenda'
|
||||
_title: 'Productions'
|
||||
requirements:
|
||||
_permission: 'access content'
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
<div class="row">
|
||||
<div class="presentation col col-4">
|
||||
{{ presentation }}
|
||||
<div class="wrapper">
|
||||
{{ presentation }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="last-file col col-2">
|
||||
{{ last_fil }}
|
||||
<div class="wrapper">
|
||||
{{ last_fil }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="last-prod col col-4">
|
||||
{{ last_production }}
|
||||
<div class="wrapper">
|
||||
{{ last_production }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="agenda col col-2">
|
||||
{{ agenda }}
|
||||
<div class="wrapper">
|
||||
{{ agenda }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user