Skip to content

Commit

Permalink
Merge pull request #666 from middlebury/media-component
Browse files Browse the repository at this point in the history
Media group component
  • Loading branch information
imcbride authored Jan 9, 2025
2 parents 02143a5 + abb5215 commit 0ba3dc2
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/data/image_styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ image_styles:
- 400x225
- 640x360

media_group:
title: Media Group component
ratio: 'any'
srcset:
- 400x225

event_teaser:
title: Event teaser
ratio: 'any'
Expand Down
5 changes: 5 additions & 0 deletions src/scss/_paragraphs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@

.paragraph--two-col-text {
@extend %paragraph-space;

@include breakpoint(lg) {
margin-top: $spacing-8;
margin-bottom: $spacing-8;
}
}

.paragraph--faq {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/paragraphs/audio.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="audio paragraph--audio">
<div class="audio {{ paragraph ? "paragraph--audio": ""}}">
{% if panopto %}
<div class="audio__embed">
<iframe aria-label="Audio player" src="https://midd.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=f9b9f6b5-f52c-40f8-962b-db0b6b214532&v=1" frameborder="0" allowfullscreen allow="autoplay"></iframe>
Expand Down
30 changes: 30 additions & 0 deletions src/templates/paragraphs/media-group.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div class="section paragraph paragraph--expand" data-digest-content>
<div class="paragraphs--wide__offset">
<div class="section__header mb-7 mb-lg-8">
<h2 class="section__title">
{{title}}
</h2>
<p class="section__text">
{{blurb}}
</p>
</div>
</div>

<div class="row">
{% for item in media_content_items %}
<div class="col-md-6 mb-7 {{loop.index % 2 == 0 ? 'pl-lg-4' : 'pr-lg-4'}}">
{% if item == 'video' %}
{% include 'partials/video.twig' %}
{% elseif item == 'audio' %}
{% include 'paragraphs/audio.twig' with {paragraph: false} %}
{% elseif item == 'image' %}
{% if loop.index % 2 == 1 %}<div class="float-md-right">{% endif %}
{% include 'partials/image-with-caption.twig' with {
name: 'media_group',
} %}
{% if loop.index % 2 == 1 %}</div>{% endif %}
{% endif %}
</div>
{% endfor %}
</div>
</div>
15 changes: 13 additions & 2 deletions src/templates/partials/basic-content.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@
</p>
</div>

{% include 'paragraphs/video-group.twig' %}
{% include 'paragraphs/media-group.twig' with {
title: 'Media group',
blurb: 'Lorem ipsum dolor sit, amet consectetur adipisicing elit. Necessitatibus
quam optio ratione labore possimus iusto corrupti vero fugiat explicabo
officiis ex, a sunt obcaecati molestias voluptate eum earum ipsam
accusantium.',
media_content_items: ['video', 'image', 'image', 'audio', 'video']
} %}

{# {% include 'paragraphs/video-group.twig' %} #}

{% include 'paragraphs/status-report.twig' %}

Expand All @@ -51,7 +60,9 @@
{% include 'paragraphs/profile-list.twig' %}

{% if not env.test %}
{% include 'paragraphs/audio.twig' %}
{% include 'paragraphs/audio.twig' with {
paragraph: true
} %}
{% endif %}

{% include 'paragraphs/announcement.twig' %}
Expand Down
2 changes: 1 addition & 1 deletion src/templates/partials/top-level-paragraphs.twig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

{% include 'paragraphs/text-short.twig' %}

{% include 'paragraphs/audio.twig' with { panopto: true } %}
{% include 'paragraphs/audio.twig' with { panopto: true, paragraph: true } %}

{% include 'paragraphs/two-col-text.twig' %}

Expand Down
7 changes: 4 additions & 3 deletions src/templates/school-basic-content.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
{% set theme = 'college' %}

{% set page_header = {
title: 'Korean Immersion Program',
title: 'School basic content',
breadcrumb: [
{ text: 'Korean' },
{ text: 'Offices and Services' },
{ text: 'Student Financial Services' },
]
} %}

Expand All @@ -14,7 +15,7 @@
{% block nav %}

{% include 'partials/page-nav.twig' with {
label: 'Korean',
label: 'Student Financial Services',
items: [
{ text: 'Curriculum', href: '#' },
{
Expand Down
11 changes: 10 additions & 1 deletion src/templates/school-home-schools-abroad.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@

{% include 'paragraphs/school-explorer.twig' %}

{% include 'paragraphs/video-group.twig' %}
{% include 'paragraphs/media-group.twig' with {
title: 'Media group',
blurb: 'Lorem ipsum dolor sit, amet consectetur adipisicing elit. Necessitatibus
quam optio ratione labore possimus iusto corrupti vero fugiat explicabo
officiis ex, a sunt obcaecati molestias voluptate eum earum ipsam
accusantium.',
media_content_items : ['video', 'image', 'image', 'audio', 'video']
} %}

{# {% include 'paragraphs/video-group.twig' %} #}

{% include 'paragraphs/themed-panel.twig' with {
main_title: true,
Expand Down

0 comments on commit 0ba3dc2

Please sign in to comment.