Skip to content

Commit

Permalink
v15-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
enkelmedia committed Dec 14, 2024
1 parent 3a86600 commit 866857d
Show file tree
Hide file tree
Showing 186 changed files with 8,217 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Newsletter Studio V15/Default-Theme/theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "Default",
"backgroundColor": "#F3F3F3",

"selectableColors": "#991BAD,#31D843,#8447FF,#0F2947,#0F2947,#ffffff,#000000",

"rowBackgroundColor": "#ffffff",

"controlButtonBackgroundColor": "#31D843",
"controlButtonTextColor": "#FFFFFF",
"controlButtonFontFamily": "Arial, 'Helvetica Neue', Helvetica, sans-serif",
"controlButtonSmallPadding" : "12px 25px",
"controlButtonSmallFontSize" : "16px",
"controlButtonMediumPadding" : "16px 35px",
"controlButtonMediumFontSize" : "18px",
"controlButtonLargePadding" : "20px 50px",
"controlButtonLargeFontSize" : "20px",

"controlTextTextColor": "#000000",
"controlTextLinkColor": "#8447FF",
"controlTextFontFamily": "Arial, 'Helvetica Neue', Helvetica, sans-serif",
"controlTextFontSize": "16px",

"controlTextHeading1FontFamily": "Arial, 'Helvetica Neue', Helvetica, sans-serif",
"controlTextHeading1FontSize": "32px",

"controlTextHeading2FontFamily": "Arial, 'Helvetica Neue', Helvetica, sans-serif",
"controlTextHeading2FontSize": "28px",

"controlTextHeading3FontFamily": "Arial, 'Helvetica Neue', Helvetica, sans-serif",
"controlTextHeading3FontSize": "24px"

}
75 changes: 75 additions & 0 deletions Newsletter Studio V15/Default-Theme/views/controls/button.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@model NewsletterStudio.Core.Rendering.ViewModels.ControlWithEmailViewModel
@using NewsletterStudio.Core.Extensions;
@using Umbraco.Extensions
@{
var settings = Model.Email.Settings;
}

@if (Model.Model is NewsletterStudio.Core.Editor.Controls.Button.ButtonEmailControlViewModel btn)
{
var textColor = btn.TextColor.IfEmpty(() => settings.ControlButtonTextColor);
var buttonBackground = btn.BackgroundColor.IfEmpty(() => settings.ControlButtonBackgroundColor);

var buttonPadding = settings.Get("controlButton" + btn.ButtonSize.ToFirstUpper() + "Padding");
var buttonFontSize = settings.Get("controlButton" + btn.ButtonSize.ToFirstUpper() + "FontSize");

/*
* CH106
* Padding: We need to set the "lowest" padding on the button as outlook will only apply one padding around the a-tag
* We can set any additional padding on the wrapping td (example below) this would work in outlook as well.
*/

if (!btn.IsInverted)
{
/* Standard Button */
<table>
<tr>
<td>
<table class="button__table" align="@btn.Align">
<tr>
<td class="button__cell"
align="center"
style="background-color: @buttonBackground; mso-padding-alt:@buttonPadding"
bgcolor="@buttonBackground">
<a href="@Html.Raw(btn.ButtonUrl)"
class="button__link"
style="color: @textColor; font-size: @buttonFontSize; text-decoration: none; display: inline-block; padding: @buttonPadding; mso-padding-alt:0px;">
<span class="button__text" style="color: @textColor; text-decoration: none;">@btn.ButtonText</span>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
}
else
{
/* Inverted */
/* We would need the border to be the same color as the background. Will NOT work if we have a background image.*/

<table>
<tr>
<td>
<table class="button__table" align="@btn.Align">
<tr>
<td class="button__cell" align="center"
style="background-color: transparent; border: 2px solid @btn.BackgroundColor; mso-padding-alt: @buttonPadding;"
bgcolor="transparent">

<a href="@Html.Raw(btn.ButtonUrl)"
class="button__link"
style="color: @textColor; font-size: @buttonFontSize; text-decoration: none; display: inline-block; padding: @buttonPadding; mso-padding-alt: 0px;">
<span class="button__text" style="color: @textColor; text-decoration: none;">@btn.ButtonText</span>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>

}

}

26 changes: 26 additions & 0 deletions Newsletter Studio V15/Default-Theme/views/controls/image.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@model NewsletterStudio.Core.Rendering.ViewModels.ControlWithEmailViewModel
@if (Model.Model is NewsletterStudio.Core.Editor.Controls.Image.ImageEmailControlViewModel img)
{
var width = img.ImageIsMaxWidth ? "100%" : img.ImageWidth.ToString();
var styleWidth = img.ImageIsMaxWidth ? "100%" : img.ImageWidth + "px !important";

<table class="block__table">
<tr>
<td align="@img.Align">
@if (!string.IsNullOrEmpty(img.LinkUrl))
{
<a href="@Html.Raw(img.LinkUrl)">
<img src="@Html.Raw(img.ImageUrl)" border="0" alt="" class="img__block" width="@width" style="display: block; max-width: 100%; border: 0px; width: @styleWidth" />
</a>

}
else
{
<img src="@Html.Raw(img.ImageUrl)" border="0" alt="" class="img__block" width="@width" style="display: block; max-width: 100%; width: @styleWidth" />
}
</td>
</tr>
</table>
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@model NewsletterStudio.Core.Rendering.ViewModels.ControlWithEmailViewModel

@if (Model.Model is NewsletterStudio.Core.Editor.Controls.Macro.MacroEmailControlViewModel macro)
{
@Html.Raw(macro.Html)
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@model NewsletterStudio.Core.Rendering.ViewModels.ControlWithEmailViewModel

@if (Model.Model is NewsletterStudio.Core.Editor.Controls.Text.TextEmailControlViewModel model)
{
<div style="color:@(Model.Email.Settings.Get("controlTextTextColor"));">
@Html.Raw(model.Html)
</div>
}

Loading

0 comments on commit 866857d

Please sign in to comment.