-
Notifications
You must be signed in to change notification settings - Fork 554
/
standardContainer.scala.html
66 lines (57 loc) · 2.62 KB
/
standardContainer.scala.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@import com.gu.commercial.branding.Branding
@import common.commercial.ContainerModel
@import common.{Edition, Localisation}
@import views.html.fragments.commercial.containerLogo
@import views.support.RenderClasses
@import conf.switches.Switches.AusRegionSelector
@(containerDefinition: layout.FaciaContainer,
frontProperties: model.FrontProperties,
maybeContainerModel: Option[ContainerModel],
showFrontBranding: Boolean,
frontId: Option[String])(implicit request: RequestHeader)
@containerHeader(containerDefinition, frontProperties)
@if(showFrontBranding) {
@for(commercial <- frontProperties.commercial; frontBranding <- commercial.branding(Edition(request))) {
@containerLogo(frontBranding, isOnTheLeft = true)
}
} else {
@for(containerModel <- maybeContainerModel) {
@for(containerBranding <- containerModel.branding) {
@containerBranding match {
case branding: Branding => { @containerLogo(branding, isOnTheLeft = true) }
case _ => {}
}
}
}
}
@for(containerLayout <- containerDefinition.containerLayout) {
<div class="@RenderClasses(Map(
("fc-container__body", true),
("fc-container--rolled-up-hide", true),
("fc-show-more--hidden", containerDefinition.addShowMoreClasses()),
("js-container--fc-show-more", containerDefinition.addShowMoreClasses()),
("fc-show-more--mobile-only", containerDefinition.hasMobileOnlyShowMore)
))"
data-title="@Localisation(containerDefinition.displayName getOrElse "")"
data-id="@containerDefinition.dataId"
id="container-@containerDefinition.dataId">
@for(sliceWithCards <- containerLayout.slices) {
@slice(sliceWithCards, containerDefinition.index, frontProperties = Some(frontProperties), containerDefinition.displayName, frontId, containerDefinition.isStoryPackage)
}
@if(containerDefinition.hasShowMore && containerDefinition.hasShowMoreEnabled) {
@if(containerDefinition.useShowMore) {
<div class="js-show-more-placeholder"></div>
@showMoreButton(containerDefinition.displayName getOrElse "")
} else {
@* Don't hide any items, for on tag pages, which are chronological *@
@showMore(
containerDefinition.containerLayout.map(_.remainingCards).getOrElse(Nil),
containerDefinition.index
)
}
}
@if(AusRegionSelector.isSwitchedOn && containerDefinition.isAusTargetedTerritory) {
@auTerritorySelector(containerDefinition)
}
</div>
}