composer is almost finished, ramins to record compos order through ajax
This commit is contained in:
@@ -28,7 +28,7 @@ function template_preprocess_edlp_chutier_ui(&$vars){
|
||||
// get the title
|
||||
$title = $node->getTitle();
|
||||
if(!$title) continue;
|
||||
$trunc_title = Unicode::truncate($title, 30, true, true);
|
||||
$trunc_title = Unicode::truncate($title, 25, true, true);
|
||||
// classes
|
||||
$classes = array('audio-link', 'ajax-link');
|
||||
// get the entries
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
function template_preprocess_edlp_composition_ui(&$vars){
|
||||
// dpm($vars);
|
||||
/*
|
||||
@see https://www.drupal8.ovh/index.php/en/tutoriels/339/render-a-node-or-an-entity
|
||||
*/
|
||||
// $view_builder = \Drupal::entityTypeManager()->getViewBuilder($vars['entity_type']);
|
||||
// $vars['content'] = $view_builder->view($vars['entity'], $vars['view_mode']);
|
||||
|
||||
|
||||
$view_builder = \Drupal::entityTypeManager()->getViewBuilder('composition');
|
||||
$vars['composition'] = $view_builder->view($vars['lastcomposition']);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ function template_preprocess_edlp_compositions_list(&$vars){
|
||||
'#theme' => 'item_list',
|
||||
'#items' => [],
|
||||
);
|
||||
$i = 0;
|
||||
foreach($vars['composition_entities'] as $entity){
|
||||
// get the url
|
||||
$url = Url::fromRoute('entity.composition.canonical',
|
||||
@@ -27,8 +28,8 @@ function template_preprocess_edlp_compositions_list(&$vars){
|
||||
'#options'=>array(
|
||||
'attributes' => array(
|
||||
'data-drupal-link-system-path' => $url->getInternalPath(),
|
||||
'nid' => $entity->id(),
|
||||
'class' => ['composition-link'],
|
||||
'cid' => $entity->id(),
|
||||
'class' => ['composition-link', $i==0 ? 'is-active':''],
|
||||
'title'=>$title,
|
||||
),
|
||||
),
|
||||
@@ -40,13 +41,14 @@ function template_preprocess_edlp_compositions_list(&$vars){
|
||||
'#options'=>array(
|
||||
'attributes' => array(
|
||||
'data-drupal-link-system-path' => $delete_url->getInternalPath(),
|
||||
'nid' => $entity->id(),
|
||||
'cid' => $entity->id(),
|
||||
'class' => ['delete-composition-link'],
|
||||
'title'=> t('Delete @title', array('@title'=>$title)),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
|
||||
$vars['compositions']['#items'][] = array(
|
||||
|
||||
Reference in New Issue
Block a user