Skip to content

Commit

Permalink
Merge pull request #30 from jwade1327/auntminnie
Browse files Browse the repository at this point in the history
Create Auntminnie newsletters
  • Loading branch information
jwade1327 authored Sep 12, 2023
2 parents 96d83a7 + 703734a commit 2416029
Show file tree
Hide file tree
Showing 13 changed files with 402 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/common/components/layouts/case.marko
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ $ const resolvedToNodesConverter = ({ resolved }) => (resolved.map((node) => ({
name="Case of the Week"
description="Check out our Case of the Week!"
button={ link: "https://my.drbicuspid.com/cases", text: "View All Cases" }
native-x={ placementName: 'cases', placementAliases: ['cases'] }
cta-link-style=ctaLinkStyle
/>

Expand Down
3 changes: 3 additions & 0 deletions packages/common/components/layouts/marko.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
},
"<common-case-layout>": {
"template": "./case.marko"
},
"<common-radcast-layout>": {
"template": "./radcast.marko"
}
}
82 changes: 82 additions & 0 deletions packages/common/components/layouts/radcast.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
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 } = input.data;

$ const emailX = config.get("emailX");
$ const nativeX = config.getAsObject("nativeX");
$ const { id, alias, name, pageNode } = input;

<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>
<@body>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=true
image-position="right"
with-section=true
limit=1
skip=0
/>

<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=false
with-section=true
limit=1
skip=1
/>

<!-- Ad Slot 1 -->
<common-ad-wrapper-block
newsletter=newsletter
promotion-component="advertisement-block"
ad-unit=emailX.getAdUnit({ name: 'ad-slot-1', alias: newsletter.alias })
placement-id=get(nativeX, `placements.${newsletter.alias}.slot-1`)
date=date
/>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="Main"
newsletter=newsletter
with-image=false
with-section=true
skip=2
limit=8
/>

<!-- Content list block -->
<common-content-list-block
date=date
section-name="Editor's Note"
newsletter=newsletter
with-image=true
image-position="right"
with-header=true
continue-reading=true
limit=1
/>

</@body>
</common-body-wrapper-block>
</@body>
</marko-newsletter-root>
9 changes: 9 additions & 0 deletions tenants/all/config/brands.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ module.exports = {
],
},
},
am: {
socialMedia: {
imagePath: '/files/base/smg/all/image/static/newsletter',
links: [
{ provider: 'facebook', href: 'https://www.facebook.com/auntminnie.radiology', target: '_blank' },
{ provider: 'twitter', href: 'https://twitter.com/AuntMinnie', target: '_blank' },
],
},
},
sab: {
logo: {
src: '/files/base/smg/all/image/static/sab/sab-logo.svg',
Expand Down
46 changes: 46 additions & 0 deletions tenants/all/config/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,52 @@ const config = {
},
preferenceCenter: 'https://www.drbicuspid.com/user/subscribe',
},
'am-lfte': {
...brands.am,
name: 'AuntMinnie-Letter From The Editor',
logo: {
src: '/files/base/smg/all/image/static/am/auntminnie-LFTE.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnie.com/user/subscribe',
caseBlock: true,
},
'am-breaking-news': {
...brands.am,
name: 'AuntMinnie-Breaking News',
logo: {
src: '/files/base/smg/all/image/static/am/auntminnie-Breaking-News.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnie.com/user/subscribe',
},
'am-community-insider': {
...brands.am,
name: 'AuntMinnie-Community Insider',
logo: {
src: '/files/base/smg/all/image/static/am/auntminnie-Insider.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnie.com/user/subscribe',
},
'am-case-of-the-week': {
...brands.am,
name: 'AuntMinnie-Case of the Week',
logo: {
src: '/files/base/smg/all/image/static/drb/DrB_EmailHeader_CaseOfTheWeek_v3.jpg',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnie.com/user/subscribe',
},
'am-radcast': {
...brands.am,
name: 'AuntMinnie-Radcast',
logo: {
src: '/files/base/smg/all/image/static/am/auntminnie-Radcast.png',
footerWidth: 200,
},
preferenceCenter: 'https://www.auntminnie.com/user/subscribe',
},
};

module.exports = config;
40 changes: 40 additions & 0 deletions tenants/all/config/email-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,46 @@ config
height: 250,
},
])
.setAdUnits('am-lfte', [
{
name: 'ad-slot-1',
id: '647e1b53f89e58ac004ca4f7',
width: 300,
height: 250,
},
])
.setAdUnits('am-community-insider', [
{
name: 'ad-slot-1',
id: '64ff47f8c6835cc9a256a2a0',
width: 300,
height: 250,
},
])
.setAdUnits('am-breaking-news', [
{
name: 'ad-slot-1',
id: '64ff4833d423c961b2f13e27',
width: 300,
height: 250,
},
])
.setAdUnits('am-case-of-the-week', [
{
name: 'ad-slot-1',
id: '64ff4859c6835c815256a320',
width: 300,
height: 250,
},
])
.setAdUnits('am-radcast', [
{
name: 'ad-slot-1',
id: '64ff5929d423c90e3af13ebf',
width: 300,
height: 250,
},
])
.setAdUnits('sab', [
{
name: 'ad-slot-1',
Expand Down
17 changes: 17 additions & 0 deletions tenants/all/config/native-x.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,22 @@ module.exports = {
'drb-case-of-the-week': {
'case-sponsor': '642310db713241000128c421',
},
'am-lfte': {
'slot-1': '647e1c415150cb0001181028',
'case-sponsor': '647e1c36989f4f0001733285',
},
'am-community-insider': {
community: '64ff4d1896af9a00016a8b4f',
'slot-1': '64ff4cfa96af9a00016a8b28',
},
'am-breaking-news': {
'slot-1': '64ff4d3996af9a00016a8bc6',
},
'am-case-of-the-week': {
'case-sponsor': '64ff4c99fd16dd000159e4b7',
},
'am-radcast': {
'slot-1': '64ff595396af9a00016aa6d4',
},
},
};
1 change: 1 addition & 0 deletions tenants/all/templates/am-breaking-news.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-breaking-news-layout data=data />
63 changes: 63 additions & 0 deletions tenants/all/templates/am-case-of-the-week.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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 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>
<@body>

<common-ad-wrapper-block
date=date
newsletter=newsletter
promotion-component="case-native-block"
placement-id=get(nativeX, `placements.${newsletter.alias}.case-sponsor`)
/>

<common-external-api-block
api-url="https://my.auntminnie.com/wp-json/mo/v1/getCase/3"
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
/>

<common-ad-wrapper-block
newsletter=newsletter
promotion-component="advertisement-block"
ad-unit=emailX.getAdUnit({ name: 'ad-slot-1', alias: newsletter.alias })
date=date
/>

</@body>
</common-body-wrapper-block>
</@body>
</marko-newsletter-root>
1 change: 1 addition & 0 deletions tenants/all/templates/am-community-insider.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<common-insider-layout data=data />
Loading

0 comments on commit 2416029

Please sign in to comment.