WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 6155497

Browse files
Merge pull request #1107 from torchbox/feature/264-video-display
R1-264: VIDEO DISPLAY | Project Page templates
2 parents 4f3ddb3 + a2ffe07 commit 6155497

File tree

10 files changed

+55
-237
lines changed

10 files changed

+55
-237
lines changed

rca/project_styleguide/templates/patterns/molecules/image-caption-link/image-caption-link.html

Lines changed: 0 additions & 39 deletions
This file was deleted.

rca/project_styleguide/templates/patterns/molecules/image-caption-link/image-caption-link.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

rca/project_styleguide/templates/patterns/molecules/streamfield/blocks/image_block.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
{# Image `alt` used to be optional (now required). We leave the conditional in since images uploaded before the update might have their `alt` blank. #}
1010
<img src="{{ my_image.url }}" width="{{ my_image.width }}" height="{{ my_image.height }}" alt="{% if value.decorative %}{% elif my_image.image.alt %}{{ my_image.image.alt }}{% else %}{{ my_image.image.title }}{% endif %}">
1111
{% if value.caption %}
12-
<p class="image-caption-link">{{ value.caption }}</p>
12+
<p class="image__caption">{{ value.caption }}</p>
1313
{% endif %}
1414
</div>

rca/project_styleguide/templates/patterns/organisms/image-video-block/image-video-block.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2 class="image-video-block__heading heading {% if curriculum %}heading--two{%
1616
<div class="section__row grid">
1717
{% endif %}
1818
{% if image or video %}
19-
{% include "patterns/molecules/image-caption-link/image-caption-link.html" with caption=caption modal=modal %}
19+
{% include "patterns/organisms/image-video-embed/image-video-embed.html" with modal=modal image=image caption=caption video=video %}
2020
{% endif %}
2121
{% if not out_of_grid %}
2222
</div>
Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
{# This is similar to image-video-block. Key difference is that the play button is centered and the caption is below the image. #}
22
{% load wagtailcore_tags wagtailimages_tags %}
33

4-
<div class="image-video-embed">
5-
<div class="image-video-embed__container" {% if modal and video %}data-video-modal{% endif %}>
6-
{% image image fill-80x37 as image_small %}
7-
{% image image fill-900x415 as image_large %}
8-
9-
{% if video %}
10-
<a data-modal-open class="image-video-embed__link" aria-label="Play {{ caption }}" tabindex="0">
4+
<div class="image-video-embed" {% if modal and video %}data-video-modal{% endif %}>
5+
{% image image fill-80x37 as image_small %}
6+
{% image image fill-900x415 as image_large %}
117

8+
{% if video %}
9+
<a data-modal-open class="image-video-embed__link" aria-label="Play {{ caption }}" tabindex="0">
10+
<div class="image-video-embed__image-container">
1211
{% include "patterns/atoms/image/image--lazyload.html" with image_small=image_small width=900 height=415 image_large=image_large classList='image-video-embed__image' %}
13-
12+
1413
<svg class="image-video-embed__play-icon" aria-hidden="true" width="87" height="87" viewBox="0 0 90 85">
1514
<path d="M43.5 0C19.575 0 0 19.575 0 43.5C0 67.425 19.575 87 43.5 87C67.425 87 87 67.425 87 43.5C87 19.575 67.425 0 43.5 0ZM34.8 63.075V23.925L60.9 43.5L34.8 63.075Z" fill="white"/>
1615
<path d="M34.8 23.925V63.075L60.9 43.5L34.8 23.925Z" fill="#FF5D1C"/>
1716
</svg>
18-
19-
{% if caption %}
20-
<p class="image-video-embed__caption">{{ caption }}</p>
21-
{% endif %}
22-
</a>
17+
</div>
18+
19+
{% if caption %}
20+
<p class="image-video-embed__caption">{{ caption }}</p>
21+
{% endif %}
22+
</a>
2323

24-
{% include "patterns/molecules/video-modal/video-modal.html" with open_link=False %}
25-
{% else %}
26-
{% include "patterns/atoms/image/image--lazyload.html" with image_small=image_small width=900 height=415 image_large=image_large classList='image-video-embed__image' %}
27-
{% endif %}
28-
</div>
24+
{% include "patterns/molecules/video-modal/video-modal.html" with open_link=False %}
25+
{% else %}
26+
{% include "patterns/atoms/image/image--lazyload.html" with image_small=image_small width=900 height=415 image_large=image_large classList='image-video-embed__image' %}
27+
{% endif %}
2928
</div>

rca/project_styleguide/templates/patterns/organisms/programme_tabs/programme_overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h3 class="section__heading section__heading--primary heading heading--two">
1616
<h4 class="introduction introduction--end heading heading--five" property="schema:description">{{ page.programme_description_subtitle }}</h4>
1717
{% endif %}
1818
{% if page.programme_image %}
19-
{% include "patterns/organisms/image-video-embed/image-video-embed.html" with modal=page.programme_video image=page.programme_image caption=page.programme_video_caption video=page.programme_video out_of_grid="true" heading=false has_meta=false subheading=false copy=false %}
19+
{% include "patterns/organisms/image-video-embed/image-video-embed.html" with modal=page.programme_video image=page.programme_image caption=page.programme_video_caption video=page.programme_video %}
2020
{% endif %}
2121
<div class="programme-overview__description rich-text">
2222
{{ page.programme_description_copy|safe }}

rca/static_src/sass/components/_image-caption-link.scss

Lines changed: 0 additions & 134 deletions
This file was deleted.

rca/static_src/sass/components/_image-video-embed.scss

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
11
.image-video-embed {
22
$root: &;
3+
grid-column: 1 / span 2;
34
margin-bottom: ($gutter * 2);
45

56
@include media-query(medium) {
67
margin-bottom: ($gutter * 3);
78
}
89

9-
&__container {
10-
grid-column: 1 / span 2;
11-
12-
@include media-query(large) {
13-
grid-column: 2 / span 3;
14-
}
15-
}
16-
17-
&__image {
18-
@include z-index(above-gridlines);
19-
position: relative;
20-
21-
#{$root}__link & {
22-
opacity: 0.8;
23-
24-
@include media-query(medium) {
25-
opacity: 1;
26-
transition: opacity $transition;
27-
28-
#{$root}:hover & {
29-
opacity: 0.8;
30-
}
31-
}
32-
}
10+
@include media-query(large) {
11+
grid-column: 2 / span 3;
3312
}
3413

3514
&__link {
@@ -62,11 +41,33 @@
6241
}
6342
}
6443

44+
&__image-container {
45+
position: relative;
46+
}
47+
48+
&__image {
49+
@include z-index(above-gridlines);
50+
position: relative;
51+
52+
#{$root}__link & {
53+
opacity: 0.8;
54+
55+
@include media-query(medium) {
56+
opacity: 1;
57+
transition: opacity $transition;
58+
59+
#{$root}:hover & {
60+
opacity: 0.8;
61+
}
62+
}
63+
}
64+
}
65+
6566
&__play-icon {
6667
@include z-index(above-gridlines);
6768
position: absolute;
6869
left: 50%;
69-
top: 40%;
70+
top: 50%;
7071
transform: translate3d(-50%, -50%, 0);
7172
pointer-events: none;
7273
height: 50px;
@@ -78,7 +79,6 @@
7879

7980
@include media-query(medium) {
8081
height: 80px;
81-
top: 45%;
8282
width: 80px;
8383
}
8484
}

rca/static_src/sass/components/_image.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,13 @@
3232
}
3333
}
3434
}
35+
36+
&__caption {
37+
margin-bottom: ($gutter * 1.75);
38+
grid-column: 1 / span 2;
39+
40+
@include media-query(large) {
41+
grid-column: 2 / span 3;
42+
}
43+
}
3544
}

rca/static_src/sass/main.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
@import 'components/job-titles';
6767
@import 'components/jump-nav';
6868
@import 'components/image';
69-
@import 'components/image-caption-link';
7069
@import 'components/image-info';
7170
@import 'components/introduction';
7271
@import 'components/intro-and-video';

0 commit comments

Comments
 (0)