diff --git a/assets/css/src/listing/newsletters.styl b/assets/css/src/listing/newsletters.styl index 938ee33ef0..4e7b5b4ba9 100644 --- a/assets/css/src/listing/newsletters.styl +++ b/assets/css/src/listing/newsletters.styl @@ -2,7 +2,7 @@ $excellent-badge-color = #2993ab $good-badge-color = #f0b849 $bad-badge-color = #d54e21 $green-badge-color = #55bd56 -$cta-badge-color = #46b450 +$video-guide-badge-color = #46b450 #newsletters_container h2.nav-tab-wrapper @@ -53,8 +53,8 @@ $cta-badge-color = #46b450 &_green background: $green-badge-color - &_cta - background: $cta-badge-color + &_video + background: $video-guide-badge-color line-height: 5em padding: 7px 6px 7px 6px text-decoration: none diff --git a/assets/js/src/newsletters/types.jsx b/assets/js/src/newsletters/types.jsx index e25b223826..f8ae2b9969 100644 --- a/assets/js/src/newsletters/types.jsx +++ b/assets/js/src/newsletters/types.jsx @@ -123,10 +123,7 @@ const NewsletterTypes = React.createClass({ ]; const types = Hooks.applyFilters('mailpoet_newsletters_types', [...defaultTypes, ...this.getAutomaticEmails()], this); - let badgeClassName = 'mailpoet_badge mailpoet_badge_cta'; - if (window.mailpoet_is_new_user === false) { - badgeClassName += ' mailpoet_badge_cta_grey'; - } + const badgeClassName = (window.mailpoet_is_new_user === true) ? 'mailpoet_badge mailpoet_badge_video' : 'mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey'; return (
diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index 0eaae9fba4..8308caf9ac 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -384,7 +384,7 @@ class Menu { $data['is_old_user'] = false; if(!empty($data['settings']['installed_at'])) { $installed_at = Carbon::createFromTimestamp(strtotime($data['settings']['installed_at'])); - $current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp')); + $current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp')); $data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30; $data['is_old_user'] = $current_time->diffInMonths($installed_at) >= 6; $data['stop_call_for_rating'] = isset($data['settings']['stop_call_for_rating']) ? $data['settings']['stop_call_for_rating'] : false; @@ -438,12 +438,7 @@ class Menu { ) ); - $data['is_new_user'] = true; - if(!empty($data['settings']['installed_at'])) { - $installed_at = Carbon::createFromTimestamp(strtotime($data['settings']['installed_at'])); - $current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp')); - $data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30; - } + $data['is_new_user'] = $this->is_new_user(); $data = array_merge($data, Installer::getPremiumStatus()); @@ -548,13 +543,7 @@ class Menu { $data['items_per_page'] = $this->getLimitPerPage('forms'); $data['segments'] = Segment::findArray(); - $data['is_new_user'] = true; - $installed_at = Setting::getValue('installed_at'); - if(!is_null($installed_at)) { - $installed_at = Carbon::createFromTimestamp(strtotime($installed_at)); - $current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp')); - $data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30; - } + $data['is_new_user'] = $this->is_new_user(); $this->displayPage('forms.html', $data); } @@ -594,12 +583,7 @@ class Menu { $data['automatic_emails'] = array(); - $data['is_new_user'] = 'true'; - if(!empty($data['settings']['installed_at'])) { - $installed_at = Carbon::createFromTimestamp(strtotime($data['settings']['installed_at'])); - $current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp')); - $data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30 ? 'true' : 'false'; - } + $data['is_new_user'] = $this->is_new_user(); wp_enqueue_script('jquery-ui'); wp_enqueue_script('jquery-ui-datepicker'); @@ -632,13 +616,7 @@ class Menu { 'sub_menu' => 'mailpoet-subscribers' )); - $data['is_new_user'] = true; - $installed_at = Setting::getValue('installed_at'); - if(!is_null($installed_at)) { - $installed_at = Carbon::createFromTimestamp(strtotime($installed_at)); - $current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp')); - $data['is_new_user'] = $current_time->diffInDays($installed_at) <= 30; - } + $data['is_new_user'] = $this->is_new_user(); $this->displayPage('subscribers/importExport/import.html', $data); } @@ -778,4 +756,14 @@ class Menu { $notice->displayWPNotice(); } } + + function is_new_user() { + $installed_at = Setting::getValue('installed_at'); + if(is_null($installed_at)) { + return true; + } + $installed_at = Carbon::createFromTimestamp(strtotime($installed_at)); + $current_time = Carbon::createFromTimestamp(WPFunctions::currentTime('timestamp')); + return $current_time->diffInDays($installed_at) <= 30; + } } diff --git a/lib/Twig/Filters.php b/lib/Twig/Filters.php index a1936d86b3..ae27635e1c 100644 --- a/lib/Twig/Filters.php +++ b/lib/Twig/Filters.php @@ -22,4 +22,4 @@ class Filters extends \Twig_Extension { ) ); } -} \ No newline at end of file +} diff --git a/views/forms.html b/views/forms.html index 2bcf4a42fb..4c1487f228 100644 --- a/views/forms.html +++ b/views/forms.html @@ -12,7 +12,8 @@

- + <% set badgeClassName = (is_new_user == true) ? 'mailpoet_badge mailpoet_badge_video' : 'mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey' %> + <%= __('See video guide') %> diff --git a/views/newsletters.html b/views/newsletters.html index aca8896730..aad1536c97 100644 --- a/views/newsletters.html +++ b/views/newsletters.html @@ -17,7 +17,8 @@ var mailpoet_tracking_enabled = <%= json_encode(tracking_enabled) %>; var mailpoet_premium_active = <%= json_encode(premium_plugin_active) %>; var mailpoet_automatic_emails = <%= json_encode(automatic_emails) %>; - var mailpoet_is_new_user = <%= is_new_user %>; + <% set newUser = (is_new_user == true) ? 'true' : 'false' %> + var mailpoet_is_new_user = <%= newUser %>; <% endblock %> diff --git a/views/settings/mta.html b/views/settings/mta.html index a543a39ebb..c4067ab2b3 100644 --- a/views/settings/mta.html +++ b/views/settings/mta.html @@ -145,12 +145,11 @@

- <%= __("Need help to pick?") %> - - <%= __('See video guide') %> - - <%= __("[link]or check out the comparison table of sending methods[/link].") - |replaceLinkTags('http://beta.docs.mailpoet.com/article/181-comparison-table-of-sending-methods', {'target' : '_blank'}) + <% set badgeClassName = (is_new_user == true) ? 'mailpoet_badge mailpoet_badge_video' : 'mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey' %> + <%= __('Need help to pick? [link1]%s See video guide[/link1] [link2]or check out the comparison table of sending methods[/link2].') + |format('') + |replaceLinkTags('https://beta.docs.mailpoet.com/article/235-video-guide-sending-options', {'class' : badgeClassName, 'target' : '_blank'}, 'link1') + |replaceLinkTags('http://beta.docs.mailpoet.com/article/181-comparison-table-of-sending-methods', {'target' : '_blank'}, 'link2') |raw %>

diff --git a/views/subscribers/importExport/import/step1.html b/views/subscribers/importExport/import/step1.html index 54b557ec9f..965c6ac629 100644 --- a/views/subscribers/importExport/import/step1.html +++ b/views/subscribers/importExport/import/step1.html @@ -22,7 +22,8 @@ - + <% set badgeClassName = (is_new_user == true) ? 'mailpoet_badge mailpoet_badge_video' : 'mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey' %> + <%= __('See video guide') %>