From 75bad97b10b310d155f66480db78803ddc3e79bd Mon Sep 17 00:00:00 2001 From: "Fred. P" Date: Wed, 16 May 2018 14:05:07 +0200 Subject: [PATCH] Newsletter template thumbnail redesign Redesigned the template selection screen to look like the WordPress theme selector. The main changes relate to: * style changes, to achieve the new look * jsx templates, to work with new css changes * template, removed the description field [MAILPOET-1306] --- assets/css/src/box.styl | 143 +++++++++++++----- assets/img/preview_magnifying_glass.svg | 12 -- .../src/newsletter_editor/components/save.js | 24 +-- assets/js/src/newsletters/templates.jsx | 2 - .../newsletters/templates/template_box.jsx | 21 +-- assets/js/src/newsletters/types.jsx | 2 +- lib/Config/Migrator.php | 1 - .../PopulatorData/Templates/AppWelcome.php | 1 - .../PopulatorData/Templates/BurgerJoint.php | 1 - .../Templates/ChocolateStore.php | 1 - .../PopulatorData/Templates/CoffeeShop.php | 1 - .../PopulatorData/Templates/Discount.php | 1 - lib/Config/PopulatorData/Templates/Faith.php | 1 - .../PopulatorData/Templates/FestivalEvent.php | 1 - .../PopulatorData/Templates/FoodBox.php | 1 - .../PopulatorData/Templates/KickOff.php | 1 - .../PopulatorData/Templates/NewsDay.php | 1 - .../Templates/NewsletterBlank121Column.php | 1 - .../Templates/NewsletterBlank12Column.php | 1 - .../Templates/NewsletterBlank13Column.php | 1 - .../Templates/NewsletterBlank1Column.php | 1 - .../PopulatorData/Templates/PieceOfCake.php | 1 - .../PostNotificationsBlank1Column.php | 1 - .../PopulatorData/Templates/ScienceWeekly.php | 1 - lib/Config/PopulatorData/Templates/Shoes.php | 1 - .../PopulatorData/Templates/SimpleText.php | 1 - .../PopulatorData/Templates/TakeAHike.php | 1 - .../PopulatorData/Templates/TravelNomads.php | 1 - .../Templates/WelcomeBlank12Column.php | 1 - .../Templates/WelcomeBlank1Column.php | 1 - .../PopulatorData/Templates/WorldCup.php | 1 - .../PopulatorData/Templates/YogaStudio.php | 1 - .../acceptance/ManageSubscriptionLinkCest.php | 2 +- .../API/JSON/v1/NewsletterTemplatesTest.php | 7 +- tests/unit/Models/NewsletterTemplateTest.php | 9 -- views/newsletter/editor.html | 1 - .../newsletter/templates/components/save.hbs | 1 - views/newsletters.html | 2 +- 38 files changed, 121 insertions(+), 131 deletions(-) delete mode 100644 assets/img/preview_magnifying_glass.svg diff --git a/assets/css/src/box.styl b/assets/css/src/box.styl index 53bc092965..374e80b5c0 100644 --- a/assets/css/src/box.styl +++ b/assets/css/src/box.styl @@ -1,7 +1,8 @@ $box-width = 425px $box-height = 150px -$thumbnail-width = $box-height -$thumbnail-height = $thumbnail-width +$thumbnail-height = $box-height * 2 +$box-margin-big = 40px +$box-margin-small = 20px $box-description-space-between-heading-and-paragraph = 5px $box-description-height = 110px $box-description-text-height = $box-description-height - $box-description-space-between-heading-and-paragraph @@ -23,51 +24,127 @@ $box-description-font-size = $box-description-line-height border: 1px solid #dedede background-color: #fff +.mailpoet_boxes .mailpoet_template_boxes + box-sizing: border-box + height: auto + margin: 0 0 $box-margin-big + padding: 0 + width: 30.5% + + @media screen and (max-width 1178px) + width: 47% + + @media screen and (max-width 520px) + width: 90% + +@media screen and (min-width 1179px) + .mailpoet_boxes .mailpoet_template_boxes:nth-child(3n-1) + margin: 0 $box-margin-big $box-margin-big $box-margin-big + +@media screen and (max-width 1178px) + .mailpoet_boxes .mailpoet_template_boxes:nth-child(2n-1) + margin: 0 $box-margin-big $box-margin-big 0 + +@media screen and (max-width 782px) + .mailpoet_boxes .mailpoet_template_boxes:nth-child(2n-1) + margin: 0 $box-margin-small $box-margin-small 0 + +@media screen and (max-width 520px) + .mailpoet_boxes .mailpoet_template_boxes:nth-child(1n) + margin: 0 0 $box-margin-small $box-margin-small + +.mailpoet_boxes .mailpoet_template_boxes .mailpoet_description + background: #fafafa + border-top: 1px solid #e1e1e1 + padding: 12px 5% + width: 90% + +.mailpoet_boxes .mailpoet_template_boxes .mailpoet_description h3 + font-size: 15px + font-weight: 600 + line-height: 20px + margin: 0 + white-space: nowrap + max-width: 100% + +.mailpoet_boxes .mailpoet_template_boxes .mailpoet_actions + background: #f5f5f5 + border-top: 1px solid#d6d6d6 + border-left: 1px solid #e8e8e8 + padding: 8px 16px + bottom: 0px + right: 0px + + @media screen and (max-width 782px) + padding: 6px 16px 2px + .mailpoet_boxes .mailpoet_thumbnail background-color: #222 background-size: 50% 50% background-repeat: no-repeat background-position: center color: #222 + border: 0 + width: 100% + height: $thumbnail-height + float: left + overflow: hidden + position: relative + + img + min-width: $thumbnail-height + height: auto + width: 100% + +.mailpoet_boxes .mailpoet_newsletter_types .mailpoet_thumbnail border: 1px solid #ccc - width: $thumbnail-height - height: $thumbnail-width + width: $box-height + height: $box-height margin-right: 15px float: left overflow: hidden position: relative img - min-width: $thumbnail-width - height: auto + min-width: $box-height width: 110% position: relative top: 50% left: 50% transform: translate(-50%, -50%) - .mailpoet_overlay - position: absolute - top: 0 - left: 0 - right: 0 - bottom: 0 - background-color: rgba(255, 255, 255, 0.0) - opacity: 0 - transition: all 250ms cubic-bezier(0.420, 0.000, 0.580, 1.000) /* ease-in-out */ +.mailpoet_overlay + position: absolute + top: 0 + left: 0 + right: 0 + bottom: 0 + background-color: rgba(255, 255, 255, 0.0) + opacity: 0 + transition: all 250ms cubic-bezier(0.420, 0.000, 0.580, 1.000) /* ease-in-out */ - &:hover - background-color: rgba(255, 255, 255, 0.7) - opacity: 1 + &:hover + background-color: rgba(255, 255, 255, 0.7) + opacity: 1 - &::after - content: " " - position: absolute - top: 0 - left: 0 - bottom: 0 - right: 0 - background: url(../img/preview_magnifying_glass.svg) no-repeat center center +.mailpoet_overlay .mailpoet_more_details + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + /* opacity: 0; */ + position: absolute; + top: 35%; + right: 20%; + left: 20%; + background: #23282d; + background: rgba(0,0,0,.7); + color: #fff; + font-size: 15px; + text-shadow: 0 1px 0 rgba(0,0,0,.6); + -webkit-font-smoothing: antialiased; + font-weight: 600; + padding: 15px 12px; + text-align: center; + border-radius: 3px; + transition: opacity .1s ease-in-out; .mailpoet_boxes .mailpoet_description float:left @@ -96,18 +173,14 @@ $box-description-font-size = $box-description-line-height right: 15px .mailpoet_boxes .mailpoet_delete - display: none - position: absolute - top: 15px - right: 15px - -.mailpoet_boxes li:hover .mailpoet_delete - display: block + margin-right: 6px .mailpoet_boxes .mailpoet_delete a - color:#a00 + color:inherit + text-decoration: none + .mailpoet_boxes .mailpoet_delete a:hover - color:red + color:inherit // newsletters: types [data-type="notification"] .mailpoet_thumbnail diff --git a/assets/img/preview_magnifying_glass.svg b/assets/img/preview_magnifying_glass.svg deleted file mode 100644 index fd9122e58f..0000000000 --- a/assets/img/preview_magnifying_glass.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/assets/js/src/newsletter_editor/components/save.js b/assets/js/src/newsletter_editor/components/save.js index 2348906bfc..5011094f90 100644 --- a/assets/js/src/newsletter_editor/components/save.js +++ b/assets/js/src/newsletter_editor/components/save.js @@ -163,7 +163,6 @@ define([ }, saveAsTemplate: function () { var templateName = this.$('.mailpoet_save_as_template_name').val(); - var templateDescription = this.$('.mailpoet_save_as_template_description').val(); var that = this; if (templateName === '') { @@ -174,18 +173,9 @@ define([ scroll: true } ); - } else if (templateDescription === '') { - MailPoet.Notice.error( - MailPoet.I18n.t('templateDescriptionMissing'), - { - positionAfter: that.$el, - scroll: true - } - ); } else { Module.saveTemplate({ - name: templateName, - description: templateDescription + name: templateName }).then(function () { MailPoet.Notice.success( MailPoet.I18n.t('templateSaved'), @@ -218,7 +208,6 @@ define([ }, exportTemplate: function () { var templateName = this.$('.mailpoet_export_template_name').val(); - var templateDescription = this.$('.mailpoet_export_template_description').val(); var that = this; if (templateName === '') { @@ -229,18 +218,9 @@ define([ scroll: true } ); - } else if (templateDescription === '') { - MailPoet.Notice.error( - MailPoet.I18n.t('templateDescriptionMissing'), - { - positionAfter: that.$el, - scroll: true - } - ); } else { Module.exportTemplate({ - name: templateName, - description: templateDescription + name: templateName }); this.hideExportTemplate(); } diff --git a/assets/js/src/newsletters/templates.jsx b/assets/js/src/newsletters/templates.jsx index 9af2a5da8b..401b7c12f2 100644 --- a/assets/js/src/newsletters/templates.jsx +++ b/assets/js/src/newsletters/templates.jsx @@ -70,8 +70,6 @@ class NewsletterTemplates extends React.Component { { name: MailPoet.I18n.t('mailpoetGuideTemplateTitle'), - description: - MailPoet.I18n.t('mailpoetGuideTemplateDescription'), categories: '["welcome", "notification", "standard"]', readonly: '1', }, diff --git a/assets/js/src/newsletters/templates/template_box.jsx b/assets/js/src/newsletters/templates/template_box.jsx index 69cbf35396..0ea5baf3f7 100644 --- a/assets/js/src/newsletters/templates/template_box.jsx +++ b/assets/js/src/newsletters/templates/template_box.jsx @@ -95,10 +95,10 @@ class TemplateBox extends React.Component { } render() { - const { index, name, thumbnail, description, readonly } = this.props; + const { index, name, thumbnail, readonly } = this.props; const deleteLink = ( -
+
{MailPoet.I18n.t('delete')}
); @@ -108,30 +108,25 @@ class TemplateBox extends React.Component { preview = ( {MailPoet.I18n.t('templatePreview')} -
+
+

{MailPoet.I18n.t('zoom')}

+
); } return ( -
  • +
  • { preview }

    { name }

    -

    { description }

    - {MailPoet.I18n.t('preview')} -   + { readonly === '1' ? false : deleteLink } {MailPoet.I18n.t('select')}
    - { readonly === '1' ? false : deleteLink }
  • ); } @@ -151,7 +145,6 @@ TemplateBox.propTypes = { id: PropTypes.string.isRequired, newsletterId: PropTypes.string.isRequired, name: PropTypes.string.isRequired, - description: PropTypes.string.isRequired, thumbnail: PropTypes.string.isRequired, readonly: PropTypes.string.isRequired, beforeDelete: PropTypes.func.isRequired, diff --git a/assets/js/src/newsletters/types.jsx b/assets/js/src/newsletters/types.jsx index aaf2f89de8..84cb328afd 100644 --- a/assets/js/src/newsletters/types.jsx +++ b/assets/js/src/newsletters/types.jsx @@ -130,7 +130,7 @@ const NewsletterTypes = React.createClass({
      {types.map(type => ( -
    • +
    • {type.thumbnailImage ? : null} diff --git a/lib/Config/Migrator.php b/lib/Config/Migrator.php index d1d771dd94..694f5ece51 100644 --- a/lib/Config/Migrator.php +++ b/lib/Config/Migrator.php @@ -247,7 +247,6 @@ class Migrator { 'newsletter_id int NULL DEFAULT 0,', 'name varchar(250) NOT NULL,', 'categories varchar(250) NOT NULL DEFAULT "[]",', - 'description varchar(250) NOT NULL,', 'body LONGTEXT,', 'thumbnail LONGTEXT,', 'readonly TINYINT(1) DEFAULT 0,', diff --git a/lib/Config/PopulatorData/Templates/AppWelcome.php b/lib/Config/PopulatorData/Templates/AppWelcome.php index 18732b85c6..9f9fa268cd 100644 --- a/lib/Config/PopulatorData/Templates/AppWelcome.php +++ b/lib/Config/PopulatorData/Templates/AppWelcome.php @@ -15,7 +15,6 @@ class AppWelcome { function get() { return array( 'name' => __("App Welcome", 'mailpoet'), - 'description' => __("A welcome email template for your app.", 'mailpoet'), 'categories' => json_encode(array('welcome', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/BurgerJoint.php b/lib/Config/PopulatorData/Templates/BurgerJoint.php index 0031a3b32d..2ec98b0978 100644 --- a/lib/Config/PopulatorData/Templates/BurgerJoint.php +++ b/lib/Config/PopulatorData/Templates/BurgerJoint.php @@ -15,7 +15,6 @@ class BurgerJoint { function get() { return array( 'name' => __("Burger Joint", 'mailpoet'), - 'description' => __("Add more or less ketchup or mayo to this restaurant template.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/ChocolateStore.php b/lib/Config/PopulatorData/Templates/ChocolateStore.php index d8d28b1d45..3bccda5529 100644 --- a/lib/Config/PopulatorData/Templates/ChocolateStore.php +++ b/lib/Config/PopulatorData/Templates/ChocolateStore.php @@ -15,7 +15,6 @@ class ChocolateStore { function get() { return array( 'name' => __("Chocolate Store", 'mailpoet'), - 'description' => __("A classy black store template.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/CoffeeShop.php b/lib/Config/PopulatorData/Templates/CoffeeShop.php index 8a251475e3..1689a16082 100644 --- a/lib/Config/PopulatorData/Templates/CoffeeShop.php +++ b/lib/Config/PopulatorData/Templates/CoffeeShop.php @@ -15,7 +15,6 @@ class CoffeeShop { function get() { return array( 'name' => __("Coffee Shop", 'mailpoet'), - 'description' => __("Coffee and sugar in your coffee?", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/Discount.php b/lib/Config/PopulatorData/Templates/Discount.php index f54e31530e..fdb6860224 100644 --- a/lib/Config/PopulatorData/Templates/Discount.php +++ b/lib/Config/PopulatorData/Templates/Discount.php @@ -15,7 +15,6 @@ class Discount { function get() { return array( 'name' => __("Discount", 'mailpoet'), - 'description' => __("A useful layout for a simple discount email.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/Faith.php b/lib/Config/PopulatorData/Templates/Faith.php index d68a5e2854..0c06d3ac9e 100644 --- a/lib/Config/PopulatorData/Templates/Faith.php +++ b/lib/Config/PopulatorData/Templates/Faith.php @@ -15,7 +15,6 @@ class Faith { function get() { return array( 'name' => __("Faith", 'mailpoet'), - 'description' => __("A calm and muted faith template.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/FestivalEvent.php b/lib/Config/PopulatorData/Templates/FestivalEvent.php index 9b077d9c6f..e5a15d3db5 100644 --- a/lib/Config/PopulatorData/Templates/FestivalEvent.php +++ b/lib/Config/PopulatorData/Templates/FestivalEvent.php @@ -15,7 +15,6 @@ class FestivalEvent { function get() { return array( 'name' => __("Festival Event", 'mailpoet'), - 'description' => __("A colourful festival event template.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/FoodBox.php b/lib/Config/PopulatorData/Templates/FoodBox.php index dfff3008af..9f62da69e4 100644 --- a/lib/Config/PopulatorData/Templates/FoodBox.php +++ b/lib/Config/PopulatorData/Templates/FoodBox.php @@ -16,7 +16,6 @@ class FoodBox { function get() { return array( 'name' => __("Welcome to FoodBox", 'mailpoet'), - 'description' => __("A welcome email template for your takeaway.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/KickOff.php b/lib/Config/PopulatorData/Templates/KickOff.php index 70c8d4c863..2c739722b2 100644 --- a/lib/Config/PopulatorData/Templates/KickOff.php +++ b/lib/Config/PopulatorData/Templates/KickOff.php @@ -15,7 +15,6 @@ class KickOff { function get() { return array( 'name' => __("Kick-Off", 'mailpoet'), - 'description' => __("Sporty green template for your team or sport event.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/NewsDay.php b/lib/Config/PopulatorData/Templates/NewsDay.php index 55d263c5ee..38be5f997a 100644 --- a/lib/Config/PopulatorData/Templates/NewsDay.php +++ b/lib/Config/PopulatorData/Templates/NewsDay.php @@ -15,7 +15,6 @@ class NewsDay { function get() { return array( 'name' => __("News Day", 'mailpoet'), - 'description' => __("Media ready template.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/NewsletterBlank121Column.php b/lib/Config/PopulatorData/Templates/NewsletterBlank121Column.php index f4a98fc127..022821a2b1 100644 --- a/lib/Config/PopulatorData/Templates/NewsletterBlank121Column.php +++ b/lib/Config/PopulatorData/Templates/NewsletterBlank121Column.php @@ -15,7 +15,6 @@ class NewsletterBlank121Column { function get() { return array( 'name' => __("Newsletter: Blank 1:2:1 Column", 'mailpoet'), - 'description' => __("A blank Newsletter template with a 1:2:1 column layout.", 'mailpoet'), 'categories' => json_encode(array('standard', 'blank')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/NewsletterBlank12Column.php b/lib/Config/PopulatorData/Templates/NewsletterBlank12Column.php index f48be0e9d5..c25c6beb95 100644 --- a/lib/Config/PopulatorData/Templates/NewsletterBlank12Column.php +++ b/lib/Config/PopulatorData/Templates/NewsletterBlank12Column.php @@ -15,7 +15,6 @@ class NewsletterBlank12Column { function get() { return array( 'name' => __("Newsletter: Blank 1:2 Column", 'mailpoet'), - 'description' => __("A blank Newsletter template with a 1:2 column layout.", 'mailpoet'), 'categories' => json_encode(array('standard', 'blank')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/NewsletterBlank13Column.php b/lib/Config/PopulatorData/Templates/NewsletterBlank13Column.php index 653657b180..1192172529 100644 --- a/lib/Config/PopulatorData/Templates/NewsletterBlank13Column.php +++ b/lib/Config/PopulatorData/Templates/NewsletterBlank13Column.php @@ -15,7 +15,6 @@ class NewsletterBlank13Column { function get() { return array( 'name' => __("Newsletter: Blank 1:3 Column", 'mailpoet'), - 'description' => __("A blank Newsletter template with a 1:3 column layout.", 'mailpoet'), 'categories' => json_encode(array('standard', 'blank')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/NewsletterBlank1Column.php b/lib/Config/PopulatorData/Templates/NewsletterBlank1Column.php index c3beeb3a75..d778d30bfa 100644 --- a/lib/Config/PopulatorData/Templates/NewsletterBlank1Column.php +++ b/lib/Config/PopulatorData/Templates/NewsletterBlank1Column.php @@ -15,7 +15,6 @@ class NewsletterBlank1Column { function get() { return array( 'name' => __("Newsletter: Blank 1 Column", 'mailpoet'), - 'description' => __("A blank Newsletter template with a 1 column layout.", 'mailpoet'), 'categories' => json_encode(array('standard', 'blank')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/PieceOfCake.php b/lib/Config/PopulatorData/Templates/PieceOfCake.php index 28eafd1873..7b394b43cd 100644 --- a/lib/Config/PopulatorData/Templates/PieceOfCake.php +++ b/lib/Config/PopulatorData/Templates/PieceOfCake.php @@ -15,7 +15,6 @@ class PieceOfCake { function get() { return array( 'name' => __("Piece of cake", 'mailpoet'), - 'description' => __("Baked with plenty of images.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/PostNotificationsBlank1Column.php b/lib/Config/PopulatorData/Templates/PostNotificationsBlank1Column.php index fcdf4e5f7c..308746b335 100644 --- a/lib/Config/PopulatorData/Templates/PostNotificationsBlank1Column.php +++ b/lib/Config/PopulatorData/Templates/PostNotificationsBlank1Column.php @@ -15,7 +15,6 @@ class PostNotificationsBlank1Column { function get() { return array( 'name' => __("Post Notifications: Blank 1 Column", 'mailpoet'), - 'description' => __("A blank Post Notifications template with a 1 column layout.", 'mailpoet'), 'categories' => json_encode(array('notification', 'blank')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/ScienceWeekly.php b/lib/Config/PopulatorData/Templates/ScienceWeekly.php index 1cc71e69fd..ecfe49b151 100644 --- a/lib/Config/PopulatorData/Templates/ScienceWeekly.php +++ b/lib/Config/PopulatorData/Templates/ScienceWeekly.php @@ -15,7 +15,6 @@ class ScienceWeekly { function get() { return array( 'name' => __("Science Weekly", 'mailpoet'), - 'description' => __("The right chemistry to send your weekly posts.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/Shoes.php b/lib/Config/PopulatorData/Templates/Shoes.php index 1e96318704..5bc1d704c3 100644 --- a/lib/Config/PopulatorData/Templates/Shoes.php +++ b/lib/Config/PopulatorData/Templates/Shoes.php @@ -15,7 +15,6 @@ class Shoes { function get() { return array( 'name' => __("Shoes", 'mailpoet'), - 'description' => __("Nothing like a pair that fits perfectly.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/SimpleText.php b/lib/Config/PopulatorData/Templates/SimpleText.php index c2a5d5e83c..0f9ad7bbf7 100644 --- a/lib/Config/PopulatorData/Templates/SimpleText.php +++ b/lib/Config/PopulatorData/Templates/SimpleText.php @@ -15,7 +15,6 @@ class SimpleText { function get() { return array( 'name' => __("Simple Text", 'mailpoet'), - 'description' => __("A simple plain text template - just like a regular email.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/TakeAHike.php b/lib/Config/PopulatorData/Templates/TakeAHike.php index 176f1030db..1155a54cd1 100644 --- a/lib/Config/PopulatorData/Templates/TakeAHike.php +++ b/lib/Config/PopulatorData/Templates/TakeAHike.php @@ -15,7 +15,6 @@ class TakeAHike { function get() { return array( 'name' => __("Take a Hike", 'mailpoet'), - 'description' => __("Can you climb to the top?", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/TravelNomads.php b/lib/Config/PopulatorData/Templates/TravelNomads.php index 82af9747cc..2c578c5664 100644 --- a/lib/Config/PopulatorData/Templates/TravelNomads.php +++ b/lib/Config/PopulatorData/Templates/TravelNomads.php @@ -15,7 +15,6 @@ class TravelNomads { function get() { return array( 'name' => __("Travel Nomads", 'mailpoet'), - 'description' => __("Ideal for sharing your travel adventures.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/WelcomeBlank12Column.php b/lib/Config/PopulatorData/Templates/WelcomeBlank12Column.php index 3e79611408..bd2ab025df 100644 --- a/lib/Config/PopulatorData/Templates/WelcomeBlank12Column.php +++ b/lib/Config/PopulatorData/Templates/WelcomeBlank12Column.php @@ -15,7 +15,6 @@ class WelcomeBlank12Column { function get() { return array( 'name' => __("Welcome Email: Blank 1:2 Column", 'mailpoet'), - 'description' => __("A blank Welcome Email template with a 1:2 column layout.", 'mailpoet'), 'categories' => json_encode(array('welcome', 'blank')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/WelcomeBlank1Column.php b/lib/Config/PopulatorData/Templates/WelcomeBlank1Column.php index 6421ef6919..23c5b4c9be 100644 --- a/lib/Config/PopulatorData/Templates/WelcomeBlank1Column.php +++ b/lib/Config/PopulatorData/Templates/WelcomeBlank1Column.php @@ -15,7 +15,6 @@ class WelcomeBlank1Column { function get() { return array( 'name' => __("Welcome Email: Blank 1 Column", 'mailpoet'), - 'description' => __("A blank Welcome Email template with a 1 column layout.", 'mailpoet'), 'categories' => json_encode(array('welcome', 'blank')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/WorldCup.php b/lib/Config/PopulatorData/Templates/WorldCup.php index d4e601af73..e7c54db814 100644 --- a/lib/Config/PopulatorData/Templates/WorldCup.php +++ b/lib/Config/PopulatorData/Templates/WorldCup.php @@ -15,7 +15,6 @@ class WorldCup { function get() { return array( 'name' => __("World Cup", 'mailpoet'), - 'description' => __("Always a winner.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/lib/Config/PopulatorData/Templates/YogaStudio.php b/lib/Config/PopulatorData/Templates/YogaStudio.php index 319d7b1000..c48c45876c 100644 --- a/lib/Config/PopulatorData/Templates/YogaStudio.php +++ b/lib/Config/PopulatorData/Templates/YogaStudio.php @@ -15,7 +15,6 @@ class YogaStudio { function get() { return array( 'name' => __("Yoga Studio", 'mailpoet'), - 'description' => __("Salute the sun and your subscribers.", 'mailpoet'), 'categories' => json_encode(array('standard', 'sample')), 'readonly' => 1, 'thumbnail' => $this->getThumbnail(), diff --git a/tests/acceptance/ManageSubscriptionLinkCest.php b/tests/acceptance/ManageSubscriptionLinkCest.php index 6dab8666b9..c79de96d7b 100644 --- a/tests/acceptance/ManageSubscriptionLinkCest.php +++ b/tests/acceptance/ManageSubscriptionLinkCest.php @@ -21,7 +21,7 @@ class ManageSubscriptionLinkCest { $I->click('[data-automation-id=\'create_standard\']'); // step 2 - select template - $first_template_element = '[data-automation-id=\'select_template_1\']'; + $first_template_element = '[data-automation-id=\'select_template_0\']'; $I->waitForElement($first_template_element); $I->seeInCurrentUrl('#/template'); $I->click($first_template_element); diff --git a/tests/unit/API/JSON/v1/NewsletterTemplatesTest.php b/tests/unit/API/JSON/v1/NewsletterTemplatesTest.php index f2c3ebfd12..2c9f900432 100644 --- a/tests/unit/API/JSON/v1/NewsletterTemplatesTest.php +++ b/tests/unit/API/JSON/v1/NewsletterTemplatesTest.php @@ -9,14 +9,12 @@ class NewsletterTemplatesTest extends \MailPoetTest { function _before() { NewsletterTemplate::createOrUpdate(array( 'name' => 'Template #1', - 'description' => 'My First Template', 'body' => '{"key1": "value1"}' )); NewsletterTemplate::createOrUpdate(array( 'name' => 'Template #2', 'newsletter_id' => 1, - 'description' => 'My Second Template', 'body' => '{"key2": "value2"}' )); } @@ -57,7 +55,6 @@ class NewsletterTemplatesTest extends \MailPoetTest { function testItCanSaveANewTemplate() { $template_data = array( 'name' => 'Template #3', - 'description' => 'My Third Template', 'body' => '{"key3": "value3"}' ); @@ -73,7 +70,6 @@ class NewsletterTemplatesTest extends \MailPoetTest { $template_data = array( 'newsletter_id' => 2, 'name' => 'Template #3', - 'description' => 'My Third Template', 'body' => '{"key3": "value3"}' ); @@ -89,7 +85,6 @@ class NewsletterTemplatesTest extends \MailPoetTest { $template_data = array( 'newsletter_id' => '1', 'name' => 'Template #2', - 'description' => 'My Updated Second Template', 'body' => '{"key3": "value3"}' ); @@ -104,7 +99,7 @@ class NewsletterTemplatesTest extends \MailPoetTest { $normalize = function($array) { $result = array(); foreach($array as $key => $value) { - if(in_array($key, ['newsletter_id', 'name', 'description', 'body'])) { + if(in_array($key, ['newsletter_id', 'name', 'body'])) { $result[$key] = $value; } } diff --git a/tests/unit/Models/NewsletterTemplateTest.php b/tests/unit/Models/NewsletterTemplateTest.php index 67897fe879..a9fb7c2b02 100644 --- a/tests/unit/Models/NewsletterTemplateTest.php +++ b/tests/unit/Models/NewsletterTemplateTest.php @@ -7,7 +7,6 @@ class NewsletterTemplateTest extends \MailPoetTest { function _before() { $this->data = array( 'name' => 'Some template', - 'description' => 'My nice template', 'body' => '{}', ); @@ -37,12 +36,6 @@ class NewsletterTemplateTest extends \MailPoetTest { expect($template->name)->equals($this->data['name']); } - function testItHasDescription() { - $template = NewsletterTemplate::where('description', $this->data['description']) - ->findOne(); - expect($template->description)->equals($this->data['description']); - } - function testItHasBody() { $template = NewsletterTemplate::where('body', $this->data['body']) ->findOne(); @@ -53,7 +46,6 @@ class NewsletterTemplateTest extends \MailPoetTest { $created_template = NewsletterTemplate::createOrUpdate( array( 'name' => 'Another template', - 'description' => 'Another template description', 'body' => '{content: {}, globalStyles: {}}', )); expect($created_template->id() > 0)->true(); @@ -81,7 +73,6 @@ class NewsletterTemplateTest extends \MailPoetTest { for($i = 0; $i < $total; $i++) { NewsletterTemplate::createOrUpdate(array( 'name' => 'Testing template ' . $i, - 'description' => 'template description', 'body' => '{content: {}, globalStyles: {}}', 'categories' => NewsletterTemplate::RECENTLY_SENT_CATEGORIES )); diff --git a/views/newsletter/editor.html b/views/newsletter/editor.html index 589f3a0ab2..3bc9d8d5bc 100644 --- a/views/newsletter/editor.html +++ b/views/newsletter/editor.html @@ -333,7 +333,6 @@ 'helpTooltipDesignerPreheader': __("This optional text will appear in your subscribers' inboxes, beside the subject line. Write something enticing!"), 'helpTooltipDesignerFullWidth': __("This option eliminates padding around the image. It only works if the image is larger than the column size."), 'helpTooltipDesignerIdealWidth': __("Use images with widths of at least 1,000 pixels to ensure sharp display on high density screens, like mobile devices."), - 'templateDescriptionMissing': __('Please add a template description'), 'templateSaved': __('Template has been saved.'), 'templateSaveFailed': __('Template has not been saved, please try again'), 'categoriesAndTags': __('Categories & tags'), diff --git a/views/newsletter/templates/components/save.hbs b/views/newsletter/templates/components/save.hbs index 75dce6d4e9..b277fdd62d 100644 --- a/views/newsletter/templates/components/save.hbs +++ b/views/newsletter/templates/components/save.hbs @@ -20,7 +20,6 @@

      <%= __('Export template') %>

      -

      diff --git a/views/newsletters.html b/views/newsletters.html index 30804bec95..a825b72cda 100644 --- a/views/newsletters.html +++ b/views/newsletters.html @@ -114,7 +114,6 @@ 'helpTooltipTemplateUpload': __('You can only upload .json templates that were originally created with MailPoet 3.'), 'upload': __('Upload'), 'mailpoetGuideTemplateTitle': __("MailPoet's Guide"), - 'mailpoetGuideTemplateDescription': __("This is the standard template that comes with MailPoet."), 'confirmTemplateDeletion': __('You are about to delete the template named "%$1s".'), 'delete': __('Delete'), 'select': _x('Select', 'Verb'), @@ -273,6 +272,7 @@ 'recentlySent': __('Recently sent'), 'savedTemplates': __('Your saved templates'), 'templatePreview': __('Template preview'), + 'zoom': __('Zoom'), 'blank': _x('Blank', 'Blank newsletters templates category'), 'sample': _x('Sample', 'Sample newsletters templates category'), 'tabImportTitle': _x('Import', 'Importing template tab title'),