diff --git a/assets/javascripts/discourse/connectors/above-main-container/subscriptions-campaign.js.es6 b/assets/javascripts/discourse/connectors/above-main-container/subscriptions-campaign.js.es6 new file mode 100644 index 0000000..3906052 --- /dev/null +++ b/assets/javascripts/discourse/connectors/above-main-container/subscriptions-campaign.js.es6 @@ -0,0 +1,12 @@ +export default { + shouldRender(args, component) { + const { siteSettings } = component; + const mobileView = component.site.mobileView; + const bannerLocation = + siteSettings.discourse_subscriptions_campaign_banner_location; + + return ( + bannerLocation === "Top" || (bannerLocation === "Sidebar" && mobileView) + ); + }, +}; diff --git a/assets/javascripts/discourse/connectors/before-topic-list/subscriptions-campaign-sidebar.js.es6 b/assets/javascripts/discourse/connectors/before-topic-list/subscriptions-campaign-sidebar.js.es6 new file mode 100644 index 0000000..8586827 --- /dev/null +++ b/assets/javascripts/discourse/connectors/before-topic-list/subscriptions-campaign-sidebar.js.es6 @@ -0,0 +1,10 @@ +export default { + shouldRender(args, component) { + const { siteSettings } = component; + const mobileView = component.site.mobileView; + const bannerLocation = + siteSettings.discourse_subscriptions_campaign_banner_location; + + return bannerLocation === "Sidebar" && !mobileView; + }, +}; diff --git a/assets/javascripts/discourse/templates/connectors/above-main-container/subscriptions-campaign.hbs b/assets/javascripts/discourse/templates/connectors/above-main-container/subscriptions-campaign.hbs index bf210b2..e792a6c 100644 --- a/assets/javascripts/discourse/templates/connectors/above-main-container/subscriptions-campaign.hbs +++ b/assets/javascripts/discourse/templates/connectors/above-main-container/subscriptions-campaign.hbs @@ -1,3 +1 @@ -{{#unless (eq siteSettings.discourse_subscriptions_campaign_banner_location "Sidebar")}} - {{campaign-banner}} -{{/unless}} \ No newline at end of file +{{campaign-banner}} diff --git a/assets/javascripts/discourse/templates/connectors/before-topic-list/subscriptions-campaign-sidebar.hbs b/assets/javascripts/discourse/templates/connectors/before-topic-list/subscriptions-campaign-sidebar.hbs index 68316a0..e792a6c 100644 --- a/assets/javascripts/discourse/templates/connectors/before-topic-list/subscriptions-campaign-sidebar.hbs +++ b/assets/javascripts/discourse/templates/connectors/before-topic-list/subscriptions-campaign-sidebar.hbs @@ -1,3 +1 @@ -{{#if (eq siteSettings.discourse_subscriptions_campaign_banner_location "Sidebar")}} - {{campaign-banner}} -{{/if}} \ No newline at end of file +{{campaign-banner}} diff --git a/assets/stylesheets/common/layout.scss b/assets/stylesheets/common/layout.scss index e9aafa7..4b33c84 100644 --- a/assets/stylesheets/common/layout.scss +++ b/assets/stylesheets/common/layout.scss @@ -7,6 +7,8 @@ @include breakpoint(medium) { flex-direction: column; + margin: 0; + padding: 0.5em; } .section-column { @@ -26,10 +28,12 @@ &:last-child { order: 2; + margin-left: 0; } &:first-child { order: 1; + margin-right: 0; } } } diff --git a/assets/stylesheets/common/subscribe.scss b/assets/stylesheets/common/subscribe.scss index 82480a2..55b04f9 100644 --- a/assets/stylesheets/common/subscribe.scss +++ b/assets/stylesheets/common/subscribe.scss @@ -1,13 +1,13 @@ .subscribe-buttons { display: flex; - justify-content: space-around; + flex-flow: row wrap; + justify-content: left; .btn-discourse-subscriptions-subscribe { flex-direction: column; - padding: 10px 20px; - div { - margin-bottom: 5px; - } + margin: 0.25em; + padding: 1em; + width: 6em; } }