Skip to content

Commit

Permalink
Update publication landing to show basic heirarchy layout [PUB-206]
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiltri committed Jul 12, 2024
1 parent d9599f6 commit a495638
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 71 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<{{ $tag ?? 'li' }} class="m-listing m-listing--article{{ (isset($variation)) ? ' '.$variation : '' }}"{!! (isset($variation) and strrpos($variation, "--hero") > -1 and !$item->videoFront) ? ' data-behavior="blurMyBackground"' : '' !!}>
<a href="{!! route(($module ?? 'articles') .'.show', $item) !!}" class="m-listing__link"{!! (isset($gtmAttributes)) ? ' '.$gtmAttributes.'' : '' !!}>
<a href="{!! route(($module ?? 'articles') .'.show', ($routeParameters ?? $item)) !!}" class="m-listing__link"{!! (isset($gtmAttributes)) ? ' '.$gtmAttributes.'' : '' !!}>
@if (!isset($hideImage) || (isset($hideImage) && !($hideImage)))
<span class="m-listing__img{{ (isset($imgVariation)) ? ' '.$imgVariation : '' }}{{ ($item->videoFront) ? ' m-listing__img--video' : '' }}"{{ (isset($variation) and strrpos($variation, "--hero") > -1 and !$item->videoFront) ? ' data-blur-img' : '' }}>
@if (isset($image) || $item->imageFront('hero'))
Expand All @@ -14,7 +14,7 @@
@slot('settings', $imageSettings ?? '')
@slot('class', 'img-hero-mobile')
@endcomponent
@else
@else
@component('components.atoms._img')
@slot('image', $image ?? $item->imageFront('hero'))
@slot('settings', $imageSettings ?? '')
Expand Down
98 changes: 29 additions & 69 deletions resources/views/site/digitalPublicationDetail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,83 +41,43 @@
</div>
@endif

@if ($item->present()->hasArticles(DigitalPublicationArticleType::Contributions->value))
@foreach ($item->present()->topLevelArticles() as $topLevelArticle)
@component('components.molecules._m-title-bar', [
'variation' => 'm-title-bar--compact m-title-bar--light',
])
{{ DigitalPublicationArticleType::Contributions->name }}
{!! $topLevelArticle->title !!}
@endcomponent

@component('components.organisms._o-grid-listing')
@slot('variation', 'o-grid-listing--journal')
@slot('cols_xsmall','1')
@slot('cols_small','2')
@slot('cols_medium','2')
@slot('cols_large','2')
@slot('cols_xlarge','2')
@foreach ($item->present()->getArticles(DigitalPublicationArticleType::Contributions->value) as $article)
@component('components.molecules._m-listing----publication')
@slot('variation', 'm-listing--journal')
@slot('href', $article->present()->getArticleUrl($item))
@slot('image', $article->imageFront('hero'))
@slot('type', $article->present()->label)
@slot('title', $article->present()->title)
@slot('title_display', $article->present()->title_display)
@slot('list_description', $article->present()->list_description)
@slot('author_display', $article->showAuthors())
@slot('imageSettings', array(
'fit' => 'crop',
'ratio' => '16:9',
'srcset' => array(200,400,600),
'sizes' => ImageHelpers::aic_imageSizes(array(
'xsmall' => '216px',
'small' => '216px',
'medium' => '18',
'large' => '13',
'xlarge' => '13',
)),
))
@endcomponent
@slot('variation', 'o-grid-listing--single-row o-grid-listing--scroll@xsmall o-grid-listing--scroll@small o-grid-listing--scroll@medium o-grid-listing--gridlines-cols')
@slot('cols_medium','3')
@slot('cols_large','4')
@slot('cols_xlarge','4')

@foreach ($topLevelArticle->children as $article)
@if ($loop->iteration <= 3)
@component('components.molecules._m-listing----article')
@slot('imgVariation','')
@slot('item', $article)
@slot('module', 'collection.publications.digital-publications-articles')
@slot('routeParameters', ['pubId' => $item->id, 'pubSlug' => $item->getSlug(), 'id' => $article->id])
@slot('imageSettings', array(
'fit' => 'crop',
'ratio' => '16:9',
'srcset' => array(200,400,600),
'sizes' => ImageHelpers::aic_imageSizes(array(
'xsmall' => '216px',
'small' => '216px',
'medium' => '18',
'large' => '13',
'xlarge' => '13',
)),
))
@endcomponent
@endif
@endforeach
@endcomponent
@endif

@if ($item->present()->hasArticles(DigitalPublicationArticleType::Works->value))
@component('components.molecules._m-title-bar', [
'variation' => 'm-title-bar--compact m-title-bar--light',
])
{{ DigitalPublicationArticleType::Works->name }}
@endcomponent

@component('components.organisms._o-grid-listing')
@slot('variation', 'o-grid-listing--journal')

@foreach ($item->present()->getArticles(DigitalPublicationArticleType::Works->value) as $article)
@component('components.molecules._m-listing----publication')
@slot('variation', 'm-listing--work')
@slot('href', $article->present()->getArticleUrl($item))
@slot('image', $article->imageFront('hero'))
@slot('type', $article->present()->label)
@slot('title', $article->present()->title)
@slot('title_display', $article->present()->title_display)
@slot('list_description', $article->present()->list_description)
@slot('author_display', $article->showAuthors())
@slot('imageSettings', array(
'fit' => 'crop',
'ratio' => '16:9',
'srcset' => array(200,400,600),
'sizes' => ImageHelpers::aic_imageSizes(array(
'xsmall' => '216px',
'small' => '216px',
'medium' => '18',
'large' => '13',
'xlarge' => '13',
)),
))
@endcomponent
@endforeach
@endcomponent
@endif
@endforeach

@if (isset($item->sponsor_display))
@component('components.molecules._m-title-bar', [
Expand Down

0 comments on commit a495638

Please sign in to comment.