Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mundo date revisions & styling adjustments for promo & stat blocks #136

Merged
merged 11 commits into from
Dec 20, 2023
3 changes: 2 additions & 1 deletion packages/common/components/blocks/2024-head.marko
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $ const title = get(newsletterConfig, "title");
.es-button-border { display:inline-block!important }
a.es-button, button.es-button { font-size:18px!important; display:inline-block!important }
.es-adaptive table, .es-left, .es-right { width:100%!important }
es-content table, .es-header table, .es-footer table, .es-content, .es-footer, .es-header {
.es-content table, .es-header table, .es-footer table, .es-content, .es-footer, .es-header {
width:100%!important; max-width:600px!important
}
.es-adapt-td { display:block!important; width:100%!important }
Expand Down Expand Up @@ -157,6 +157,7 @@ $ const title = get(newsletterConfig, "title");
.es-m-p40b { padding-bottom:40px!important }
.es-m-p40r { padding-right:40px!important }
.es-m-p40l { padding-left:40px!important }
.hide-mobile { padding: 0px!important }
}
</style>
</head>
31 changes: 31 additions & 0 deletions packages/common/components/blocks/2024/date-banner-mundo.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { get } from "@parameter1/base-cms-object-path";
import moment from "moment";

$ const { config, i18n } = out.global;
$ const { newsletter, date } = input;

$ const newsletterConfig = config.get(newsletter.alias);
$ const lang = get(newsletterConfig, "lang");
$ const displayDate = (lang) ? moment(date).locale(lang).format("LL") : moment(date).format("LL");

<html-comment> Date Banner START </html-comment>
<tr>
<td align="left" style="padding:0;Margin:0;padding-bottom:20px;padding-top:20px;padding-left:40px;padding-right:40px">
<table cellpadding="0" cellspacing="0" width="100%" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="center" valign="top" style="padding:0;Margin:0;width:560px">
<table cellpadding="0" cellspacing="0" width="100%" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="center" style="padding:0;Margin:0">
<p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
${i18n(displayDate)}
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<html-comment> Date Banner END </html-comment>
4 changes: 2 additions & 2 deletions packages/common/components/blocks/2024/date-banner.marko
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { get } from "@parameter1/base-cms-object-path";
import moment from "moment";

$ const { config, i18n } = out.global;
$ const { config } = out.global;
$ const { newsletter, date } = input;

$ const newsletterConfig = config.get(newsletter.alias);
Expand Down Expand Up @@ -42,7 +42,7 @@ $ const displayDate = (lang) ? moment(date).locale(lang).format("D, YYYY") : mom
<tr>
<td align="center" style="padding:0;Margin:0">
<p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
${i18n(displayDateMonth)}&nbsp;${i18n(displayDate)}
${displayDateMonth}&nbsp;${displayDate}
</p>
</td>
</tr>
Expand Down
62 changes: 62 additions & 0 deletions packages/common/components/blocks/2024/events-mundo.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import queryFragment from "@pmmi-media-group/package-common/graphql/fragments/website-content";

$ const now = Date.now();

$ const queryParams = {
limit: input.limit || 1,
skip: input.skip || 0,
queryFragment,
includeContentTypes: ["Event"],
endingAfter: now,
sort: {
field: "startDate",
order: "asc",
},
};

