-
Notifications
You must be signed in to change notification settings - Fork 564
/
Copy pathmain.scala.html
95 lines (79 loc) · 3.48 KB
/
main.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@(projectName: Option[String] = None)(head: Html)(body: Html)(implicit page: model.Page, request: RequestHeader, context: model.ApplicationContext)
@import common.{Edition, commercial}
@import model.Page.getContent
@import views.support.{Commercial, RenderClasses}
@import play.api.Mode.Dev
@headerAndTopAds(showAdverts: Boolean, edition: Edition, content: Option[model.ContentType]) = {
@if(!page.metadata.shouldHideHeaderAndTopAds) {
@defining(showAdverts && !content.exists(_.tags.isTheMinuteArticle) && !Commercial.isAdFree(request)) { showTopSlot =>
<div id="bannerandheader">
@if(showTopSlot) {
@fragments.commercial.topBanner()
}
@fragments.header()
</div>
<div id="maincontent" tabindex="0"></div>
}
}
}
<!DOCTYPE html>
<html id="js-context" class="js-off is-not-modern id--signed-out" lang="en" data-page-path="@request.path">
<head>
@fragments.head(projectName, head)
</head>
@defining(getContent(page), Commercial.shouldShowAds(page), Edition(request)) { case (content, showAdverts, edition) =>
<body
id="top"
class="@RenderClasses(Map(
("has-page-skin", page.metadata.hasPageSkin(request) && showAdverts),
("childrens-books-site", page.metadata.sectionId == "childrens-books-site"),
("has-super-sticky-banner", false),
("is-immersive", content.exists(_.content.isImmersive)),
("is-hosted-content", page.metadata.isHosted),
("is-immersive-interactive", content.exists(content => content.tags.isInteractive && content.content.isImmersive))))"
itemscope itemtype="http://schema.org/WebPage">
<a class="u-h skip" href="#maincontent" data-link-name="skip : main content">Skip to main content</a>
@if(page.metadata.hasPageSkin(request)) {
@fragments.commercial.pageSkin()
}
@if(!page.metadata.isFront && page.metadata.hasSurveyAd(request)) {
@fragments.commercial.survey()
}
@page match {
case page: commercial.hosted.HostedPage => {}
case _ => {
@headerAndTopAds(showAdverts, edition, content)
}
}
@body
@**********************
24x7 support training
We intentionally modified the displayed section on this specific article.
This is a failure that trainees have to diagnose in frontend.
************************@
@if(request.path == "/info/2015/mar/11/-removed-article") {
<script type="text/javascript">
document.querySelectorAll('[data-link-name="article section"]')[0].textContent = "Culture"
@***
The following is a misdirection to let people think damned CAPI is causing the issue
***@
console.log("Error connecting to content API to retrieve section: 503")
console.log("Defaulting to Culture")
</script>
}
@fragments.footer()
@fragments.message()
@fragments.inlineJSNonBlocking()
@fragments.analytics.base()
</body>
@if(context.environment.mode == Dev) {
<script>
if (window.callPhantom) {
setTimeout(function() {
window.callPhantom('takeShot');
}, 10000); // Wait arbitrary 10 seconds before taking the screenshot to let things settled down
}
</script>
}
</html>
}