Change template category tabs [MAILPOET-1557]

This commit is contained in:
wxa
2018-11-12 18:08:16 +03:00
parent 2e6dd9b20f
commit 4cb2f78bb8
3 changed files with 26 additions and 21 deletions

View File

@@ -24,27 +24,31 @@ const templatesCategories = [
name: 'notification',
label: MailPoet.I18n.t('tabNotificationTitle'),
},
{
];
if (window.mailpoet_woocommerce_active) {
templatesCategories.push({
name: 'woocommerce',
label: MailPoet.I18n.t('tabWoocommerceTitle'),
},
{
name: 'sample',
label: MailPoet.I18n.t('sample'),
},
{
name: 'blank',
label: MailPoet.I18n.t('blank'),
},
{
name: 'recent',
label: MailPoet.I18n.t('recentlySent'),
},
{
name: 'saved',
label: MailPoet.I18n.t('savedTemplates'),
},
];
});
}
templatesCategories.push(
...[
{
name: 'all',
label: MailPoet.I18n.t('allTemplates'),
},
{
name: 'recent',
label: MailPoet.I18n.t('recentlySent'),
},
{
name: 'saved',
label: MailPoet.I18n.t('savedTemplates'),
},
]
);
class NewsletterTemplates extends React.Component {
constructor(props) {

View File

@@ -580,6 +580,7 @@ class Menu {
$data['tracking_enabled'] = Setting::getValue('tracking.enabled');
$data['premium_plugin_active'] = License::getLicense();
$data['is_woocommerce_active'] = class_exists('WooCommerce');
$data['automatic_emails'] = array(
array(

View File

@@ -22,6 +22,7 @@
var mailpoet_date_storage_format = "Y-m-d";
var mailpoet_tracking_enabled = <%= json_encode(tracking_enabled) %>;
var mailpoet_premium_active = <%= json_encode(premium_plugin_active) %>;
var mailpoet_woocommerce_active = <%= json_encode(is_woocommerce_active) %>;
var mailpoet_automatic_emails = <%= json_encode(automatic_emails) %>;
var mailpoet_in_app_announcements = mailpoet_settings.in_app_announcements;
var mailpoet_free_welcome_emails_image = '<%= image_url('in_app_announcements/hello-illustration-for-welcome-emails.png') %>';
@@ -290,8 +291,7 @@
'savedTemplates': __('Your saved templates'),
'templatePreview': __('Template preview'),
'zoom': __('Preview'),
'blank': _x('Blank', 'Blank newsletters templates category'),
'sample': _x('Sample', 'Sample newsletters templates category'),
'allTemplates': _x('All', 'Name of a section with all email templates'),
'tabImportTitle': _x('Import', 'Importing template tab title'),
'noTemplates': __('This category does not contain any template yet!'),