<tr>
<td align="left" style="Margin:0;padding-bottom:10px;padding-top:20px;padding-left:40px;padding-right:40px">
<table cellpadding="0" cellspacing="0" width="100%" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="center" valign="top" style="padding:0;Margin:0;width:560px">
<table cellpadding="0" cellspacing="0" width="100%" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="left" style="padding:0;Margin:0;padding-bottom:20px;font-size:0px">
<marko-newsletter-imgix
src='/files/base/pmmi/all/image/newsletters/events-mundo.png'
options={ h: 20 }
attrs={ height: 20, height: "auto", style: "display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" }
/>
</td>
</tr>
<marko-web-query|{ nodes }| name="website-scheduled-content" collapsible=false params=queryParams>
<if(nodes.length)>
<for|content| of=nodes>
<tr>
<td align="left" style="padding:0;Margin:0;padding-bottom:5px">
<p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#999999;font-size:14px">
$ const start = new Date(content.startDate);
${start.toLocaleString('es-MX', { day: '2-digit' })} ${start.toLocaleString('es-MX', { month: 'long' })} ${start.getFullYear()} | ${content.city}, ${content.state}
</p>
</td>
</tr>
<tr>
<td align="left" style="padding:0;Margin:0;padding-bottom:20px">
<p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
<strong>
<a href=`${content.website}` target="_blank" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:none;color:#333333;font-size:14px">
${content.name}
</a>
</strong>
</p>
</td>
</tr>
</for>
</if>
</marko-web-query>
</table>
</td>
</tr>
</table>
</td>
</tr>
19 changes: 5 additions & 14 deletions packages/common/components/blocks/2024/events.marko
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,11 @@ $ const queryParams = {
<table cellpadding="0" cellspacing="0" width="100%" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="left" style="padding:0;Margin:0;padding-bottom:20px;font-size:0px">
<if(header==="Mundo")>
<marko-newsletter-imgix
src='/files/base/pmmi/all/image/newsletters/events-mundo.png'
options={ h: 20 }
attrs={ height: 20, height: "auto", style: "display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" }
/>
</if>
<else>
<marko-newsletter-imgix
src='/files/base/pmmi/all/image/newsletters/upcoming-events.png'
options={ h: 20 }
attrs={ height: 20, style: "display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" }
/>
</else>
<marko-newsletter-imgix
src='/files/base/pmmi/all/image/newsletters/upcoming-events.png'
options={ h: 20 }
attrs={ height: 20, style: "display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" }
/>
</td>
</tr>
<marko-web-query|{ nodes }| name="website-scheduled-content" collapsible=false params=queryParams>
Expand Down
6 changes: 6 additions & 0 deletions packages/common/components/blocks/2024/marko.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,11 @@
},
"<common-2024-header-mundo-block>": {
"template": "./header-mundo.marko"
},
"<common-2024-events-mundo-block>": {
"template": "./events-mundo.marko"
},
"<common-2024-date-banner-mundo-block>": {
"template": "./date-banner-mundo.marko"
}
}
18 changes: 11 additions & 7 deletions packages/common/components/blocks/2024/promo.marko
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ $ const imgOptions = {

<if(withImage === true)>
<tr>
<td class="es-m-p10b" align="left" style="Margin:0;padding-top:20px;padding-bottom:20px;padding-left:40px;padding-right:40px">
<!--[if mso]><table style="width:560px" cellpadding="0" cellspacing="0"><tr><td style="width:160px" valign="top"><![endif]-->
<td class="es-m-p0t es-m-p0b" align="left" style="Margin:0;padding-top:20px;padding-bottom:20px;padding-left:40px;padding-right:40px">
<!--[if mso]><table style="width:560px" cellpadding="0" cellspacing="0"><tr><td style="width:96px" valign="top"><![endif]-->
<table class="es-left" cellspacing="0" cellpadding="0" align="left" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left">
<tr>
<td class="es-m-p20b" align="left" style="padding:0;Margin:0;width:160px">
<table width="100%" cellspacing="0" cellpadding="0" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;border-left:1px solid #ffffff;border-right:1px solid #ffffff;border-top:1px solid #ffffff;border-bottom:1px solid #ffffff" role="presentation">
<td class="es-m-p20b" align="left" style="padding:0;Margin:0;width:96px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="center" style=imgAlignment>
<marko-core-obj-value|{ value: image }| obj=content field="primaryImage" as="object">
Expand All @@ -59,8 +59,12 @@ $ const imgOptions = {
</tr>
</table>
</td>
<!--[if mso]></td><td style="width:20px"></td><td style="width:380px" valign="top"><![endif]-->
<td align="left" class="es-m-txt-c" style="padding:0;Margin:0;width:380px">
</tr>
</table>
<!--[if mso]></td><td style="width:20px"></td><td style="width:444px" valign="top"><![endif]-->
<table class="es-right" cellspacing="0" cellpadding="0" align="right" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right">
<tr>
<td align="left" style="padding:0;Margin:0;width:444px">
<table width="100%" cellspacing="0" cellpadding="0" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="left" class="es-m-txt-c" style="padding:0;Margin:0;padding-bottom:10px">
Expand All @@ -71,7 +75,7 @@ $ const imgOptions = {
</tr>
<tr>
<td align="left" class="es-m-txt-c" style="padding:0;Margin:0">
<p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:27px;color:#333333;font-size:14px">
<p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
<u>
<a href=url target="_blank" style="-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;text-decoration:none;color:#333333;font-size:18px">
$!{content.teaser}
Expand Down
25 changes: 13 additions & 12 deletions packages/common/components/blocks/2024/stat.marko
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ $ const queryParams = {
<if(nodes.length)>
<for|content| of=nodes>
<tr>
<td align="left" style="padding:0;Margin:0;padding-top:20px;padding-left:40px;padding-right:40px">
<td align="left" style="Margin:0;padding-bottom:10px;padding-top:20px;padding-left:40px;padding-right:40px">
<table cellpadding="0" cellspacing="0" width="100%" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="center" valign="top" style="padding:0;Margin:0;width:560px">
<td align="left" valign="top" style="padding:0;Margin:0;width:560px">
<table cellpadding="0" cellspacing="0" width="100%" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="left" style="padding:0;Margin:0;font-size:0px">
<if(header==="Mundo")>
<marko-newsletter-imgix
src='/files/base/pmmi/all/image/newsletters/stat-of-the-day-mundo.png'
options={ h: 20 }
attrs={ height: 20, height: "auto", style: "display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" }
attrs={ height: 20, height: "auto" }
/>
</if>
<else>
<marko-newsletter-imgix
src='/files/base/pmmi/all/image/newsletters/stat.png'
options={ h: 20 }
attrs={ height: 20, height: "auto", style: "display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" }
attrs={ height: 20, height: "auto" }
/>
</else>
</td>
Expand All @@ -45,21 +45,21 @@ $ const queryParams = {
</td>
</tr>
<tr>
<td align="left" style="Margin:0;padding-bottom:10px;padding-left:40px;padding-right:40px">
<td align="left" style="Margin:0;padding-top:10px;padding-bottom:10px;padding-left:40px;padding-right:40px">
<!--[if mso]><table style="width:560px" cellpadding="0" cellspacing="0"><tr><td style="width:120px" valign="top"><![endif]-->
<table cellpadding="0" cellspacing="0" class="es-left" align="left" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left">
<table cellpadding="0" cellspacing="0" class="es-left" align="left" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:left">
<tr>
<td class="es-m-p20b" align="left" style="padding:0;Margin:0;width:120px">
<table cellpadding="0" cellspacing="0" width="100%" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="center" style="padding:0;Margin:0;font-size:0px">
<td align="center" class="hide-mobile" style="padding-bottom:10px;Margin:0;font-size:0px">
<marko-core-obj-value|{ value: image }| obj=content field="primaryImage" as="object">
<marko-newsletter-imgix
src=image.src
alt=image.alt
options={ w: 120 }
class="adapt-img"
attrs={ width: 120, style: "padding-top:20px;display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic" }
attrs={ width: 120, style:"display:block;border:0;outline:none;text-decoration:none;-ms-interpolation-mode:bicubic"}
/>
</marko-core-obj-value>
</td>
Expand All @@ -68,22 +68,23 @@ $ const queryParams = {
</td>
</tr>
</table>
<!-- [if mso]></td><td style="width:20px"></td><td style="width:420px" valign="top"><![endif] -->
<table cellpadding="0" cellspacing="0" class="es-right" align="right" role="none" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right">
<!--[if mso]></td><td style="width:20px"></td><td style="width:420px" valign="top"><![endif]-->
<table cellpadding="0" cellspacing="0" class="es-right" align="right" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right">
<tr>
<td align="left" style="padding:0;Margin:0;width:420px">
<table cellpadding="0" cellspacing="0" width="100%" role="presentation" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
<tr>
<td align="left" style="padding:0;Margin:0">
<p style="Margin:0;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;mso-line-height-rule:exactly;font-family:arial, 'helvetica neue', helvetica, sans-serif;line-height:21px;color:#333333;font-size:14px">
<strong>$!{content.body}</strong>
<strong>${content.name}</strong>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table><!--[if mso]></td></tr></table><![endif]-->
</table>
<!--[if mso]></td></tr></table><![endif]-->
</td>
</tr>
</for>
Expand Down
4 changes: 2 additions & 2 deletions packages/common/components/layouts/2024-mundo.marko
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $ const emailX = config.get('emailX');
<td align="center" style="padding:0;Margin:0">
<table class="es-content-body" cellspacing="0" cellpadding="0" bgcolor="#ffffff" align="center" style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;background-color:#FFFFFF;width:640px">

<common-2024-date-banner-block newsletter=newsletter date=date />
<common-2024-date-banner-mundo-block newsletter=newsletter date=date />

<common-2024-divider-block />

Expand Down Expand Up @@ -139,7 +139,7 @@ $ const emailX = config.get('emailX');
<common-2024-divider-block />

<html-comment> Upcoming Events START </html-comment>
<common-2024-events-block header="Mundo" limit=3 />
<common-2024-events-mundo-block newsletter=newsletter date=date limit=3 />
<html-comment> Upcoming Events END </html-comment>

<common-2024-divider-block />
Expand Down
Loading