index general, fixe #541
This commit is contained in:
@@ -69,7 +69,6 @@ $this.height(Math.min($this.attr('init-height'),_$row.height()));});};function c
|
||||
function initCollectionNav(){void 0;$('.field--name-field-notice, .index','.taxonomy-term.vocabulary-entrees.home_mobile').addClass('closed');$('.field--name-field-notice>.field__label','.taxonomy-term.vocabulary-entrees.home_mobile').on('click',onClickCollectionNotice);$('.index>.field__label','.taxonomy-term.vocabulary-entrees.home_mobile').on('click',onClickCollectionIndex);};function onClickCollectionNotice(e){toggleEntreeOpening($(this).parent(),'notice');};function onClickCollectionIndex(e){toggleEntreeOpening($(this).parent(),'index');};function toggleEntreeOpening($e,part){$e.toggleClass('closed').parents('.taxonomy-term.vocabulary-entrees.home_mobile').toggleClass(part+'-opened');}
|
||||
function initSearch(){$('#edit-entries--wrapper legend','#edlp-search-form').on('click',function(){$(this).parent().toggleClass('opened');});};function initEnregistrementTranscript(){void 0;var $node=_$row.find('article.node--type-enregistrement.node--view-mode-transcript');var $nav=$('<nav>').prependTo($node);$node.find('.field--name-field-transcript-vo').addClass('visible').find('.field__label').clone().appendTo($nav).addClass('is-active').attr('field_target','.field--name-field-transcript-vo');$node.find('.field--name-field-transcript-trad').find('.field__label').clone().appendTo($nav).attr('field_target','.field--name-field-transcript-trad');$nav.find('.field__label').on('click',function(){var $this=$(this).addClass('is-active');$this.siblings('.is-active').removeClass('is-active');$this.parents('article.node').find('.field.visible').removeClass('visible');$this.parents('article.node').find($this.attr('field_target')).addClass('visible');});};function backToFrontPage(pop_state){void 0;closeAllModals();$('body').removeClass().addClass('path-frontpage');$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');if(_corpus_ready){_$corpus_canvas.trigger({'type':'close-all-entree'});_$corpus_canvas.trigger({'type':'scramble-collection'});}
|
||||
if(typeof pop_state=="undefined"||!pop_state){void 0;history.pushState({home:true},null,drupalSettings.path.baseUrl+drupalSettings.path.currentLanguage);}}
|
||||
function initHome(){addCloseModalBtnToCols();return;void 0;var $grid=$('.grid',_$row).masonry({itemSelector:'.col',columnWidth:'.col-2',horizontalOrder:true,containerStyle:null,});$grid.imagesLoaded().progress(function(){$grid.masonry('layout');});$grid.imagesLoaded(function(){$grid.masonry('layout');});}
|
||||
function closeAllModals(){_$row.html('');_$ajaxLinks.removeClass('is-active');_$body.trigger({'type':'all-modal-closed'});};function checkRowEmpty(){void 0;if(!$('.col',_$row).length){if(!_$body.is('.entity-type-taxonomy_term.bundle-entrees')){if(!_$body.is('.entity-type-node.bundle-page')){if(_$body.is('.bundle-enregistrement.view-mode-article')&&$('a.articles-link').is('.is-active')){void 0;$('a.articles-link').removeClass('is-active').trigger('click');}else{backToFrontPage();}}else{if(_corpus_ready){_$corpus_canvas.trigger({'type':'scramble-collection'});}
|
||||
$('a[data-drupal-link-system-path="productions"]','#block-mainnavigation').removeClass('is-active').trigger('click');}}else{$('.entree-content a.is-active').removeClass('is-active');}}};init();}
|
||||
$(document).ready(function($){if(drupalSettings.path.isFront){var edlptheme=new EdlpTheme();}else{$('body').attr('booted','booted');}});})(jQuery,Drupal,drupalSettings);
|
||||
File diff suppressed because one or more lines are too long
@@ -1940,32 +1940,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
function initHome(){
|
||||
addCloseModalBtnToCols();
|
||||
return;
|
||||
console.log('theme : initHome');
|
||||
var $grid = $('.grid',_$row).masonry({
|
||||
itemSelector:'.col',
|
||||
columnWidth:'.col-2',
|
||||
horizontalOrder: true,
|
||||
containerStyle: null,
|
||||
// disable initial layout
|
||||
// initLayout: false,
|
||||
});
|
||||
// bind event
|
||||
// $grid.masonry( 'on', 'layoutComplete', function() {
|
||||
// console.log('layout is complete');
|
||||
// function initHome(){
|
||||
// addCloseModalBtnToCols();
|
||||
// return;
|
||||
// console.log('theme : initHome');
|
||||
// var $grid = $('.grid',_$row).masonry({
|
||||
// itemSelector:'.col',
|
||||
// columnWidth:'.col-2',
|
||||
// horizontalOrder: true,
|
||||
// containerStyle: null,
|
||||
// // disable initial layout
|
||||
// // initLayout: false,
|
||||
// });
|
||||
|
||||
// layout Masonry after each image loads
|
||||
$grid.imagesLoaded().progress( function() {
|
||||
$grid.masonry('layout');
|
||||
});
|
||||
|
||||
$grid.imagesLoaded(function(){
|
||||
$grid.masonry('layout');
|
||||
});
|
||||
}
|
||||
// // bind event
|
||||
// // $grid.masonry( 'on', 'layoutComplete', function() {
|
||||
// // console.log('layout is complete');
|
||||
// // });
|
||||
//
|
||||
// // layout Masonry after each image loads
|
||||
// $grid.imagesLoaded().progress( function() {
|
||||
// $grid.masonry('layout');
|
||||
// });
|
||||
//
|
||||
// $grid.imagesLoaded(function(){
|
||||
// $grid.masonry('layout');
|
||||
// });
|
||||
// }
|
||||
|
||||
// __ __ _ _
|
||||
// | \/ |___ __| |__ _| |___
|
||||
|
||||
@@ -385,7 +385,8 @@ main[role="main"]{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
article.node.node--type-enregistrement.node--view-mode-index{
|
||||
article.node.node--type-enregistrement.node--view-mode-index,
|
||||
article.node.node--type-enregistrement.node--view-mode-docsindex{
|
||||
&{margin:0}
|
||||
h2.node-title{margin-top: 0.6em; line-height: 1;}
|
||||
p{margin:0.1em 0;}
|
||||
@@ -530,7 +531,8 @@ main[role="main"]{
|
||||
}
|
||||
}
|
||||
|
||||
div.lastdocs{
|
||||
div.lastdocs,
|
||||
div.docsindex{
|
||||
article.node--type-enregistrement{
|
||||
h2.node-title{
|
||||
@include content_subtitles;
|
||||
@@ -2016,7 +2018,11 @@ footer{
|
||||
margin:0;
|
||||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
|
||||
// docsindex
|
||||
&:first-of-type{
|
||||
margin-right: 4em;
|
||||
}
|
||||
// articles
|
||||
&:last-of-type:not(.entree){
|
||||
margin-right: 5em;
|
||||
}
|
||||
@@ -2029,7 +2035,7 @@ footer{
|
||||
width:1.5em;
|
||||
}
|
||||
|
||||
a.term-link, a.articles-link{
|
||||
a.term-link, a.docsindex-link, a.articles-link{
|
||||
// outline: 1px solid blue;
|
||||
pointer-events: all;
|
||||
// background-color: #fff;
|
||||
@@ -2049,6 +2055,10 @@ footer{
|
||||
transition: background-color 0.1s ease-in-out;
|
||||
}
|
||||
|
||||
&.docsindex-link{
|
||||
// margin-right: 4em;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
&.articles-link{
|
||||
margin-left: 4em;
|
||||
text-transform: capitalize;
|
||||
@@ -2171,6 +2181,7 @@ footer{
|
||||
// }
|
||||
.entree-content span.oblique-wrapper a:not(:hover):not(.is-active):before{background-color: #fff!important;}
|
||||
|
||||
a.docsindex-link:not(:hover):not(.is-active):before,
|
||||
a.articles-link:not(:hover):not(.is-active):before{
|
||||
background-color: #fff!important;
|
||||
}
|
||||
|
||||
@@ -150,127 +150,27 @@ function edlptheme_preprocess_edlp_productions(&$vars){
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_node__enregistrement__index(&$vars){
|
||||
// $node = $vars['elements']['#node'];
|
||||
// $options = ['absolute' => TRUE];
|
||||
// $url = Url::fromRoute('entity.node.canonical', ['node' => $node->id()], $options);
|
||||
// $system_path = $url->getInternalPath();
|
||||
// // get the audio file url
|
||||
// $field_son_values = $node->get('field_son')->getValue();
|
||||
// $son_fid = count($field_son_values) ? $field_son_values[0]['target_id'] : "";
|
||||
// $son_file = \Drupal\file\Entity\File::load($son_fid);
|
||||
// $son_url = null;
|
||||
// if($son_file){
|
||||
// $son_uri = $son_file->getFileUri();
|
||||
// $son_url = file_create_url($son_uri);
|
||||
// }
|
||||
//
|
||||
// $vars['link_attributes'] = new Attribute(array(
|
||||
// 'data-drupal-link-system-path' => $system_path=='' ? '<front>' : $system_path,
|
||||
// 'audio_url' => $son_url,
|
||||
// 'nid' => $node->id(),
|
||||
// 'class' => array('audio-link', 'ajax-link')
|
||||
// ));
|
||||
edlptheme_prepare_audio_link($vars);
|
||||
// dpm($vars['link_attributes']);
|
||||
}
|
||||
|
||||
// forhome mobile index
|
||||
function edlptheme_preprocess_node__enregistrement__index_home(&$vars){
|
||||
// $node = $vars['elements']['#node'];
|
||||
// $options = ['absolute' => TRUE];
|
||||
// $url = Url::fromRoute('entity.node.canonical', ['node' => $node->id()], $options);
|
||||
// $system_path = $url->getInternalPath();
|
||||
// // get the audio file url
|
||||
// $field_son_values = $node->get('field_son')->getValue();
|
||||
// $son_fid = count($field_son_values) ? $field_son_values[0]['target_id'] : "";
|
||||
// $son_file = \Drupal\file\Entity\File::load($son_fid);
|
||||
// $son_url = null;
|
||||
// if($son_file){
|
||||
// $son_uri = $son_file->getFileUri();
|
||||
// $son_url = file_create_url($son_uri);
|
||||
// }
|
||||
//
|
||||
// $vars['link_attributes'] = new Attribute(array(
|
||||
// 'data-drupal-link-system-path' => $system_path=='' ? '<front>' : $system_path,
|
||||
// 'audio_url' => $son_url,
|
||||
// 'nid' => $node->id(),
|
||||
// 'class' => array('audio-link', 'ajax-link')
|
||||
// ));
|
||||
edlptheme_prepare_audio_link($vars);
|
||||
// dpm($vars['link_attributes']);
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_node__enregistrement__search_index(&$vars){
|
||||
// $node = $vars['elements']['#node'];
|
||||
// $options = ['absolute' => TRUE];
|
||||
// $url = Url::fromRoute('entity.node.canonical', ['node' => $node->id()], $options);
|
||||
// $system_path = $url->getInternalPath();
|
||||
// // get the audio file url
|
||||
// $field_son_values = $node->get('field_son')->getValue();
|
||||
// $son_fid = count($field_son_values) ? $field_son_values[0]['target_id'] : "";
|
||||
// $son_file = \Drupal\file\Entity\File::load($son_fid);
|
||||
// $son_url = null;
|
||||
// if($son_file){
|
||||
// $son_uri = $son_file->getFileUri();
|
||||
// $son_url = file_create_url($son_uri);
|
||||
// }
|
||||
//
|
||||
// $vars['link_attributes'] = new Attribute(array(
|
||||
// 'data-drupal-link-system-path' => $system_path=='' ? '<front>' : $system_path,
|
||||
// 'audio_url' => $son_url,
|
||||
// 'nid' => $node->id(),
|
||||
// 'class' => array('audio-link', 'ajax-link')
|
||||
// ));
|
||||
edlptheme_prepare_audio_link($vars);
|
||||
// dpm($vars['link_attributes']);
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_node__enregistrement__lastdocs(&$vars){
|
||||
// $node = $vars['elements']['#node'];
|
||||
// $options = ['absolute' => TRUE];
|
||||
// $url = Url::fromRoute('entity.node.canonical', ['node' => $node->id()], $options);
|
||||
// $system_path = $url->getInternalPath();
|
||||
// // get the audio file url
|
||||
// $field_son_values = $node->get('field_son')->getValue();
|
||||
// $son_fid = count($field_son_values) ? $field_son_values[0]['target_id'] : "";
|
||||
// $son_file = \Drupal\file\Entity\File::load($son_fid);
|
||||
// $son_url = null;
|
||||
// if($son_file){
|
||||
// $son_uri = $son_file->getFileUri();
|
||||
// $son_url = file_create_url($son_uri);
|
||||
// }
|
||||
//
|
||||
// $vars['link_attributes'] = new Attribute(array(
|
||||
// 'data-drupal-link-system-path' => $system_path=='' ? '<front>' : $system_path,
|
||||
// 'audio_url' => $son_url,
|
||||
// 'nid' => $node->id(),
|
||||
// 'class' => array('audio-link', 'ajax-link')
|
||||
// ));
|
||||
edlptheme_prepare_audio_link($vars);
|
||||
// dpm($vars['link_attributes']);
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_node__enregistrement__docsindex(&$vars){
|
||||
edlptheme_prepare_audio_link($vars);
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_node__enregistrement__compo(&$vars){
|
||||
// $node = $vars['elements']['#node'];
|
||||
// $options = ['absolute' => TRUE];
|
||||
// $url = Url::fromRoute('entity.node.canonical', ['node' => $node->id()], $options);
|
||||
// $system_path = $url->getInternalPath();
|
||||
// // get the audio file url
|
||||
// $field_son_values = $node->get('field_son')->getValue();
|
||||
// $son_fid = count($field_son_values) ? $field_son_values[0]['target_id'] : "";
|
||||
// $son_file = \Drupal\file\Entity\File::load($son_fid);
|
||||
// $son_url = null;
|
||||
// if($son_file){
|
||||
// $son_uri = $son_file->getFileUri();
|
||||
// $son_url = file_create_url($son_uri);
|
||||
// }
|
||||
//
|
||||
// $vars['link_attributes'] = new Attribute(array(
|
||||
// 'data-drupal-link-system-path' => $system_path=='' ? '<front>' : $system_path,
|
||||
// 'audio_url' => $son_url,
|
||||
// 'nid' => $node->id(),
|
||||
// 'class' => array('audio-link', 'ajax-link')
|
||||
// ));
|
||||
edlptheme_prepare_audio_link($vars);
|
||||
|
||||
// dpm($vars);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<div class="col small-col-12 med-col-5 large-col-5">
|
||||
<div class="wrapper">
|
||||
{{ docsindex }}
|
||||
</div>
|
||||
</div>
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override to display a node.
|
||||
*
|
||||
* Available variables:
|
||||
* - node: The node entity with limited access to object properties and methods.
|
||||
* Only method names starting with "get", "has", or "is" and a few common
|
||||
* methods such as "id", "label", and "bundle" are available. For example:
|
||||
* - node.getCreatedTime() will return the node creation timestamp.
|
||||
* - node.hasField('field_example') returns TRUE if the node bundle includes
|
||||
* field_example. (This does not indicate the presence of a value in this
|
||||
* field.)
|
||||
* - node.isPublished() will return whether the node is published or not.
|
||||
* Calling other methods, such as node.delete(), will result in an exception.
|
||||
* See \Drupal\node\Entity\Node for a full list of public properties and
|
||||
* methods for the node object.
|
||||
* - label: The title of the node.
|
||||
* - content: All node items. Use {{ content }} to print them all,
|
||||
* or print a subset such as {{ content.field_example }}. Use
|
||||
* {{ content|without('field_example') }} to temporarily suppress the printing
|
||||
* of a given child element.
|
||||
* - author_picture: The node author user entity, rendered using the "compact"
|
||||
* view mode.
|
||||
* - metadata: Metadata for this node.
|
||||
* - date: Themed creation date field.
|
||||
* - author_name: Themed author name field.
|
||||
* - url: Direct URL of the current node.
|
||||
* - display_submitted: Whether submission information should be displayed.
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* The attributes.class element may contain one or more of the following
|
||||
* classes:
|
||||
* - node: The current template type (also known as a "theming hook").
|
||||
* - node--type-[type]: The current node type. For example, if the node is an
|
||||
* "Article" it would result in "node--type-article". Note that the machine
|
||||
* name will often be in a short form of the human readable label.
|
||||
* - node--view-mode-[view_mode]: The View Mode of the node; for example, a
|
||||
* teaser would result in: "node--view-mode-teaser", and
|
||||
* full: "node--view-mode-full".
|
||||
* The following are controlled through the node publishing options.
|
||||
* - node--promoted: Appears on nodes promoted to the front page.
|
||||
* - node--sticky: Appears on nodes ordered above other non-sticky nodes in
|
||||
* teaser listings.
|
||||
* - node--unpublished: Appears on unpublished nodes visible only to site
|
||||
* admins.
|
||||
* - title_attributes: Same as attributes, except applied to the main title
|
||||
* tag that appears in the template.
|
||||
* - content_attributes: Same as attributes, except applied to the main
|
||||
* content tag that appears in the template.
|
||||
* - author_attributes: Same as attributes, except applied to the author of
|
||||
* the node tag that appears in the template.
|
||||
* - title_prefix: Additional output populated by modules, intended to be
|
||||
* displayed in front of the main title tag that appears in the template.
|
||||
* - title_suffix: Additional output populated by modules, intended to be
|
||||
* displayed after the main title tag that appears in the template.
|
||||
* - view_mode: View mode; for example, "teaser" or "full".
|
||||
* - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'.
|
||||
* - page: Flag for the full page state. Will be true if view_mode is 'full'.
|
||||
* - readmore: Flag for more state. Will be true if the teaser content of the
|
||||
* node cannot hold the main body content.
|
||||
* - logged_in: Flag for authenticated user status. Will be true when the
|
||||
* current user is a logged-in member.
|
||||
* - is_admin: Flag for admin user status. Will be true when the current user
|
||||
* is an administrator.
|
||||
*
|
||||
* @see template_preprocess_node()
|
||||
*
|
||||
* @todo Remove the id attribute (or make it a class), because if that gets
|
||||
* rendered twice on a page this is invalid CSS for example: two lists
|
||||
* in different view modes.
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'node',
|
||||
'node--type-' ~ node.bundle|clean_class,
|
||||
node.isPromoted() ? 'node--promoted',
|
||||
node.isSticky() ? 'node--sticky',
|
||||
not node.isPublished() ? 'node--unpublished',
|
||||
view_mode ? 'node--view-mode-' ~ view_mode|clean_class,
|
||||
]
|
||||
%}
|
||||
{{ attach_library('classy/node') }}
|
||||
<article{{ attributes.addClass(classes) }}>
|
||||
<div class="entrees">
|
||||
{# THIS IS REALLY DIRTY !! #}
|
||||
{% for key, child in content.field_entrees if key|first != '#' %}
|
||||
{% set tid = child['#cache']['tags'][0]|replace({'taxonomy_term:':''}) %}
|
||||
<span class="entree" tid="{{ tid }}" title="{{ child }}"></span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<h2{{ title_attributes.addClass('node-title') }}>
|
||||
<a href="{{ url }}" rel="bookmark" {{ link_attributes }}>{{ label }}</a>
|
||||
</h2>
|
||||
<div class="description">
|
||||
{{ content.field_description }}
|
||||
</div>
|
||||
</article>
|
||||
Reference in New Issue
Block a user