feat(PublicPage): Extra pictures in media gallery
This commit is contained in:
parent
42232c8df9
commit
2df9ff8f48
4 changed files with 89 additions and 39 deletions
|
@ -94,6 +94,10 @@ let loadMedias = () => {
|
||||||
loadMedias()
|
loadMedias()
|
||||||
|
|
||||||
let openModal = (index) => {
|
let openModal = (index) => {
|
||||||
|
if (index === 'extra') {
|
||||||
|
index = 5
|
||||||
|
}
|
||||||
|
|
||||||
mediaModal.style.visibility = 'visible'
|
mediaModal.style.visibility = 'visible'
|
||||||
mediaModal.style.opacity = 1
|
mediaModal.style.opacity = 1
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,10 @@
|
||||||
|
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
|
.media-mosaic-container {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.media-mosaic {
|
.media-mosaic {
|
||||||
margin-top: .75em;
|
margin-top: .75em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -317,6 +321,25 @@
|
||||||
right: 2em !important;
|
right: 2em !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Extra count
|
||||||
|
**/
|
||||||
|
.media-gallery-extra-count {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
margin-top: .25em;
|
||||||
|
font-size: 0.8em;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-gallery-extra-count a {
|
||||||
|
cursor: pointer;
|
||||||
|
padding: .25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* *****************************************************************************
|
/* *****************************************************************************
|
||||||
|
|
||||||
|
|
|
@ -200,10 +200,12 @@ export default class PublicController {
|
||||||
* Parse gallery
|
* Parse gallery
|
||||||
*/
|
*/
|
||||||
if (Array.isArray(version.gallery)) {
|
if (Array.isArray(version.gallery)) {
|
||||||
version.gallery = version.gallery.slice(0, 5).map((media: any) => {
|
version.gallery = version.gallery.map((media: any) => {
|
||||||
media.isVideo = media.contentType.indexOf('video/') !== -1
|
media.isVideo = media.contentType.indexOf('video/') !== -1
|
||||||
return media
|
return media
|
||||||
})
|
})
|
||||||
|
version.firstGallery = version.gallery.slice(0, 5)
|
||||||
|
version.secondGallery = version.gallery.slice(5)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -45,9 +45,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{% if data.gallery|length > 0 %}
|
<div class="media-mosaic-container">
|
||||||
<div class="media-mosaic mosaic-{{ data.gallery|length }}">
|
{% if data.firstGallery|length > 0 %}
|
||||||
{% for media in data.gallery %}
|
<div class="media-mosaic mosaic-{{ data.firstGallery|length }}">
|
||||||
|
{% for media in data.firstGallery %}
|
||||||
<div
|
<div
|
||||||
class="media-container"
|
class="media-container"
|
||||||
data-video="{{ media.isVideo }}"
|
data-video="{{ media.isVideo }}"
|
||||||
|
@ -66,6 +67,15 @@
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="second-media-gallery" style="display: none;">
|
||||||
|
{% for media in data.secondGallery %}
|
||||||
|
<div
|
||||||
|
class="media-container"
|
||||||
|
data-video="{{ media.isVideo }}"
|
||||||
|
data-location="{{ media.location }}">
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
<div class="media-modal-container" id="media-modal">
|
<div class="media-modal-container" id="media-modal">
|
||||||
<div class="media-modal">
|
<div class="media-modal">
|
||||||
<div class="media-modal-content" id="media-modal-content">
|
<div class="media-modal-content" id="media-modal-content">
|
||||||
|
@ -93,6 +103,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if data.secondGallery|length == 1 %}
|
||||||
|
<div class="media-gallery-extra-count">
|
||||||
|
<a onclick="openModal('extra')">Voir plus ({{ data.secondGallery|length }} photo restante)</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if data.secondGallery|length > 1 %}
|
||||||
|
<div class="media-gallery-extra-count">
|
||||||
|
<a onclick="openModal('extra')">Voir plus ({{ data.secondGallery|length }} photos restantes)</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{# {% if data.descriptionLong|length > 0 %} #}
|
{# {% if data.descriptionLong|length > 0 %} #}
|
||||||
<section>
|
<section>
|
||||||
|
|
Loading…
Reference in a new issue