-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from jwade1327/weekly-am
Create AM Weekly
- Loading branch information
Showing
4 changed files
with
216 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
import { get } from "@parameter1/base-cms-object-path"; | ||
import { parseBooleanHeader } from "@parameter1/base-cms-utils"; | ||
import queryFragment from "@science-medicine-group/package-common/graphql/fragments/content-list"; | ||
import defaultValue from "@parameter1/base-cms-marko-core/utils/default-value"; | ||
|
||
$ const { website, config, req } = out.global; | ||
$ const { newsletter, date } = data; | ||
|
||
$ const emailX = config.get("emailX"); | ||
$ const nativeX = config.getAsObject("nativeX"); | ||
$ const { id, alias, name, pageNode } = input; | ||
|
||
$ const newsletterConfig = config.get(newsletter.alias); | ||
$ const caseBlock = get(newsletterConfig, "caseBlock"); | ||
$ const ctaLinkStyle = defaultValue(newsletterConfig.ctaLinkStyle, undefined); | ||
|
||
$ const resolvedToNodesConverter = ({ resolved }) => (resolved.map((node) => ({ | ||
id: node.ID, | ||
type: 'Case', | ||
shortName: node.name, | ||
teaser: node.description, | ||
siteContext: { url: `https://my.auntminnie.com/cases/${node.url}` }, | ||
primaryImage: { src: node.imagepath } | ||
}))); | ||
|
||
<marko-newsletter-root | ||
title=newsletter.name | ||
description=newsletter.description | ||
date=date | ||
> | ||
<@head> | ||
<common-head-block /> | ||
</@head> | ||
<@body style="padding:0; margin:0;font-family: 'Roboto', Arial, sans-serif; -webkit-text-size-adjust:100%;"> | ||
<common-body-wrapper-block newsletter=newsletter date=date footer=input.footer> | ||
<@body> | ||
|
||
<common-content-list-block | ||
date=date | ||
section-name="Letter from the Editor" | ||
newsletter=newsletter | ||
with-image=true | ||
image-position="right" | ||
with-header=true | ||
continue-reading=true | ||
limit=1 | ||
/> | ||
|
||
<common-content-list-block | ||
date=date | ||
section-name="Radiology News" | ||
newsletter=newsletter | ||
with-image=true | ||
image-position="right" | ||
with-header=true | ||
limit=1 | ||
skip=0 | ||
/> | ||
|
||
<common-content-list-block | ||
date=date | ||
section-name="Radiology News" | ||
newsletter=newsletter | ||
with-image=false | ||
with-section=true | ||
limit=2 | ||
skip=1 | ||
/> | ||
|
||
<!-- Ad Slot 1 --> | ||
<common-ad-wrapper-block | ||
newsletter=newsletter | ||
ad-unit=emailX.getAdUnit({ name: 'ad-slot-1', alias: newsletter.alias }) | ||
date=date | ||
/> | ||
|
||
<common-content-list-block | ||
date=date | ||
section-name="Radiology News" | ||
newsletter=newsletter | ||
with-image=false | ||
with-section=true | ||
limit=11 | ||
skip=3 | ||
/> | ||
|
||
<common-content-list-block | ||
date=date | ||
section-name="Insider" | ||
newsletter=newsletter | ||
with-image=true | ||
image-position="right" | ||
with-header=true | ||
continue-reading=true | ||
limit=1 | ||
/> | ||
|
||
<common-content-list-block | ||
date=date | ||
section-name="Insider" | ||
newsletter=newsletter | ||
with-image=false | ||
with-header=true | ||
continue-reading=true | ||
limit=1 | ||
skip=1 | ||
/> | ||
|
||
<!-- Ad Slot 2 --> | ||
<common-ad-wrapper-block | ||
newsletter=newsletter | ||
promotion-component="advertisement-block" | ||
ad-unit=emailX.getAdUnit({ name: 'ad-slot-2', alias: newsletter.alias }) | ||
date=date | ||
/> | ||
|
||
<common-content-list-block | ||
date=date | ||
section-name="Insider" | ||
newsletter=newsletter | ||
with-image=false | ||
with-section=true | ||
limit=8 | ||
skip=2 | ||
/> | ||
|
||
<if(caseBlock === true)> | ||
<tr> | ||
<td align="center" valign="top"> | ||
<table role="presentation" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="background: #eff1f3;"> | ||
<tr> | ||
<td align="center" valign="middle" height="38"> | ||
<p style="font-size:15px;color: #000000;text-decoration: none;display: block;font-weight:700;font-family:'Roboto', Arial, sans-serif;text-transform: uppercase;padding: 0 24px;"> | ||
Case of the Week | ||
</p> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
<common-table-spacer-element height="24" /> | ||
|
||
<common-ad-wrapper-block | ||
newsletter=newsletter | ||
promotion-component="advertisement-block" | ||
ad-unit=emailX.getAdUnit({ name: 'case-sponsor', alias: newsletter.alias }) | ||
date=date | ||
/> | ||
|
||
<common-external-api-block | ||
api-url="https://my.auntminnie.com/wp-json/mo/v1/getCase/1" | ||
resolved-to-nodes-converter=resolvedToNodesConverter | ||
name="Case of the Week" | ||
description="Check out our Case of the Week!" | ||
button={ link: "https://my.auntminnie.com/cases", text: "View All Cases" } | ||
cta-link-style=ctaLinkStyle | ||
/> | ||
</if> | ||
|
||
<common-content-list-block | ||
date=date | ||
section-name="RADCast" | ||
newsletter=newsletter | ||
with-image=false | ||
with-header=true | ||
with-section=true | ||
limit=10 | ||
/> | ||
|
||
<common-ad-wrapper-block | ||
date=date | ||
newsletter=newsletter | ||
promotion-component="25-for-25-block" | ||
placement-id=get(nativeX, `placements.${newsletter.alias}.sponsored`) | ||
/> | ||
|
||
</@body> | ||
<@footer> | ||
<common-new-footer-block newsletter=newsletter /> | ||
</@footer> | ||
</common-body-wrapper-block> | ||
</@body> | ||
</marko-newsletter-root> |