Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95cd2c15cf | ||
|
|
00166e7917 | ||
|
|
ea435b7517 | ||
|
|
6d88ca7c8d | ||
|
|
d4087b2924 |
@@ -1 +1 @@
|
||||
canvas#corpus-map{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;top:0;left:0;z-index:0}canvas#corpus-map.de-activated{background-color:#f4f4f4}div.node-popup{z-index:10;position:absolute;-webkit-box-sizing:content-box;box-sizing:content-box;width:300px;min-height:30px;top:60%;left:30%;pointer-events:none}div.node-popup .inner{padding:1em;outline:red solid 1px;background-color:#fff}div.node-popup:before{content:"";position:absolute;width:60px;height:0;border-top:1px solid red}div.node-popup[pos=bottom-right]{-webkit-transform:translateY(42px) translateX(42px);transform:translateY(42px) translateX(42px)}div.node-popup[pos=bottom-right]:before{top:-1px;left:-61px;-webkit-transform-origin:bottom right;transform-origin:bottom right;-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}div.node-popup[pos=bottom-left]{-webkit-transform:translateX(-100%) translateY(42px) translateX(-42px);transform:translateX(-100%) translateY(42px) translateX(-42px)}div.node-popup[pos=bottom-left]:before{top:calc(100% +1px);left:100%;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:rotateZ(-45deg);transform:rotateZ(-45deg)}div.node-popup[pos=top-left]{-webkit-transform:translateY(-100%) translateX(-100%) translateY(-42px) translateX(-42px);transform:translateY(-100%) translateX(-100%) translateY(-42px) translateX(-42px)}div.node-popup[pos=top-left]:before{bottom:0;left:100%;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}div.node-popup[pos=top-right]{-webkit-transform:translateY(-100%) translateY(-42px) translateX(42px);transform:translateY(-100%) translateY(-42px) translateX(42px)}div.node-popup[pos=top-right]:before{top:calc(100% + 1px);left:-61px;-webkit-transform-origin:top right;transform-origin:top right;-webkit-transform:rotateZ(-45deg);transform:rotateZ(-45deg)}
|
||||
canvas#corpus-map{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;top:0;left:0;z-index:0}canvas#corpus-map.de-activated{background-color:#f4f4f4}div.node-popup{z-index:10;position:absolute;-webkit-box-sizing:content-box;box-sizing:content-box;width:300px;min-height:30px;top:60%;left:30%;pointer-events:none}div.node-popup .inner{padding:.4em;outline:red solid 1px;background-color:#fff}div.node-popup:before{content:"";position:absolute;width:60px;height:0;border-top:1px solid red}div.node-popup[pos=bottom-right]{-webkit-transform:translateY(42px) translateX(42px);transform:translateY(42px) translateX(42px)}div.node-popup[pos=bottom-right]:before{top:-1px;left:-61px;-webkit-transform-origin:bottom right;transform-origin:bottom right;-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}div.node-popup[pos=bottom-left]{-webkit-transform:translateX(-100%) translateY(42px) translateX(-42px);transform:translateX(-100%) translateY(42px) translateX(-42px)}div.node-popup[pos=bottom-left]:before{top:calc(100% +1px);left:100%;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:rotateZ(-45deg);transform:rotateZ(-45deg)}div.node-popup[pos=top-left]{-webkit-transform:translateY(-100%) translateX(-100%) translateY(-42px) translateX(-42px);transform:translateY(-100%) translateX(-100%) translateY(-42px) translateX(-42px)}div.node-popup[pos=top-left]:before{bottom:0;left:100%;-webkit-transform-origin:top left;transform-origin:top left;-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}div.node-popup[pos=top-right]{-webkit-transform:translateY(-100%) translateY(-42px) translateX(42px);transform:translateY(-100%) translateY(-42px) translateX(42px)}div.node-popup[pos=top-right]:before{top:calc(100% + 1px);left:-61px;-webkit-transform-origin:top right;transform-origin:top right;-webkit-transform:rotateZ(-45deg);transform:rotateZ(-45deg)}
|
||||
@@ -34,7 +34,7 @@ div.node-popup{
|
||||
pointer-events: none;
|
||||
|
||||
.inner{
|
||||
padding:1em;
|
||||
padding:0.4em;
|
||||
outline: 1px solid red;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,11 @@ function edlp_corpus_entity_extra_field_info(){
|
||||
'weight' => 99,
|
||||
// 'visible' => FALSE,
|
||||
];
|
||||
$extra['node']['enregistrement']['display']['relations'] = [
|
||||
'label' => t('Relations'),
|
||||
'description' => 'Display enregistrement relations with other content types',
|
||||
'weight' => 99,
|
||||
];
|
||||
return $extra;
|
||||
}
|
||||
|
||||
@@ -93,6 +98,58 @@ function edlp_corpus_taxonomy_term_view(array &$build, EntityInterface $entity,
|
||||
}
|
||||
}
|
||||
|
||||
function edlp_corpus_node_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
|
||||
if($entity->bundle() == "enregistrement"){
|
||||
$relations_display_settings = $display->getComponent('relations');
|
||||
if(!empty($relations_display_settings)){
|
||||
|
||||
// querying all productions page that have this document in their entity reference "field_documents_liés"
|
||||
$query = \Drupal::entityQuery('node')
|
||||
->condition('status', 1)
|
||||
->condition('type', 'page') // page (production)
|
||||
->exists('field_page_type')
|
||||
->condition('field_documents_lies.target_id', $entity->id(), 'IN');
|
||||
|
||||
$nids = $query->execute();
|
||||
$nodes = entity_load_multiple('node', $nids);
|
||||
// dpm($nodes, '$nodes');
|
||||
|
||||
// build the array of relateds classified by page_type (taxonomy)
|
||||
$relateds = array();
|
||||
foreach ($nodes as $nid => $node) {
|
||||
$page_type = $node->get('field_page_type')->get(0)->getValue();
|
||||
// dpm($page_type, 'page_type');
|
||||
$term = entity_load('taxonomy_term', $page_type['target_id']);
|
||||
// dpm($term, 'term');
|
||||
$relateds[$term->getName()][] = $node->getTitle();
|
||||
}
|
||||
// dpm($relateds, 'relateds');
|
||||
|
||||
// if relateds, build the sentence for display and the render array
|
||||
if(count($relateds)){
|
||||
$relations = '<h3>' . t('This sound is about :') . '</h3><p>';
|
||||
|
||||
foreach ($relateds as $cat => $titles) {
|
||||
$relations .= '<span class="cat">' . $cat . ' :</span> ' . implode(', ', $titles) . ' | ';
|
||||
}
|
||||
|
||||
$relations = preg_replace('/\s\|\s$/', '', $relations);
|
||||
$relations .= '</p>';
|
||||
|
||||
$build['relations'] = array(
|
||||
'#type'=>"container",
|
||||
'#attributes'=>array(
|
||||
'class'=>'relations'
|
||||
),
|
||||
"#markup"=> $relations,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implements hook_page_attachments().
|
||||
* @param array $attachments
|
||||
|
||||
@@ -10,6 +10,9 @@ use Drupal\Core\Url;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
// use Drupal\Core\Cache\CacheableJsonResponse;
|
||||
// use Drupal\Core\Cache\CacheableMetadata;
|
||||
use Drupal\core\render\RenderContext;
|
||||
|
||||
/**
|
||||
* Class EdlpSearchController.
|
||||
|
||||
@@ -138,6 +138,8 @@ function edlp_studio_node_view(array &$build, \Drupal\Core\Entity\EntityInterfac
|
||||
$user = \Drupal::currentUser();
|
||||
// dpm($user);
|
||||
// check if user loged in ? no -> popup message : yes -> links
|
||||
$register_url = Url::fromRoute('user.register');
|
||||
|
||||
if($user->id() == 0){
|
||||
$build['chutier_actions'] = array(
|
||||
'#type' => 'container',
|
||||
@@ -156,14 +158,29 @@ function edlp_studio_node_view(array &$build, \Drupal\Core\Entity\EntityInterfac
|
||||
),
|
||||
'text'=>array(
|
||||
'#prefix'=>'<p>',
|
||||
'#markup'=>t('Le Studio rassemble vos documents favoris.Il permet de les sauvgarder et de les agencer en compositions.'),
|
||||
'#markup'=>t('Le Studio rassemble vos documents favoris. Il permet de les sauvegarder et de les agencer en compositions.'),
|
||||
'#suffix'=>'</p>'
|
||||
),
|
||||
// TODO: ajouter le login form
|
||||
'links'=>array(
|
||||
'#prefix'=>'<p>',
|
||||
'#markup'=>'todo: login link',
|
||||
'register'=> array(
|
||||
'#type' => 'link',
|
||||
'#title' => t('Create new account'),
|
||||
'#url' => $register_url,
|
||||
'#options'=>array(
|
||||
'attributes' => array(
|
||||
'data-drupal-link-system-path' => $register_url->getInternalPath()
|
||||
)
|
||||
)
|
||||
),
|
||||
'#suffix'=>'</p>'
|
||||
)
|
||||
),
|
||||
'text'=>array(
|
||||
'#prefix'=>'<p>',
|
||||
'#markup'=>t("Ou connectez vous en survolant l'icone du studio en bas a droite de la page"),
|
||||
'#suffix'=>'</p>'
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -9,6 +9,9 @@ use Drupal\User\UserDataInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\Core\Language\LanguageInterface;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
// use Drupal\Core\Cache\CacheableJsonResponse;
|
||||
// use Drupal\Core\Cache\CacheableMetadata;
|
||||
use Drupal\core\render\RenderContext;
|
||||
|
||||
use Drupal\edlp_studio\Entity\Chutier;
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
return;initEvents();_audioPlayer=new AudioPlayer();_compoPlayer=new CompoPlayer();};function initEvents(){_$body.on('corpus-map-ready',onCorpusMapReady).on('on-studio-chutier-updated',initAjaxLinks).on('studio-initialized',function(e){_compoPlayer.newCompo();}).on('studio-not-active',function(e){_compoPlayer.deactivate();}).on('on-studio-compo-updated',function(e){initAjaxLinks();_compoPlayer.refresh();}).on('on-studio-compo-opened',function(e){initAjaxLinks();_compoPlayer.newCompo();}).on('search-results-loaded',initAjaxLinks).on('open_entree',function(e){void 0;closeAllModals();_$body.removeClass();if(typeof e.url!='undefined'){var state=getSysPathState(e.sys_path);history.pushState(state,null,e.url);}}).on('close_entree',backToFrontPage);}
|
||||
function initScrollbars(){};function getSysPathState(sys_path,view_mode){var state={'sys_path':sys_path,'ajax_path':sys_path};var node_match=state.ajax_path.match(/^\/?(node\/(\d+))$/i);void 0;var term_match=state.ajax_path.match(/^\/?(taxonomy\/term\/(\d+))$/i);void 0;if(node_match){state.ajax_path=_ajax_settings.entityjson_path+'/'+node_match[1];state.node_nid=node_match[2];if(view_mode){state.ajax_path+='/'+view_mode;}}else if(term_match){state.ajax_path=_ajax_settings.entityjson_path+'/'+term_match[1];state.ajax_path=state.ajax_path.replace(/taxonomy\/term/,'taxonomy_term');state.entree_tid=term_match[2];if(view_mode){state.ajax_path+='/'+view_mode;state.view_mode=view_mode;}else{state.ajax_path=null;}}else{state.ajax_path+='/ajax'}
|
||||
return state;};function ajaxLoadContent(state){void 0;_$body.addClass('ajax-loading');var path=window.location.origin+Drupal.url(state.ajax_path);$.getJSON(path,{}).done(function(data){onAjaxLoaded(data,state);}).fail(function(jqxhr,textStatus,error){onAjaxLoadError(jqxhr,textStatus,error,state.sys_path);});};function onAjaxLoadError(jqxhr,textStatus,error,sys_path){void 0;$('.ajax-loading').removeClass('ajax-loading');_$body.removeClass('ajax-loading');};function onAjaxLoaded(data,state){void 0;_$row.removeAttr('style').html(data.rendered);var body_classes=['path-'+state.sys_path.replace(/\//g,'-'),'entity-type-'+data.entity_type,'bundle-'+data.bundle,'view-mode-'+data.view_mode];_$body.removeClass().addClass(body_classes.join(' '));if(state.node_nid)
|
||||
_$body.addClass('path-edlp-node');$('.ajax-loading').removeClass('ajax-loading');$('.is-active').removeClass('is-active');$('.is-active-trail').removeClass('is-active-trail');if(typeof state.selector!='undefined'){void 0;$('a[selector="'+state.selector+'"]').addClass('is-active');}else{$('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');_$body.trigger({'type':'new-content-not-entree-ajax-loaded'});}
|
||||
_$body.addClass('path-edlp-node');$('.ajax-loading').removeClass('ajax-loading');$('.is-active').removeClass('is-active');$('.is-active-trail').removeClass('is-active-trail');if(typeof state.selector!='undefined'){void 0;$('a[selector="'+state.selector+'"]').addClass('is-active');}else{if(typeof state.view_mode!='undefined'){$('a[viewmode="'+state.view_mode+'"][data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');}else{$('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');}
|
||||
_$body.trigger({'type':'new-content-not-entree-ajax-loaded'});}
|
||||
if(typeof data.bundle!='undefined'&&data.bundle=="page"){$('a[data-drupal-link-system-path="productions"]').addClass('is-active-trail');}
|
||||
if(typeof data.menu_parents!='undefined'){for(var i=0;i<data.menu_parents.length;i++){var menu_sys_path=data.menu_parents[i];$('a[data-drupal-link-system-path="'+menu_sys_path+'"]').addClass('is-active-trail');}}
|
||||
if(typeof data.block!='undefined'){if(!$('#'+data.block.id,'.region-'+data.block.region).length){$('.region-'+data.block.region).append(data.block.rendered);}}
|
||||
if(state.sys_path=="productions"){initProductions();}else{addCloseModalBtnToCols();}
|
||||
if(data.entity_type=="node"&&data.bundle=="enregistrement"&&data.view_mode=="transcript"){initEnregistrementTranscript();}
|
||||
if(typeof data.translations_links!='undefined'){void 0;var lang_code=drupalSettings.path.currentLanguage;var $links=$(data.translations_links);$links.find('li[hreflang="'+lang_code+'"]').addClass('is-active').find('a').addClass('is-active');if(state.view_mode){$links.find('a').each(function(i,e){var $a=$(this);$a.attr('href',$a.attr('href')+'#'+state.view_mode);});}
|
||||
$('ul','.block.language-switcher-language-url').replaceWith($links);}
|
||||
initAjaxLinks();_$body.trigger({'type':'new-content-ajax-loaded'});Drupal.attachBehaviors(_$row[0]);_$body.attr('booted','booted');_$body.removeClass('ajax-loading');if(state.url){history.pushState(state,null,state.url);}};function addCloseModalBtnToCols(){$('.col',_$row).each(function(index,el){if($('span.close-col-btn',this).length)
|
||||
@@ -39,5 +41,5 @@ if(this.$next){if(this.playing&&this.playlist.length>1&&this.current_index<this.
|
||||
if(this.$previous){if(this.playing&&this.playlist.length>1&&this.current_index>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}}
|
||||
return this;},deactivate(){this.stop();this.active=false;},onAudioOpenDocument(args){if(args.caller!==this){this.reset();}},onAudioPlayerPlay(){if(this.playing&&this.paused){this.paused=false;this.showHideControls();}},onAudioPlayerPause(){if(this.playing&&!this.paused){this.paused=true;this.showHideControls();}},onAudioPlayerEnded(){this.next();},};function backToFrontPage(pop_state){closeAllModals();$('body').removeClass().addClass('path-frontpage');$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');_$corpus_canvas.trigger({'type':'close-all-entree'});if(!pop_state){history.pushState({home:true},null,window.location.origin);}}
|
||||
function initHome(){addCloseModalBtnToCols();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 initProductions(){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'});};init();}
|
||||
function initProductions(){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 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 closeAllModals(){_$row.html('');_$ajaxLinks.removeClass('is-active');_$body.trigger({'type':'all-modal-closed'});};init();}
|
||||
$(document).ready(function($){var edlptheme=new EdlpTheme();});})(jQuery,Drupal,drupalSettings);
|
||||
File diff suppressed because one or more lines are too long
@@ -194,7 +194,11 @@
|
||||
console.log('selector', state.selector);
|
||||
$('a[selector="'+state.selector+'"]').addClass('is-active');
|
||||
}else{
|
||||
$('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');
|
||||
if(typeof state.view_mode != 'undefined'){
|
||||
$('a[viewmode="'+state.view_mode+'"][data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');
|
||||
}else{
|
||||
$('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');
|
||||
}
|
||||
// as new content is not related to entree, we trigger close entree
|
||||
_$body.trigger({'type':'new-content-not-entree-ajax-loaded'});
|
||||
}
|
||||
@@ -228,6 +232,12 @@
|
||||
addCloseModalBtnToCols();
|
||||
}
|
||||
|
||||
// enregistrement transcription
|
||||
if(data.entity_type == "node" && data.bundle == "enregistrement" && data.view_mode == "transcript"){
|
||||
// window.requestAnimationFrame(initEnregistrementTranscript);
|
||||
initEnregistrementTranscript();
|
||||
}
|
||||
|
||||
// update the language switcher block if it comes in the response
|
||||
if(typeof data.translations_links != 'undefined'){
|
||||
console.log('state',state);
|
||||
@@ -261,7 +271,6 @@
|
||||
_$body.attr('booted', 'booted');
|
||||
_$body.removeClass('ajax-loading');
|
||||
|
||||
|
||||
// url is null means that we are loading content on popState event
|
||||
// so we don't record the state again
|
||||
if(state.url){
|
||||
@@ -271,7 +280,7 @@
|
||||
// };
|
||||
// console.log('url:'+url+' ; state',state);
|
||||
// console.log(window.location);
|
||||
// we can not pushestate with absolute url
|
||||
// /!\ we can not pushestate with absolute url /!\
|
||||
history.pushState(state, null, state.url);
|
||||
}
|
||||
};
|
||||
@@ -713,6 +722,7 @@
|
||||
stop(){
|
||||
// console.log('AudioPlayer stop()');
|
||||
this.audio.pause();
|
||||
// TODO: don't close player if article or transcript is open
|
||||
this.timeOutToHide();
|
||||
},
|
||||
// audio events
|
||||
@@ -1201,6 +1211,30 @@
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// ___ _ _ _
|
||||
// | __|_ _ _ _ ___ __ _(_)__| |_ _ _ ___ _ __ ___ _ _| |_
|
||||
// | _|| ' \| '_/ -_) _` | (_-< _| '_/ -_) ' \/ -_) ' \ _|
|
||||
// |___|_||_|_| \___\__, |_/__/\__|_| \___|_|_|_\___|_||_\__|
|
||||
// |___/
|
||||
function initEnregistrementTranscript(){
|
||||
console.log('initEnregistrementTranscript');
|
||||
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');
|
||||
});
|
||||
};
|
||||
|
||||
// __ __ _ _
|
||||
// | \/ |___ __| |__ _| |___
|
||||
// | |\/| / _ \/ _` / _` | (_-<
|
||||
|
||||
@@ -20,31 +20,38 @@
|
||||
animation: rotation 2s infinite linear;
|
||||
}
|
||||
|
||||
@mixin entrie-micro-square {
|
||||
display:inline-block;
|
||||
$s:8px;
|
||||
width:$s; height:$s;
|
||||
background-color: black;
|
||||
margin-right: 3px;
|
||||
&[tid='134']{background-color: var(--e-col-134);}
|
||||
&[tid='121']{background-color: var(--e-col-121);}
|
||||
&[tid='125']{background-color: var(--e-col-125);}
|
||||
&[tid='119']{background-color: var(--e-col-119);}
|
||||
&[tid='132']{background-color: var(--e-col-132);}
|
||||
&[tid='122']{background-color: var(--e-col-122);}
|
||||
&[tid='129']{background-color: var(--e-col-129);}
|
||||
&[tid='120']{background-color: var(--e-col-120);}
|
||||
&[tid='130']{background-color: var(--e-col-130);}
|
||||
&[tid='118']{background-color: var(--e-col-118);}
|
||||
&[tid='127']{background-color: var(--e-col-127);}
|
||||
&[tid='133']{background-color: var(--e-col-133);}
|
||||
&[tid='128']{background-color: var(--e-col-128);}
|
||||
&[tid='124']{background-color: var(--e-col-124);}
|
||||
&[tid='116']{background-color: var(--e-col-116);}
|
||||
&[tid='117']{background-color: var(--e-col-117);}
|
||||
&[tid='131']{background-color: var(--e-col-131);}
|
||||
&[tid='126']{background-color: var(--e-col-126);}
|
||||
&[tid='123']{background-color: var(--e-col-123);}
|
||||
@mixin entree-micro-square {
|
||||
white-space: nowrap;
|
||||
font-size: 0.5em;
|
||||
line-height: 0;
|
||||
letter-spacing: 0px;
|
||||
span{
|
||||
display:inline-block;
|
||||
$s:6px;
|
||||
width:$s; height:$s;
|
||||
background-color: black;
|
||||
margin-right: 2px;
|
||||
&[tid='134']{background-color: var(--e-col-134);}
|
||||
&[tid='121']{background-color: var(--e-col-121);}
|
||||
&[tid='125']{background-color: var(--e-col-125);}
|
||||
&[tid='119']{background-color: var(--e-col-119);}
|
||||
&[tid='132']{background-color: var(--e-col-132);}
|
||||
&[tid='122']{background-color: var(--e-col-122);}
|
||||
&[tid='129']{background-color: var(--e-col-129);}
|
||||
&[tid='120']{background-color: var(--e-col-120);}
|
||||
&[tid='130']{background-color: var(--e-col-130);}
|
||||
&[tid='118']{background-color: var(--e-col-118);}
|
||||
&[tid='127']{background-color: var(--e-col-127);}
|
||||
&[tid='133']{background-color: var(--e-col-133);}
|
||||
&[tid='128']{background-color: var(--e-col-128);}
|
||||
&[tid='124']{background-color: var(--e-col-124);}
|
||||
&[tid='116']{background-color: var(--e-col-116);}
|
||||
&[tid='117']{background-color: var(--e-col-117);}
|
||||
&[tid='131']{background-color: var(--e-col-131);}
|
||||
&[tid='126']{background-color: var(--e-col-126);}
|
||||
&[tid='123']{background-color: var(--e-col-123);}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -247,8 +254,60 @@ main[role="main"]{
|
||||
}
|
||||
}
|
||||
}
|
||||
article.node>h2, h2.title{
|
||||
h3.sur-title{
|
||||
@include content_titles;
|
||||
margin:0.9em 0 0;
|
||||
}
|
||||
article.node:not(.node--type-enregistrement)>h2, h2.title{
|
||||
@include content_titles;
|
||||
}
|
||||
article.node.node--type-enregistrement{
|
||||
margin:0.5em 0;
|
||||
>h2{
|
||||
@include document_titles_teaser;
|
||||
}
|
||||
}
|
||||
article.node.node--type-enregistrement.node--view-mode-transcript,
|
||||
article.node.node--type-enregistrement.node--view-mode-article{
|
||||
>h2{
|
||||
@include content_subtitles;
|
||||
margin:0.9em 0 0 0;
|
||||
}
|
||||
html.js &{
|
||||
h3.sur-title{display:none;}
|
||||
}
|
||||
.field--name-field-transcript-vo, .field--name-field-transcript-trad{
|
||||
.field__label{
|
||||
@include content_titles;
|
||||
html.js &{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
&:not(.visible){
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
nav{
|
||||
padding:1em 0 0;
|
||||
div.field__label{
|
||||
@include content_titles;
|
||||
display: inline-block;
|
||||
cursor:pointer;
|
||||
margin-right: 1em;
|
||||
&:before{
|
||||
content: "";
|
||||
display:inline-block;
|
||||
$sq:7px;
|
||||
width: $sq; height:$sq;
|
||||
border: 1px solid red;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
&:hover:before,
|
||||
&.is-active:before{
|
||||
background-color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
article.node p{
|
||||
@include content_courant;
|
||||
@@ -385,7 +444,7 @@ main[role="main"]{
|
||||
.cartel{
|
||||
// TODO: set max-width regarding responsive
|
||||
position: relative;
|
||||
max-width: 350px;
|
||||
// max-width: 350px;
|
||||
margin-left: 1em;
|
||||
background-color: white;
|
||||
opacity: 1;
|
||||
@@ -403,20 +462,18 @@ main[role="main"]{
|
||||
}
|
||||
.cartels{
|
||||
.first-cartel{
|
||||
|
||||
// visibility: hidden;
|
||||
.entrees{
|
||||
line-height: 0;
|
||||
span{
|
||||
@include entrie-micro-square;
|
||||
}
|
||||
@include entree-micro-square;
|
||||
}
|
||||
h2.node-title{
|
||||
margin:0.2em 0 0;
|
||||
font-size: 1em;
|
||||
font-size: 0.9em;
|
||||
font-weight: 600;
|
||||
}
|
||||
p{
|
||||
margin:0;
|
||||
font-size: 0.75em;
|
||||
font-size: 0.756em;
|
||||
}
|
||||
}
|
||||
.second-cartel{
|
||||
@@ -426,27 +483,47 @@ main[role="main"]{
|
||||
height:100%; min-width: 100%;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease-in-out;
|
||||
white-space: nowrap;
|
||||
&>*{
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
white-space: normal;
|
||||
}
|
||||
.col-left{
|
||||
a{
|
||||
display: block;
|
||||
font-size: 0.90em;
|
||||
font-size: 0.82em;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
.col-right{
|
||||
font-size: 0.75em;
|
||||
border-left:1px solid #1A1A1A;
|
||||
margin-left:5px; padding-left:5px;
|
||||
h3{
|
||||
font-size: 0.82em;
|
||||
margin:0;
|
||||
}
|
||||
p{
|
||||
font-size: 0.756em;
|
||||
margin:0;
|
||||
span.cat{
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover{
|
||||
.second-cartel{
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
article:not(.has-second-cartel){
|
||||
.second-cartel{
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -490,7 +567,13 @@ main[role="main"]{
|
||||
text-indent: 0;
|
||||
padding: 0.5em;
|
||||
margin:$s*1.2 0 0 $s*1.2;
|
||||
p{margin: 0;}
|
||||
p{
|
||||
font-size: 0.756em;
|
||||
margin:0;
|
||||
&:not(:last-of-type){
|
||||
margin: 0 0 0.4em 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&:hover{
|
||||
@@ -606,10 +689,7 @@ main[role="main"]{
|
||||
}
|
||||
}
|
||||
.entrees{
|
||||
line-height: 0;
|
||||
span{
|
||||
@include entrie-micro-square;
|
||||
}
|
||||
@include entree-micro-square;
|
||||
}
|
||||
a.audio-link{
|
||||
text-transform: capitalize;
|
||||
@@ -990,17 +1070,18 @@ main[role="main"]{
|
||||
&.ajax-loading{
|
||||
opacity:0.2;
|
||||
}
|
||||
article{
|
||||
article.node{
|
||||
&:first-of-type{
|
||||
margin-top: 1em!important;
|
||||
}
|
||||
.entrees{
|
||||
span{
|
||||
@include entrie-micro-square;
|
||||
}
|
||||
@include entree-micro-square;
|
||||
}
|
||||
h2.node-title{
|
||||
margin:0 0 0.3em 0;
|
||||
font-size: 0.8em;
|
||||
font-weight: 500;
|
||||
text-transform: none;
|
||||
// font-size: 0.8em;
|
||||
// font-weight: 500;
|
||||
// text-transform: none;
|
||||
}
|
||||
// .description{
|
||||
// p{
|
||||
@@ -1647,24 +1728,23 @@ footer{
|
||||
.inner{
|
||||
position: relative;
|
||||
.entrees{
|
||||
span{
|
||||
@include entrie-micro-square;
|
||||
}
|
||||
@include entree-micro-square;
|
||||
}
|
||||
.title{
|
||||
margin:0.3em 0;
|
||||
font-size: 1.2em;
|
||||
font-weight: 500;
|
||||
margin:0.2em 0 0;
|
||||
// margin:0.3em 0;
|
||||
font-size: 0.9em;
|
||||
font-weight: 600;
|
||||
}
|
||||
.description{
|
||||
p{
|
||||
margin:0;
|
||||
font-size: 0.75em;
|
||||
font-size: 0.756em;
|
||||
}
|
||||
}
|
||||
.chutier-icon{
|
||||
position:absolute;
|
||||
top:1em; right:1em;
|
||||
top:0.4em; right:0.4em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,20 @@
|
||||
font-weight: normal;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
@mixin content_courant {
|
||||
font-size: 0.75em;
|
||||
font-weight: normal;
|
||||
|
||||
@mixin document_titles_teaser {
|
||||
font-size: 0.82em;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@mixin content_subtitles {
|
||||
font-size: 0.82em;
|
||||
font-weight: 600;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@mixin content_courant {
|
||||
font-size: 0.82em;
|
||||
font-weight: normal;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\Core\Link;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Template\Attribute;
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
@@ -35,6 +36,11 @@ function edlptheme_preprocess_node(&$vars){
|
||||
$vars['link_attributes'] = new Attribute(array(
|
||||
'data-drupal-link-system-path' => $system_path=='' ? '<front>' : $system_path
|
||||
));
|
||||
|
||||
if($node->bundle() == 'enregistrement' && in_array($vars['view_mode'], ['article','transcript'])){
|
||||
$vars['page'] = true;
|
||||
$vars['sur_title'] = $vars['view_mode'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,58 +170,50 @@ function edlptheme_preprocess_node__enregistrement__compo(&$vars){
|
||||
|
||||
function edlptheme_preprocess_node__enregistrement__player_cartel(&$vars){
|
||||
// dpm($vars);
|
||||
$node = $vars['node'];
|
||||
|
||||
$vars['col_left'] = false;
|
||||
$vars['col_right'] = false;
|
||||
|
||||
// if transcript not empty
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$vars['node']->id()], array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-transcript', 'ajax-link'],
|
||||
'viewmode'=>'transcript'
|
||||
)
|
||||
));
|
||||
$vars['link_transcript'] = array(
|
||||
'#title' => t("Lire le text."),
|
||||
'#type' => 'link',
|
||||
'#url' => $url,
|
||||
'#options'=>array(
|
||||
$transcript = $node->get('field_transcript_vo');
|
||||
if(!$transcript->isEmpty()){
|
||||
$vars['col_left'] = true;
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$node->id()]);
|
||||
$url->setOptions(array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-transcript', 'ajax-link'],
|
||||
'viewmode'=>'transcript',
|
||||
'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
)
|
||||
)
|
||||
);
|
||||
// TODO: refacorize the link generator as following :
|
||||
// $url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term'=>$tid]);
|
||||
// $url->setOptions(array(
|
||||
// 'attributes' => array(
|
||||
// 'class' => ['index-link', 'ajax-link'],
|
||||
// 'viewmode'=>'index',
|
||||
// 'tid'=>$tid,
|
||||
// 'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
// )
|
||||
// ));
|
||||
// $entree['index_link'] = Link::fromTextAndUrl('index', $url);
|
||||
));
|
||||
$vars['link_transcript'] = Link::fromTextAndUrl(t("Lire le text."), $url);
|
||||
}
|
||||
|
||||
// if article not empty
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$vars['node']->id()], array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-article', 'ajax-link'],
|
||||
'viewmode'=>'article'
|
||||
)
|
||||
));
|
||||
$vars['link_article'] = array(
|
||||
'#title' => t("Lire l'article."),
|
||||
'#type' => 'link',
|
||||
'#url' => $url,
|
||||
'#options' => array(
|
||||
'attributes'=>array(
|
||||
$article = $node->get('body');
|
||||
if(!$article->isEmpty()){
|
||||
$vars['col_left'] = true;
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$node->id()]);
|
||||
$url->setOptions(array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-article', 'ajax-link'],
|
||||
'viewmode'=>'article',
|
||||
'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
)
|
||||
)
|
||||
);
|
||||
// if article or transcript
|
||||
$vars['col_left'] = true;
|
||||
));
|
||||
$vars['link_article'] = Link::fromTextAndUrl(t("Lire l'article."), $url);
|
||||
}
|
||||
|
||||
// if
|
||||
$vars['col_right'] = true;
|
||||
// relations (defined in edlp_corpus.module)
|
||||
if(isset($vars['content']['relations'])){
|
||||
// dpm($relations);
|
||||
$vars['col_right'] = true;
|
||||
}
|
||||
|
||||
if($vars['col_left'] || $vars['col_right']){
|
||||
$vars['second_cartel'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -78,6 +78,7 @@
|
||||
node.isSticky() ? 'node--sticky',
|
||||
not node.isPublished() ? 'node--unpublished',
|
||||
view_mode ? 'node--view-mode-' ~ view_mode|clean_class,
|
||||
second_cartel ? 'has-second-cartel',
|
||||
]
|
||||
%}
|
||||
{{ attach_library('classy/node') }}
|
||||
@@ -111,7 +112,7 @@
|
||||
{% endif %}
|
||||
{% if col_right %}
|
||||
<div class="col-right">
|
||||
right colume
|
||||
{{ content.relations }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
@@ -83,12 +83,17 @@
|
||||
{{ attach_library('classy/node') }}
|
||||
<article{{ attributes.addClass(classes) }}>
|
||||
|
||||
{{ title_prefix }}
|
||||
{% if not page %}
|
||||
<h2{{ title_attributes.addClass('node-title') }}>
|
||||
<a href="{{ url }}" rel="bookmark" {{ link_attributes }}>{{ label }}</a>
|
||||
</h2>
|
||||
{% if sur_title %}
|
||||
<h3 class="sur-title">{{ sur_title }}</h3>
|
||||
{% endif %}
|
||||
{{ title_prefix }}
|
||||
<h2{{ title_attributes.addClass('node-title') }}>
|
||||
{% if not page %}
|
||||
<a href="{{ url }}" rel="bookmark" {{ link_attributes }}>{{ label }}</a>
|
||||
{% else %}
|
||||
{{ label }}
|
||||
{% endif %}
|
||||
</h2>
|
||||
{{ title_suffix }}
|
||||
|
||||
{% if display_submitted %}
|
||||
|
||||
@@ -11,7 +11,10 @@ dependencies:
|
||||
- field.field.node.enregistrement.field_genres
|
||||
- field.field.node.enregistrement.field_langues
|
||||
- field.field.node.enregistrement.field_locuteurs
|
||||
- field.field.node.enregistrement.field_nbr_locuteurs
|
||||
- field.field.node.enregistrement.field_son
|
||||
- field.field.node.enregistrement.field_transcript_trad
|
||||
- field.field.node.enregistrement.field_transcript_vo
|
||||
- field.field.node.enregistrement.field_workflow
|
||||
- node.type.enregistrement
|
||||
module:
|
||||
@@ -35,13 +38,18 @@ content:
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
chutier_actions: true
|
||||
field_collectionneurs: true
|
||||
field_description: true
|
||||
field_entrees: true
|
||||
field_genres: true
|
||||
field_langues: true
|
||||
field_locuteurs: true
|
||||
field_nbr_locuteurs: true
|
||||
field_son: true
|
||||
field_transcript_trad: true
|
||||
field_transcript_vo: true
|
||||
field_workflow: true
|
||||
langcode: true
|
||||
links: true
|
||||
relations: true
|
||||
|
||||
@@ -11,6 +11,7 @@ dependencies:
|
||||
- field.field.node.enregistrement.field_genres
|
||||
- field.field.node.enregistrement.field_langues
|
||||
- field.field.node.enregistrement.field_locuteurs
|
||||
- field.field.node.enregistrement.field_nbr_locuteurs
|
||||
- field.field.node.enregistrement.field_son
|
||||
- field.field.node.enregistrement.field_transcript_trad
|
||||
- field.field.node.enregistrement.field_transcript_vo
|
||||
@@ -44,9 +45,11 @@ hidden:
|
||||
field_genres: true
|
||||
field_langues: true
|
||||
field_locuteurs: true
|
||||
field_nbr_locuteurs: true
|
||||
field_son: true
|
||||
field_transcript_trad: true
|
||||
field_transcript_vo: true
|
||||
field_workflow: true
|
||||
langcode: true
|
||||
links: true
|
||||
relations: true
|
||||
|
||||
@@ -52,3 +52,4 @@ hidden:
|
||||
field_workflow: true
|
||||
langcode: true
|
||||
links: true
|
||||
relations: true
|
||||
|
||||
@@ -58,3 +58,4 @@ hidden:
|
||||
field_workflow: true
|
||||
langcode: true
|
||||
links: true
|
||||
relations: true
|
||||
|
||||
@@ -11,6 +11,7 @@ dependencies:
|
||||
- field.field.node.enregistrement.field_genres
|
||||
- field.field.node.enregistrement.field_langues
|
||||
- field.field.node.enregistrement.field_locuteurs
|
||||
- field.field.node.enregistrement.field_nbr_locuteurs
|
||||
- field.field.node.enregistrement.field_son
|
||||
- field.field.node.enregistrement.field_transcript_trad
|
||||
- field.field.node.enregistrement.field_transcript_vo
|
||||
@@ -38,14 +39,17 @@ content:
|
||||
region: content
|
||||
hidden:
|
||||
body: true
|
||||
chutier_actions: true
|
||||
field_collectionneurs: true
|
||||
field_entrees: true
|
||||
field_genres: true
|
||||
field_langues: true
|
||||
field_locuteurs: true
|
||||
field_nbr_locuteurs: true
|
||||
field_son: true
|
||||
field_transcript_trad: true
|
||||
field_transcript_vo: true
|
||||
field_workflow: true
|
||||
langcode: true
|
||||
links: true
|
||||
relations: true
|
||||
|
||||
+3
@@ -11,6 +11,7 @@ dependencies:
|
||||
- field.field.node.enregistrement.field_genres
|
||||
- field.field.node.enregistrement.field_langues
|
||||
- field.field.node.enregistrement.field_locuteurs
|
||||
- field.field.node.enregistrement.field_nbr_locuteurs
|
||||
- field.field.node.enregistrement.field_son
|
||||
- field.field.node.enregistrement.field_transcript_trad
|
||||
- field.field.node.enregistrement.field_transcript_vo
|
||||
@@ -51,9 +52,11 @@ hidden:
|
||||
field_genres: true
|
||||
field_langues: true
|
||||
field_locuteurs: true
|
||||
field_nbr_locuteurs: true
|
||||
field_son: true
|
||||
field_transcript_trad: true
|
||||
field_transcript_vo: true
|
||||
field_workflow: true
|
||||
langcode: true
|
||||
links: true
|
||||
relations: true
|
||||
|
||||
@@ -11,6 +11,7 @@ dependencies:
|
||||
- field.field.node.enregistrement.field_genres
|
||||
- field.field.node.enregistrement.field_langues
|
||||
- field.field.node.enregistrement.field_locuteurs
|
||||
- field.field.node.enregistrement.field_nbr_locuteurs
|
||||
- field.field.node.enregistrement.field_son
|
||||
- field.field.node.enregistrement.field_transcript_trad
|
||||
- field.field.node.enregistrement.field_transcript_vo
|
||||
@@ -45,13 +46,16 @@ content:
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
body: true
|
||||
chutier_actions: true
|
||||
field_collectionneurs: true
|
||||
field_description: true
|
||||
field_entrees: true
|
||||
field_genres: true
|
||||
field_langues: true
|
||||
field_locuteurs: true
|
||||
field_nbr_locuteurs: true
|
||||
field_son: true
|
||||
field_workflow: true
|
||||
langcode: true
|
||||
links: true
|
||||
relations: true
|
||||
|
||||
@@ -11,7 +11,7 @@ id: node.enregistrement.field_transcript_trad
|
||||
field_name: field_transcript_trad
|
||||
entity_type: node
|
||||
bundle: enregistrement
|
||||
label: 'Transcription (Traduction)'
|
||||
label: Traduction
|
||||
description: ''
|
||||
required: false
|
||||
translatable: true
|
||||
|
||||
@@ -11,7 +11,7 @@ id: node.enregistrement.field_transcript_vo
|
||||
field_name: field_transcript_vo
|
||||
entity_type: node
|
||||
bundle: enregistrement
|
||||
label: 'Transcription (Version Originale)'
|
||||
label: Transcription
|
||||
description: ''
|
||||
required: false
|
||||
translatable: false
|
||||
|
||||
Reference in New Issue
Block a user