-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,8 +217,6 @@ html { | |
} | ||
|
||
.home-header { | ||
margin-bottom: 1.5rem; | ||
|
||
&__columns { | ||
flex-direction: row-reverse; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/resources/site/parts/block-gallery/block-gallery.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div data-th-remove="tag"> | ||
<div data-th-if="${!live && !hasContent}"> | ||
<h3>Unconfigured generic gallery part</h3> | ||
</div> | ||
<section data-th-if="${hasContent}" class="section"> | ||
<div class="container"> | ||
<div data-th-replace="/site/snippets/block-gallery.html(d=${data}, s=${settings})" data-th-remove="tag"></div> | ||
</div> | ||
</section> | ||
</div> |
18 changes: 18 additions & 0 deletions
18
src/main/resources/site/parts/block-gallery/block-gallery.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var portal = require('/lib/xp/portal') | ||
var thymeleaf = require('/lib/thymeleaf') | ||
var contentPrep = require('/lib/labs/content-prep.js') | ||
|
||
exports.get = function (req) { | ||
var component = portal.getComponent() | ||
var model = {} | ||
model.data = contentPrep.processBlockGallery(component.config) | ||
model.data.isFullWidth = true | ||
model.live = req.mode == 'live' | ||
model.hasContent = model && model.data && model.data.hasOwnProperty('galleryImages') | ||
var view = resolve('./block-gallery.html') | ||
var body = thymeleaf.render(view, model) | ||
return { | ||
body: body, | ||
contentType: 'text/html', | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/resources/site/parts/block-gallery/block-gallery.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<part> | ||
<display-name i18n="parts.blockGallery">Generic gallery block</display-name> | ||
<form> | ||
<input name="galleryImages" type="ImageSelector"> | ||
<label i18n="txt.images">Images</label> | ||
<occurrences minimum="1" maximum="0"/> | ||
</input> | ||
</form> | ||
</part> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!-- | ||
/* | ||
Gallery block | ||
Wants data in ${data} | ||
*/ | ||
--> | ||
|
||
<div data-th-if="${data.galleryImages}"> | ||
<div class="columns"> | ||
<div class="column" data-th-classappend="${data.isFullWidth} ? 'is-12' : 'is-10-fullhd is-offset-1-fullhd'"> | ||
<div class="columns is-multiline"> | ||
<a | ||
class="gallery column is-one-third" | ||
data-th-each="image: ${data.galleryImages}" | ||
data-th-object="${image}" | ||
data-th-href="*{src}" | ||
data-th-data-pswp-width="*{width}" | ||
data-th-data-pswp-height="*{height}" | ||
> | ||
<figure> | ||
<img | ||
data-th-width="*{width}" | ||
data-th-height="*{height}" | ||
data-th-src="*{placeholderSrc}" | ||
data-th-srcset="*{srcSet}" | ||
data-th-alt-title="*{alt}" | ||
data-th-sizes="${data.isFullWidth} ? | ||
'(max-width:768px) 95vw, (max-width:1087px) 30vw, (max-width:1279px) 301px, (max-width:1471px) 364px, 352px' : | ||
'(max-width:768px) 95vw, (max-width:1087px) 30vw, (max-width:1279px) 301px, (max-width:1471px) 364px, 428px'" | ||
/> | ||
<figcaption | ||
data-th-if="*{caption}" | ||
class="o-block-images__caption pswp-caption-content" | ||
data-th-utext="*{caption}" | ||
> | ||
Caption | ||
</figcaption> | ||
</figure> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters