Add Test 14 form based templates

[MAILPOET-3208]
This commit is contained in:
Rostislav Wolny
2020-10-22 16:16:05 +02:00
committed by Veljko V
parent b9e5c12697
commit df1f00f4df
13 changed files with 1537 additions and 0 deletions

View File

@@ -31,6 +31,11 @@ use MailPoet\Form\Templates\Templates\Template13FixedBar;
use MailPoet\Form\Templates\Templates\Template13Popup; use MailPoet\Form\Templates\Templates\Template13Popup;
use MailPoet\Form\Templates\Templates\Template13SlideIn; use MailPoet\Form\Templates\Templates\Template13SlideIn;
use MailPoet\Form\Templates\Templates\Template13Widget; use MailPoet\Form\Templates\Templates\Template13Widget;
use MailPoet\Form\Templates\Templates\Template14BelowPages;
use MailPoet\Form\Templates\Templates\Template14FixedBar;
use MailPoet\Form\Templates\Templates\Template14Popup;
use MailPoet\Form\Templates\Templates\Template14SlideIn;
use MailPoet\Form\Templates\Templates\Template14Widget;
use MailPoet\Form\Templates\Templates\Template17BelowPages; use MailPoet\Form\Templates\Templates\Template17BelowPages;
use MailPoet\Form\Templates\Templates\Template17FixedBar; use MailPoet\Form\Templates\Templates\Template17FixedBar;
use MailPoet\Form\Templates\Templates\Template17Popup; use MailPoet\Form\Templates\Templates\Template17Popup;
@@ -114,6 +119,7 @@ class FormEditor {
Template11Popup::ID, Template11Popup::ID,
Template12Popup::ID, Template12Popup::ID,
Template13Popup::ID, Template13Popup::ID,
Template14Popup::ID,
Template17Popup::ID, Template17Popup::ID,
Template18Popup::ID, Template18Popup::ID,
], ],
@@ -127,6 +133,7 @@ class FormEditor {
Template11SlideIn::ID, Template11SlideIn::ID,
Template12SlideIn::ID, Template12SlideIn::ID,
Template13SlideIn::ID, Template13SlideIn::ID,
Template14SlideIn::ID,
Template17SlideIn::ID, Template17SlideIn::ID,
Template18SlideIn::ID, Template18SlideIn::ID,
], ],
@@ -140,6 +147,7 @@ class FormEditor {
Template11FixedBar::ID, Template11FixedBar::ID,
Template12FixedBar::ID, Template12FixedBar::ID,
Template13FixedBar::ID, Template13FixedBar::ID,
Template14FixedBar::ID,
Template17FixedBar::ID, Template17FixedBar::ID,
Template18FixedBar::ID, Template18FixedBar::ID,
], ],
@@ -153,6 +161,7 @@ class FormEditor {
Template11BelowPages::ID, Template11BelowPages::ID,
Template12BelowPages::ID, Template12BelowPages::ID,
Template13BelowPages::ID, Template13BelowPages::ID,
Template14BelowPages::ID,
Template17BelowPages::ID, Template17BelowPages::ID,
Template18BelowPages::ID, Template18BelowPages::ID,
], ],
@@ -166,6 +175,7 @@ class FormEditor {
Template11Widget::ID, Template11Widget::ID,
Template12Widget::ID, Template12Widget::ID,
Template13Widget::ID, Template13Widget::ID,
Template14Widget::ID,
Template17Widget::ID, Template17Widget::ID,
Template18Widget::ID, Template18Widget::ID,
], ],

View File

@@ -24,6 +24,11 @@ use MailPoet\Form\Templates\Templates\Template13FixedBar;
use MailPoet\Form\Templates\Templates\Template13Popup; use MailPoet\Form\Templates\Templates\Template13Popup;
use MailPoet\Form\Templates\Templates\Template13SlideIn; use MailPoet\Form\Templates\Templates\Template13SlideIn;
use MailPoet\Form\Templates\Templates\Template13Widget; use MailPoet\Form\Templates\Templates\Template13Widget;
use MailPoet\Form\Templates\Templates\Template14BelowPages;
use MailPoet\Form\Templates\Templates\Template14FixedBar;
use MailPoet\Form\Templates\Templates\Template14Popup;
use MailPoet\Form\Templates\Templates\Template14SlideIn;
use MailPoet\Form\Templates\Templates\Template14Widget;
use MailPoet\Form\Templates\Templates\Template17BelowPages; use MailPoet\Form\Templates\Templates\Template17BelowPages;
use MailPoet\Form\Templates\Templates\Template17FixedBar; use MailPoet\Form\Templates\Templates\Template17FixedBar;
use MailPoet\Form\Templates\Templates\Template17Popup; use MailPoet\Form\Templates\Templates\Template17Popup;
@@ -121,6 +126,11 @@ class TemplateRepository {
Template13Popup::ID => Template13Popup::class, Template13Popup::ID => Template13Popup::class,
Template13SlideIn::ID => Template13SlideIn::class, Template13SlideIn::ID => Template13SlideIn::class,
Template13Widget::ID => Template13Widget::class, Template13Widget::ID => Template13Widget::class,
Template14BelowPages::ID => Template14BelowPages::class,
Template14FixedBar::ID => Template14FixedBar::class,
Template14Popup::ID => Template14Popup::class,
Template14SlideIn::ID => Template14SlideIn::class,
Template14Widget::ID => Template14Widget::class,
Template17BelowPages::ID => Template17BelowPages::class, Template17BelowPages::ID => Template17BelowPages::class,
Template17FixedBar::ID => Template17FixedBar::class, Template17FixedBar::ID => Template17FixedBar::class,
Template17Popup::ID => Template17Popup::class, Template17Popup::ID => Template17Popup::class,

View File

@@ -0,0 +1,303 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template14BelowPages extends FormTemplate {
const ID = 'template_14_below_pages';
/** @var string */
protected $assetsDirectory = 'template-14';
public function getName(): string {
return _x('Lifestyle Blog', 'Form template name', 'mailpoet');
}
public function getThumbnailUrl(): string {
return $this->getAssetUrl('belowpage.png');
}
public function getBody(): array {
return [
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '25',
],
'body' => [
[
'type' => 'image',
'id' => 'image',
'params' => [
'class_name' => 'is-style-default',
'align' => '',
'url' => $this->getAssetUrl('pic-1-682x1024.jpg'),
'alt' => '',
'title' => '',
'caption' => '',
'link_destination' => 'none',
'link' => 'http://mailpoet.info/pic-2/',
'href' => '',
'link_class' => '',
'rel' => '',
'link_target' => '',
'id' => '308',
'size_slug' => 'large',
'width' => '',
'height' => '',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '75',
],
'body' => [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => '<span style="font-family: Nothing You Could Do" data-font="Nothing You Could Do" class="mailpoet-has-font"><strong>' . _x('WANT MORE?', 'Text in a web form', 'mailpoet') . '</strong></span>',
'level' => '2',
'align' => 'center',
'font_size' => '30',
'text_color' => '',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . _x('SIGN UP TO RECEIVE THE LATEST LIFESTYLE TIPS &amp; TRICKS, PLUS SOME EXCLUSIVE GOODIES!', 'Text in a web form', 'mailpoet') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '16',
'text_color' => '',
'background_color' => '',
'class_name' => '',
],
],
[
'type' => 'text',
'params' => [
'label' => _x('Email Address', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#faf6f1',
'border_size' => '0',
'border_radius' => '5',
'border_color' => '#313131',
],
],
[
'type' => 'submit',
'params' => [
'label' => _x('LETS DO THIS!', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'background_color' => '#edd4b5',
'font_size' => '15',
'font_color' => '#ffffff',
'border_size' => '0',
'border_radius' => '5',
'padding' => '10',
'font_family' => 'Karla',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We dont spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '13',
'text_color' => '#1e1e1e',
'background_color' => '',
'class_name' => '',
],
],
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
];
}
public function getSettings(): array {
return [
'on_success' => 'message',
'success_message' => '',
'segments' => [],
'segments_selected_by' => 'admin',
'alignment' => 'left',
'form_placement' => [
'popup' => [
'enabled' => '',
],
'fixed_bar' => [
'enabled' => '',
],
'below_posts' => [
'enabled' => '1',
'styles' => [
'width' => [
'unit' => 'percent',
'value' => '100',
],
],
],
'slide_in' => [
'enabled' => '',
],
'others' => [],
],
'border_radius' => '4',
'border_size' => '0',
'form_padding' => '0',
'input_padding' => '10',
'font_family' => 'Karla',
'close_button' => 'classic',
'success_validation_color' => '#00d084',
'error_validation_color' => '#cf2e2e',
'fontSize' => '15',
'fontColor' => '#1e1e1e',
'backgroundColor' => '#ffffff',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 0px;
}
.wp-block-column:not(:first-child),
.mailpoet_form_column:not(:first-child) {
padding: 0 20px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 0;
}
h2.mailpoet-heading {
margin: 0 0 20px 0;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

View File

@@ -0,0 +1,316 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template14FixedBar extends FormTemplate {
const ID = 'template_14_fixed_bar';
/** @var string */
protected $assetsDirectory = 'template-14';
public function getName(): string {
return _x('Lifestyle Blog', 'Form template name', 'mailpoet');
}
public function getThumbnailUrl(): string {
return $this->getAssetUrl('fixedbar.png');
}
public function getBody(): array {
return [
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '10',
],
'body' => [
[
'type' => 'image',
'id' => 'image',
'params' => [
'class_name' => 'is-style-default',
'align' => '',
'url' => $this->getAssetUrl('pic-1-682x1024.jpg'),
'alt' => '',
'title' => '',
'caption' => '',
'link_destination' => 'none',
'link' => 'http://mailpoet.info/pic-2/',
'href' => '',
'link_class' => '',
'rel' => '',
'link_target' => '',
'id' => '308',
'size_slug' => 'large',
'width' => '',
'height' => '',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '60',
],
'body' => [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => '<span style="font-family: Nothing You Could Do" data-font="Nothing You Could Do" class="mailpoet-has-font"><strong>' . _x('WANT MORE?', 'Text in a web form', 'mailpoet') . '</strong></span>', // @todo Add translations, links and emoji processing.,
'level' => '2',
'align' => 'center',
'font_size' => '24',
'text_color' => '',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . _x('SIGN UP TO RECEIVE THE LATEST LIFESTYLE TIPS &amp; TRICKS, PLUS SOME EXCLUSIVE GOODIES!', 'Text in a web form', 'mailpoet') . '</span><br><span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We dont spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '14',
'text_color' => '',
'background_color' => '',
'class_name' => '',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '30',
],
'body' => [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'text',
'params' => [
'label' => _x('Email Address', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#faf6f1',
'border_size' => '0',
'border_radius' => '5',
'border_color' => '#313131',
],
],
[
'type' => 'submit',
'params' => [
'label' => _x('LETS DO THIS!', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'background_color' => '#edd4b5',
'font_size' => '15',
'font_color' => '#ffffff',
'border_size' => '0',
'border_radius' => '5',
'padding' => '10',
'font_family' => 'Karla',
],
],
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
];
}
public function getSettings(): array {
return [
'on_success' => 'message',
'success_message' => '',
'segments' => [],
'segments_selected_by' => 'admin',
'alignment' => 'left',
'form_placement' => [
'popup' => [
'enabled' => '',
],
'fixed_bar' => [
'enabled' => '1',
'styles' => [
'width' => [
'unit' => 'pixel',
'value' => '1100',
],
],
'position' => 'top',
'animation' => 'slideup',
],
'below_posts' => [
'enabled' => '',
],
'slide_in' => [
'enabled' => '',
],
'others' => [],
],
'border_radius' => '4',
'border_size' => '0',
'form_padding' => '0',
'input_padding' => '10',
'font_family' => 'Karla',
'close_button' => 'classic',
'success_validation_color' => '#00d084',
'error_validation_color' => '#cf2e2e',
'fontSize' => '15',
'fontColor' => '#1e1e1e',
'backgroundColor' => '#ffffff',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 0px;
}
.wp-block-column:not(:first-child),
.mailpoet_form_column:not(:first-child) {
padding: 0 20px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 0;
}
h2.mailpoet-heading {
margin: 0 0 20px 0;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

View File

@@ -0,0 +1,304 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template14Popup extends FormTemplate {
const ID = 'template_14_popup';
/** @var string */
protected $assetsDirectory = 'template-14';
public function getName(): string {
return _x('Lifestyle Blog', 'Form template name', 'mailpoet');
}
public function getThumbnailUrl(): string {
return $this->getAssetUrl('popup.png');
}
public function getBody(): array {
return [
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'image',
'id' => 'image',
'params' => [
'class_name' => 'is-style-default',
'align' => '',
'url' => $this->getAssetUrl('pic-1-682x1024.jpg'),
'alt' => '',
'title' => '',
'caption' => '',
'link_destination' => 'none',
'link' => 'http://mailpoet.info/pic-2/',
'href' => '',
'link_class' => '',
'rel' => '',
'link_target' => '',
'id' => '308',
'size_slug' => 'large',
'width' => '',
'height' => '',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => '<span style="font-family: Nothing You Could Do" data-font="Nothing You Could Do" class="mailpoet-has-font"><strong>' . _x('WANT MORE?', 'Text in a web form', 'mailpoet') . '</strong></span>',
'level' => '2',
'align' => 'center',
'font_size' => '30',
'text_color' => '',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . _x('SIGN UP TO RECEIVE THE LATEST LIFESTYLE TIPS &amp; TRICKS, PLUS SOME EXCLUSIVE GOODIES!', 'Text in a web form', 'mailpoet') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '15',
'text_color' => '',
'background_color' => '',
'class_name' => '',
],
],
[
'type' => 'text',
'params' => [
'label' => _x('Email Address', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#faf6f1',
'border_size' => '0',
'border_radius' => '5',
'border_color' => '#313131',
],
],
[
'type' => 'submit',
'params' => [
'label' => _x('LETS DO THIS!', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'background_color' => '#edd4b5',
'font_size' => '15',
'font_color' => '#ffffff',
'border_size' => '0',
'border_radius' => '5',
'padding' => '10',
'font_family' => 'Karla',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We dont spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '13',
'text_color' => '#1e1e1e',
'background_color' => '',
'class_name' => '',
],
],
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
];
}
public function getSettings(): array {
return [
'on_success' => 'message',
'success_message' => '',
'segments' => [],
'segments_selected_by' => 'admin',
'alignment' => 'left',
'form_placement' => [
'popup' => [
'enabled' => '1',
'styles' => [
'width' => [
'unit' => 'pixel',
'value' => '550',
],
],
'animation' => 'slideup',
],
'fixed_bar' => [
'enabled' => '',
],
'below_posts' => [
'enabled' => '',
],
'slide_in' => [
'enabled' => '',
],
'others' => [],
],
'border_radius' => '4',
'border_size' => '0',
'form_padding' => '10',
'input_padding' => '10',
'font_family' => 'Karla',
'close_button' => 'classic',
'success_validation_color' => '#00d084',
'error_validation_color' => '#cf2e2e',
'fontSize' => '15',
'fontColor' => '#1e1e1e',
'backgroundColor' => '#ffffff',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 0px;
}
.wp-block-column:not(:first-child),
.mailpoet_form_column:not(:first-child) {
padding: 0 20px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 0;
}
h2.mailpoet-heading {
margin: 0 0 20px 0;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

View File

@@ -0,0 +1,305 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template14SlideIn extends FormTemplate {
const ID = 'template_14_slide_in';
/** @var string */
protected $assetsDirectory = 'template-14';
public function getName(): string {
return _x('Lifestyle Blog', 'Form template name', 'mailpoet'); //@todo Set proper value
}
public function getThumbnailUrl(): string {
return $this->getAssetUrl('slidein.png');
}
public function getBody(): array {
return [
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'image',
'id' => 'image',
'params' => [
'class_name' => 'is-style-default',
'align' => '',
'url' => $this->getAssetUrl('pic-1-682x1024.jpg'),
'alt' => '',
'title' => '',
'caption' => '',
'link_destination' => 'none',
'link' => 'http://mailpoet.info/pic-2/',
'href' => '',
'link_class' => '',
'rel' => '',
'link_target' => '',
'id' => '308',
'size_slug' => 'large',
'width' => '',
'height' => '',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => '<span style="font-family: Nothing You Could Do" data-font="Nothing You Could Do" class="mailpoet-has-font"><strong>' . _x('WANT MORE?', 'Text in a web form', 'mailpoet') . '</strong></span>',
'level' => '2',
'align' => 'center',
'font_size' => '30',
'text_color' => '',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . _x('SIGN UP TO RECEIVE THE LATEST LIFESTYLE TIPS &amp; TRICKS, PLUS SOME EXCLUSIVE GOODIES!', 'Text in a web form', 'mailpoet') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '15',
'text_color' => '',
'background_color' => '',
'class_name' => '',
],
],
[
'type' => 'text',
'params' => [
'label' => _x('Email Address', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#faf6f1',
'border_size' => '0',
'border_radius' => '5',
'border_color' => '#313131',
],
],
[
'type' => 'submit',
'params' => [
'label' => _x('LETS DO THIS!', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'background_color' => '#edd4b5',
'font_size' => '15',
'font_color' => '#ffffff',
'border_size' => '0',
'border_radius' => '5',
'padding' => '10',
'font_family' => 'Karla',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We dont spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '13',
'text_color' => '#1e1e1e',
'background_color' => '',
'class_name' => '',
],
],
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
];
}
public function getSettings(): array {
return [
'on_success' => 'message',
'success_message' => '',
'segments' => [],
'segments_selected_by' => 'admin',
'alignment' => 'left',
'form_placement' => [
'popup' => [
'enabled' => '',
],
'fixed_bar' => [
'enabled' => '',
],
'below_posts' => [
'enabled' => '',
],
'slide_in' => [
'enabled' => '1',
'position' => 'right',
'animation' => 'right',
'styles' => [
'width' => [
'unit' => 'pixel',
'value' => '550',
],
],
],
'others' => [],
],
'border_radius' => '4',
'border_size' => '0',
'form_padding' => '10',
'input_padding' => '10',
'font_family' => 'Karla',
'close_button' => 'classic',
'success_validation_color' => '#00d084',
'error_validation_color' => '#cf2e2e',
'fontSize' => '15',
'fontColor' => '#1e1e1e',
'backgroundColor' => '#ffffff',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 0px;
}
.wp-block-column:not(:first-child),
.mailpoet_form_column:not(:first-child) {
padding: 0 20px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 0;
}
h2.mailpoet-heading {
margin: 0 0 20px 0;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

View File

@@ -0,0 +1,289 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template14Widget extends FormTemplate {
const ID = 'template_14_widget';
/** @var string */
protected $assetsDirectory = 'template-14';
public function getName(): string {
return _x('Lifestyle Blog', 'Form template name', 'mailpoet');
}
public function getThumbnailUrl(): string {
return $this->getAssetUrl('widget.png');
}
public function getBody(): array {
return [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '1',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => '<span style="font-family: Nothing You Could Do" data-font="Nothing You Could Do" class="mailpoet-has-font"><strong>' . _x('WANT MORE?', 'Text in a web form', 'mailpoet') . '</strong></span>',
'level' => '2',
'align' => 'center',
'font_size' => '20',
'text_color' => '',
'background_color' => '#ffffff',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . _x('SIGN UP TO RECEIVE THE LATEST LIFESTYLE TIPS &amp; TRICKS, PLUS SOME EXCLUSIVE GOODIES!', 'Text in a web form', 'mailpoet') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '14',
'text_color' => '',
'background_color' => '#ffffff',
'class_name' => '',
],
],
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '10',
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '80',
],
'body' => [
[
'type' => 'text',
'params' => [
'label' => _x('Email Address', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#faf6f1',
'border_size' => '0',
'border_radius' => '5',
'border_color' => '#313131',
],
],
[
'type' => 'submit',
'params' => [
'label' => _x('LETS DO THIS!', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'background_color' => '#000000',
'font_size' => '15',
'font_color' => '#ffffff',
'border_size' => '0',
'border_radius' => '5',
'padding' => '10',
'font_family' => 'Karla',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '10',
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => '<span style="font-family: Karla" data-font="Karla" class="mailpoet-has-font">' . $this->replaceLinkTags(_x('We dont spam! Read our [link]privacy policy[/link] for more info.', 'Text in a web form.', 'mailpoet'), '#') . '</span>',
'drop_cap' => '0',
'align' => 'center',
'font_size' => '13',
'text_color' => '#1e1e1e',
'background_color' => '#ffffff',
'class_name' => '',
],
],
];
}
public function getSettings(): array {
return [
'on_success' => 'message',
'success_message' => '',
'segments' => [],
'segments_selected_by' => 'admin',
'alignment' => 'left',
'form_placement' => [
'popup' => [
'enabled' => '',
],
'fixed_bar' => [
'enabled' => '',
],
'below_posts' => [
'enabled' => '',
],
'slide_in' => [
'enabled' => '',
],
'others' => [
'styles' => [
'width' => [
'unit' => 'percent',
'value' => '100',
],
],
],
],
'border_radius' => '0',
'border_size' => '0',
'form_padding' => '0',
'input_padding' => '10',
'font_family' => 'Karla',
'close_button' => 'classic',
'success_validation_color' => '#00d084',
'error_validation_color' => '#cf2e2e',
'fontSize' => '15',
'fontColor' => '#1e1e1e',
'backgroundColor' => '#ffffff',
'background_image_url' => $this->getAssetUrl('pic-1-682x1024-1.jpg'),
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 0px;
}
.wp-block-column:not(:first-child),
.mailpoet_form_column:not(:first-child) {
padding: 0 20px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 0;
}
h2.mailpoet-heading {
margin: 0 0 20px 0;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB