diff --git a/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js b/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js index f1391f3161..8c99698ee7 100644 --- a/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js +++ b/assets/js/src/newsletter_editor/blocks/automatedLatestContent.js @@ -154,6 +154,7 @@ define([ renderOptions = { disableTextEditor: true, disableDragAndDrop: true, + emptyContainerMessage: MailPoet.I18n.t('noPostsToDisplay'), }; this.toolsView = new Module.AutomatedLatestContentBlockToolsView({ model: this.model }); this.toolsRegion.show(this.toolsView); @@ -315,9 +316,11 @@ define([ if (value == 'titleOnly') { this.$('.mailpoet_automated_latest_content_title_as_list').removeClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_image_full_width_option').addClass('mailpoet_hidden'); + this.$('.mailpoet_automated_latest_content_image_separator').addClass('mailpoet_hidden'); } else { this.$('.mailpoet_automated_latest_content_title_as_list').addClass('mailpoet_hidden'); this.$('.mailpoet_automated_latest_content_image_full_width_option').removeClass('mailpoet_hidden'); + this.$('.mailpoet_automated_latest_content_image_separator').removeClass('mailpoet_hidden'); // Reset titleFormat if it was set to List when switching away from displayType=titleOnly if (this.model.get('titleFormat') === 'ul') { diff --git a/assets/js/src/newsletter_editor/blocks/container.js b/assets/js/src/newsletter_editor/blocks/container.js index ebeccd099b..2e69b7f260 100644 --- a/assets/js/src/newsletter_editor/blocks/container.js +++ b/assets/js/src/newsletter_editor/blocks/container.js @@ -294,6 +294,7 @@ define([ templateHelpers: function() { return { isRoot: this.renderOptions.depth === 0, + emptyContainerMessage: this.renderOptions.emptyContainerMessage || '', }; }, }); diff --git a/assets/js/src/newsletter_editor/blocks/posts.js b/assets/js/src/newsletter_editor/blocks/posts.js index d35ec345bf..aedc96d2cb 100644 --- a/assets/js/src/newsletter_editor/blocks/posts.js +++ b/assets/js/src/newsletter_editor/blocks/posts.js @@ -175,6 +175,7 @@ define([ renderOptions = { disableTextEditor: true, disableDragAndDrop: true, + emptyContainerMessage: MailPoet.I18n.t('noPostsToDisplay'), }; this.postsRegion.show(new ContainerView({ model: this.model.get('_transformedPosts'), renderOptions: renderOptions })); }, @@ -215,6 +216,9 @@ define([ var that = this, blockView = this.model.request('blockView'); + this.selectionRegion.show(this.selectionView); + this.displayOptionsRegion.show(this.displayOptionsView); + MailPoet.Modal.panel({ element: this.$el, template: '', @@ -226,8 +230,6 @@ define([ }, }); - this.selectionRegion.show(this.selectionView); - this.displayOptionsRegion.show(this.displayOptionsView); }, switchToDisplayOptions: function() { // Switch content view @@ -277,9 +279,6 @@ define([ Marionette.CompositeView.apply(this, arguments); }, onRender: function() { - - }, - onAttach: function() { var that = this; // Dynamically update available post types @@ -462,9 +461,11 @@ define([ if (value == 'titleOnly') { this.$('.mailpoet_posts_title_as_list').removeClass('mailpoet_hidden'); this.$('.mailpoet_posts_image_full_width_option').addClass('mailpoet_hidden'); + this.$('.mailpoet_posts_image_separator').addClass('mailpoet_hidden'); } else { this.$('.mailpoet_posts_title_as_list').addClass('mailpoet_hidden'); this.$('.mailpoet_posts_image_full_width_option').removeClass('mailpoet_hidden'); + this.$('.mailpoet_posts_image_separator').removeClass('mailpoet_hidden'); // Reset titleFormat if it was set to List when switching away from displayType=titleOnly if (this.model.get('titleFormat') === 'ul') { diff --git a/views/newsletter/editor.html b/views/newsletter/editor.html index 933a917c08..fe2e53f4a1 100644 --- a/views/newsletter/editor.html +++ b/views/newsletter/editor.html @@ -328,6 +328,7 @@ 'templateSaved': __('Template has been saved.'), 'templateSaveFailed': __('Template has not been saved, please try again.'), 'categoriesAndTags': __('Categories & tags'), + 'noPostsToDisplay': __('There are no posts to display'), }) %> <% endblock %> diff --git a/views/newsletter/templates/blocks/automatedLatestContent/settings.hbs b/views/newsletter/templates/blocks/automatedLatestContent/settings.hbs index 6cc2763768..f27ba6665a 100644 --- a/views/newsletter/templates/blocks/automatedLatestContent/settings.hbs +++ b/views/newsletter/templates/blocks/automatedLatestContent/settings.hbs @@ -132,7 +132,7 @@ -
+
-
+