From bbfb37dd8fc97ba9dd2674f066dd92ff311b2257 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 22 Mar 2018 00:52:06 +0530 Subject: [PATCH 01/16] new plugins section --- datacenterlight/cms_models.py | 35 +++++++++++++++++++ datacenterlight/cms_plugins.py | 31 ++++++++++++++-- .../static/datacenterlight/js/main.js | 12 ++++--- .../datacenterlight/cms/calculator.html | 17 ++------- .../cms/includes/_section_split_content.html | 21 +++++++++++ .../datacenterlight/cms/section.html | 34 ++++-------------- .../datacenterlight/cms/section_promo.html | 11 ++++++ datacenterlight/templatetags/custom_tags.py | 7 +++- 8 files changed, 118 insertions(+), 50 deletions(-) create mode 100644 datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html create mode 100644 datacenterlight/templates/datacenterlight/cms/section_promo.html diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index df54589e..214a2e90 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -200,3 +200,38 @@ class DCLSectionImagePluginModel(CMSPlugin): max_length=100, null=True, blank=True, help_text='Optional caption for the image.' ) + + +class DCLSectionPromoPluginModel(CMSPlugin): + background_image = FilerImageField( + on_delete=models.CASCADE, null=True, blank=True, + help_text=('Optional background image for the Promo Section'), + related_name="dcl_section_promo_promo", + ) + heading = models.CharField( + blank=True, null=True, max_length=100, + help_text='An optional heading for the Promo Section', + ) + subheading = models.CharField( + blank=True, null=True, max_length=200, + help_text='An optional subheading for the Promo Section', + ) + content = HTMLField() + html_id = models.SlugField( + blank=True, null=True, + help_text=( + 'An optional html id for the Section. Required to set as target ' + 'of a link on page' + ) + ) + plain_heading = models.BooleanField( + default=False, + help_text='Select to keep the heading style simpler.' + ) + center_on_mobile = models.BooleanField( + default=False, + help_text='Select to center align content on small screens.' + ) + + def __str__(self): + return '#' + self.html_id if self.html_id else str(self.pk) diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py index 60992889..42e8719f 100644 --- a/datacenterlight/cms_plugins.py +++ b/datacenterlight/cms_plugins.py @@ -5,7 +5,8 @@ from .cms_models import ( DCLBannerItemPluginModel, DCLBannerListPluginModel, DCLContactPluginModel, DCLFooterPluginModel, DCLLinkPluginModel, DCLNavbarDropdownPluginModel, DCLSectionIconPluginModel, DCLSectionImagePluginModel, - DCLSectionPluginModel, DCLNavbarPluginModel + DCLSectionPluginModel, DCLNavbarPluginModel, + DCLSectionPromoPluginModel ) from .models import VMTemplate @@ -18,7 +19,24 @@ class DCLSectionPlugin(CMSPluginBase): render_template = "datacenterlight/cms/section.html" cache = False allow_children = True - child_classes = ['DCLSectionIconPlugin', 'DCLSectionImagePlugin'] + child_classes = [ + 'DCLSectionIconPlugin', 'DCLSectionImagePlugin', + 'DCLSectionPromoPlugin', 'UngleichHTMLPlugin' + ] + + def render(self, context, instance, placeholder): + context = super(DCLSectionPlugin, self).render( + context, instance, placeholder + ) + context['children_to_right'] = [] + context['children_to_left'] = [] + if instance.child_plugin_instances is not None: + for child in instance.child_plugin_instances: + if child.__class__.__name__ == 'DCLSectionImagePluginModel': + context['children_to_right'].append(child) + else: + context['children_to_left'].append(child) + return context @plugin_pool.register_plugin @@ -41,6 +59,15 @@ class DCLSectionImagePlugin(CMSPluginBase): require_parent = True +@plugin_pool.register_plugin +class DCLSectionPromoPlugin(CMSPluginBase): + module = "Datacenterlight" + name = "DCL Section Promo Plugin" + model = DCLSectionPromoPluginModel + render_template = "datacenterlight/cms/section_promo.html" + cache = False + + @plugin_pool.register_plugin class DCLCalculatorPlugin(CMSPluginBase): module = "Datacenterlight" diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index 10412824..5e919045 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -107,10 +107,14 @@ var href = $(this).attr('href'); $('.navbar-collapse').removeClass('in'); $('.navbar-collapse').addClass('collapsing'); - if ($(href).length) { - $('html, body').animate({ - scrollTop: $(href).offset().top - 50 - }, 1000); + if (href[0] === "#") { + if ($(href).length) { + $('html, body').animate({ + scrollTop: $(href).offset().top - 50 + }, 1000); + } + } else if (href) { + window.location = href; } }); } diff --git a/datacenterlight/templates/datacenterlight/cms/calculator.html b/datacenterlight/templates/datacenterlight/cms/calculator.html index 5ea97e84..27d1f89c 100644 --- a/datacenterlight/templates/datacenterlight/cms/calculator.html +++ b/datacenterlight/templates/datacenterlight/cms/calculator.html @@ -1,21 +1,8 @@
-
-
- {% if instance.heading %} -
-

{{ instance.heading }}

-
- {% endif %} - {% if instance.content %} -
-
- {{ instance.content }} -
-
- {% endif %} -
+
+ {% include "datacenterlight/cms/includes/_section_split_content.html" %}
diff --git a/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html new file mode 100644 index 00000000..38db14d5 --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html @@ -0,0 +1,21 @@ +{% load cms_tags %} + +{% if instance.heading %} +
+

{{ instance.heading }}

+
+{% endif %} +{% if instance.content %} +
+
+ {{ instance.content }} +
+
+{% endif %} +{% if children_to_left|length %} +
+ {% for plugin in children_to_left %} + {% render_plugin plugin %} + {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/section.html b/datacenterlight/templates/datacenterlight/cms/section.html index bdef3196..7500ceb3 100644 --- a/datacenterlight/templates/datacenterlight/cms/section.html +++ b/datacenterlight/templates/datacenterlight/cms/section.html @@ -1,26 +1,15 @@ {% load cms_tags %} -
+
- {% if instance.child_plugin_instances|length %} + {% if children_to_right|length %}
- {% if instance.heading %} -
-

{{ instance.heading }}

-
- {% endif %} - {% if instance.content %} -
-
- {{ instance.content }} -
-
- {% endif %} + {% include "datacenterlight/cms/includes/_section_split_content.html" %}
- {% for plugin in instance.child_plugin_instances %} + {% for plugin in children_to_right %} {% render_plugin plugin %} {% endfor %}
@@ -28,19 +17,8 @@
{% else %}
- {% if instance.heading %} -
-

{{ instance.heading }}

-
- {% endif %} - {% if instance.content %} -
-
- {{ instance.content }} -
-
- {% endif %} + {% include "datacenterlight/cms/includes/_section_split_content.html" %}
{% endif %}
-
\ No newline at end of file +
\ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/section_promo.html b/datacenterlight/templates/datacenterlight/cms/section_promo.html new file mode 100644 index 00000000..46a6b67c --- /dev/null +++ b/datacenterlight/templates/datacenterlight/cms/section_promo.html @@ -0,0 +1,11 @@ +
+ {% if instance.heading %} +

{{instance.heading}}

+ {% endif %} + {% if instance.subheading %} +

{{instance.subheading}}

+ {% endif %} + {% if instance.content %} +

{{instance.content}}

+ {% endif %} +
\ No newline at end of file diff --git a/datacenterlight/templatetags/custom_tags.py b/datacenterlight/templatetags/custom_tags.py index 908b1f89..2ff32bf1 100644 --- a/datacenterlight/templatetags/custom_tags.py +++ b/datacenterlight/templatetags/custom_tags.py @@ -41,4 +41,9 @@ def multiply(value, arg): :param arg: :return: """ - return value*arg + return value * arg + + +@register.filter('instance_class') +def instance_class(obj): + return obj.__class__.__name__ From 8a3ddda93e835766501ecbab2c25ba9d9853ea49 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 00:50:01 +0530 Subject: [PATCH 02/16] promo section styling --- datacenterlight/cms_models.py | 12 +++- .../datacenterlight/css/landing-page.css | 60 +++++++++++++++++++ .../cms/includes/_section_split_content.html | 3 +- .../datacenterlight/cms/section_promo.html | 22 +++---- 4 files changed, 85 insertions(+), 12 deletions(-) diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index c7a68a07..d5ec180c 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -232,10 +232,20 @@ class DCLSectionPromoPluginModel(CMSPlugin): default=False, help_text='Select to keep the heading style simpler.' ) - center_on_mobile = models.BooleanField( + text_center = models.BooleanField( default=False, help_text='Select to center align content on small screens.' ) def __str__(self): return '#' + self.html_id if self.html_id else str(self.pk) + + def get_extra_classes(self): + extra_classes = '' + if self.text_center: + extra_classes += ' text-center' + if self.plain_heading: + extra_classes += ' promo-section-plain' + if self.background_image: + extra_classes += ' promo-with-bg' + return extra_classes diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 5ff6ed1d..34f3a9e3 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1268,3 +1268,63 @@ footer .dcl-link-separator::before { font-size: 30px; } } + + +/* cms section promo */ + +.promo-section { + padding: 75px 15px; +} + +.promo-section.promo-with-bg { + color: #fff; + background-size: cover; + background-position: center; +} + +.promo-section h3 { + font-weight: 700; + font-size: 36px; + text-transform: uppercase; + letter-spacing: 0.5px; + margin-top: 10px; + margin-bottom: 25px; +} + +.promo-section h4 { + font-size: 24px; + margin-bottom: 20px; +} + +.promo-section p { + font-size: 18px; +} + +.promo-section.text-center h3, +.promo-section.text-center h4 { + margin-bottom: 35px; +} + +.split-text .split-subsection { + margin-top: 25px; + margin-bottom: 25px; +} + +.split-text .promo-section { + padding: 20px 15px; + margin-top: 30px; + margin-bottom: 30px; +} + +.split-text .promo-section .container { + width: auto; +} + +.split-text .promo-section h3, +.split-text .promo-section h4 { + margin-bottom: 15px; +} + +.promo-section-plain h3 { + font-weight: 400; +} \ No newline at end of file diff --git a/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html index 38db14d5..a5a5119c 100644 --- a/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html +++ b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html @@ -1,5 +1,6 @@ {% load cms_tags %} + {% if instance.heading %}

{{ instance.heading }}

@@ -13,7 +14,7 @@
{% endif %} {% if children_to_left|length %} -
+
{% for plugin in children_to_left %} {% render_plugin plugin %} {% endfor %} diff --git a/datacenterlight/templates/datacenterlight/cms/section_promo.html b/datacenterlight/templates/datacenterlight/cms/section_promo.html index 46a6b67c..7a4ad455 100644 --- a/datacenterlight/templates/datacenterlight/cms/section_promo.html +++ b/datacenterlight/templates/datacenterlight/cms/section_promo.html @@ -1,11 +1,13 @@ -
- {% if instance.heading %} -

{{instance.heading}}

- {% endif %} - {% if instance.subheading %} -

{{instance.subheading}}

- {% endif %} - {% if instance.content %} -

{{instance.content}}

- {% endif %} +
+
+ {% if instance.heading %} +

{{instance.heading}}

+ {% endif %} + {% if instance.subheading %} +

{{instance.subheading}}

+ {% endif %} + {% if instance.content %} +

{{instance.content}}

+ {% endif %} +
\ No newline at end of file From ef1f19d6982445c4d6226322a60950b40e8a0724 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 00:54:34 +0530 Subject: [PATCH 03/16] migrations --- .../0014_dclsectionpromopluginmodel.py | 37 +++++++++++++++++++ .../migrations/0015_auto_20180323_0011.py | 21 +++++++++++ 2 files changed, 58 insertions(+) create mode 100644 datacenterlight/migrations/0014_dclsectionpromopluginmodel.py create mode 100644 datacenterlight/migrations/0015_auto_20180323_0011.py diff --git a/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py b/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py new file mode 100644 index 00000000..f1a408cd --- /dev/null +++ b/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-03-21 19:09 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import djangocms_text_ckeditor.fields +import filer.fields.image + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0014_auto_20160404_1908'), + ('filer', '0005_auto_20171219_1856'), + ('datacenterlight', '0013_dclnavbarpluginmodel'), + ] + + operations = [ + migrations.CreateModel( + name='DCLSectionPromoPluginModel', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('heading', models.CharField(blank=True, help_text='An optional heading for the Promo Section', max_length=100, null=True)), + ('subheading', models.CharField(blank=True, help_text='An optional subheading for the Promo Section', max_length=200, null=True)), + ('content', djangocms_text_ckeditor.fields.HTMLField()), + ('html_id', models.SlugField(blank=True, help_text='An optional html id for the Section. Required to set as target of a link on page', null=True)), + ('plain_heading', models.BooleanField(default=False, help_text='Select to keep the heading style simpler.')), + ('center_on_mobile', models.BooleanField(default=False, help_text='Select to center align content on small screens.')), + ('background_image', filer.fields.image.FilerImageField(blank=True, help_text='Optional background image for the Promo Section', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dcl_section_promo_promo', to='filer.Image')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + ] diff --git a/datacenterlight/migrations/0015_auto_20180323_0011.py b/datacenterlight/migrations/0015_auto_20180323_0011.py new file mode 100644 index 00000000..a46cb789 --- /dev/null +++ b/datacenterlight/migrations/0015_auto_20180323_0011.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2018-03-22 19:22 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('datacenterlight', '0014_dclsectionpromopluginmodel'), + ('datacenterlight', '0014_dclnavbarpluginmodel_language_dropdown'), + ] + + operations = [ + migrations.RenameField( + model_name='dclsectionpromopluginmodel', + old_name='center_on_mobile', + new_name='text_center', + ), + ] From 5e8f21c8e3d6724bc027163151c4395e32434e75 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 01:07:53 +0530 Subject: [PATCH 04/16] remove template tag --- .../cms/includes/_section_split_content.html | 1 - datacenterlight/templatetags/custom_tags.py | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html index a5a5119c..9323b52f 100644 --- a/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html +++ b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html @@ -1,6 +1,5 @@ {% load cms_tags %} - {% if instance.heading %}

{{ instance.heading }}

diff --git a/datacenterlight/templatetags/custom_tags.py b/datacenterlight/templatetags/custom_tags.py index 2ff32bf1..908b1f89 100644 --- a/datacenterlight/templatetags/custom_tags.py +++ b/datacenterlight/templatetags/custom_tags.py @@ -41,9 +41,4 @@ def multiply(value, arg): :param arg: :return: """ - return value * arg - - -@register.filter('instance_class') -def instance_class(obj): - return obj.__class__.__name__ + return value*arg From d74fdf947281d91200453469c0b26865101d7fb4 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 01:14:57 +0530 Subject: [PATCH 05/16] fix migrations --- ..._dclnavbarpluginmodel_language_dropdown.py | 4 +++- .../0014_dclsectionpromopluginmodel.py | 22 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py b/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py index 2c5e6306..e3e9982d 100644 --- a/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py +++ b/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py @@ -9,12 +9,14 @@ class Migration(migrations.Migration): dependencies = [ ('datacenterlight', '0013_dclnavbarpluginmodel'), + ('filer', '0005_auto_20171219_1856'), ] operations = [ migrations.AddField( model_name='dclnavbarpluginmodel', name='language_dropdown', - field=models.BooleanField(default=True, help_text='Select to include the language selection dropdown.'), + field=models.BooleanField( + default=True, help_text='Select to include the language selection dropdown.'), ), ] diff --git a/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py b/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py index f1a408cd..81e8d6f0 100644 --- a/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py +++ b/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py @@ -12,7 +12,6 @@ class Migration(migrations.Migration): dependencies = [ ('cms', '0014_auto_20160404_1908'), - ('filer', '0005_auto_20171219_1856'), ('datacenterlight', '0013_dclnavbarpluginmodel'), ] @@ -20,14 +19,21 @@ class Migration(migrations.Migration): migrations.CreateModel( name='DCLSectionPromoPluginModel', fields=[ - ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), - ('heading', models.CharField(blank=True, help_text='An optional heading for the Promo Section', max_length=100, null=True)), - ('subheading', models.CharField(blank=True, help_text='An optional subheading for the Promo Section', max_length=200, null=True)), + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, + parent_link=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('heading', models.CharField( + blank=True, help_text='An optional heading for the Promo Section', max_length=100, null=True)), + ('subheading', models.CharField( + blank=True, help_text='An optional subheading for the Promo Section', max_length=200, null=True)), ('content', djangocms_text_ckeditor.fields.HTMLField()), - ('html_id', models.SlugField(blank=True, help_text='An optional html id for the Section. Required to set as target of a link on page', null=True)), - ('plain_heading', models.BooleanField(default=False, help_text='Select to keep the heading style simpler.')), - ('center_on_mobile', models.BooleanField(default=False, help_text='Select to center align content on small screens.')), - ('background_image', filer.fields.image.FilerImageField(blank=True, help_text='Optional background image for the Promo Section', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dcl_section_promo_promo', to='filer.Image')), + ('html_id', models.SlugField( + blank=True, help_text='An optional html id for the Section. Required to set as target of a link on page', null=True)), + ('plain_heading', models.BooleanField(default=False, + help_text='Select to keep the heading style simpler.')), + ('center_on_mobile', models.BooleanField(default=False, + help_text='Select to center align content on small screens.')), + ('background_image', filer.fields.image.FilerImageField(blank=True, help_text='Optional background image for the Promo Section', + null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dcl_section_promo_promo', to='filer.Image')), ], options={ 'abstract': False, From d7fc4e686fbff770f45caa789d3ba8dba75f89b2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 01:17:09 +0530 Subject: [PATCH 06/16] fix migrations --- .../migrations/0014_dclnavbarpluginmodel_language_dropdown.py | 1 - datacenterlight/migrations/0014_dclsectionpromopluginmodel.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py b/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py index e3e9982d..ba90af39 100644 --- a/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py +++ b/datacenterlight/migrations/0014_dclnavbarpluginmodel_language_dropdown.py @@ -9,7 +9,6 @@ class Migration(migrations.Migration): dependencies = [ ('datacenterlight', '0013_dclnavbarpluginmodel'), - ('filer', '0005_auto_20171219_1856'), ] operations = [ diff --git a/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py b/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py index 81e8d6f0..86de7d14 100644 --- a/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py +++ b/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py @@ -12,6 +12,7 @@ class Migration(migrations.Migration): dependencies = [ ('cms', '0014_auto_20160404_1908'), + ('filer', '0005_auto_20171219_1856'), ('datacenterlight', '0013_dclnavbarpluginmodel'), ] From 414b783983b2e5feeea3a9a6339aeb13bbc75e91 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 01:18:03 +0530 Subject: [PATCH 07/16] fix unreferenced migrations --- datacenterlight/migrations/0014_dclsectionpromopluginmodel.py | 1 - 1 file changed, 1 deletion(-) diff --git a/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py b/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py index 86de7d14..81e8d6f0 100644 --- a/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py +++ b/datacenterlight/migrations/0014_dclsectionpromopluginmodel.py @@ -12,7 +12,6 @@ class Migration(migrations.Migration): dependencies = [ ('cms', '0014_auto_20160404_1908'), - ('filer', '0005_auto_20171219_1856'), ('datacenterlight', '0013_dclnavbarpluginmodel'), ] From 9a57c3341e340c515a741359f623c0bd6e42718a Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 01:27:51 +0530 Subject: [PATCH 08/16] sectioniconplugin placement fix --- datacenterlight/cms_plugins.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py index 42e8719f..40f3c098 100644 --- a/datacenterlight/cms_plugins.py +++ b/datacenterlight/cms_plugins.py @@ -31,8 +31,12 @@ class DCLSectionPlugin(CMSPluginBase): context['children_to_right'] = [] context['children_to_left'] = [] if instance.child_plugin_instances is not None: + right_children = [ + 'DCLSectionImagePluginModel', + 'DCLSectionIconPluginModel' + ] for child in instance.child_plugin_instances: - if child.__class__.__name__ == 'DCLSectionImagePluginModel': + if child.__class__.__name__ in right_children: context['children_to_right'].append(child) else: context['children_to_left'].append(child) From a1d01fd1efa60794a22e5783a6dd4c4e9bb18d3c Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 01:47:03 +0530 Subject: [PATCH 09/16] wide promo section text maxwidth --- datacenterlight/static/datacenterlight/css/landing-page.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 34f3a9e3..4398a9fb 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1300,6 +1300,11 @@ footer .dcl-link-separator::before { font-size: 18px; } +.promo-section.text-center p { + max-width: 720px; + margin: auto; +} + .promo-section.text-center h3, .promo-section.text-center h4 { margin-bottom: 35px; From c3e83599a218e79c1df940b5af958feff53facb2 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 02:54:24 +0530 Subject: [PATCH 10/16] mobile side padding reduced --- .../static/datacenterlight/css/landing-page.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 4398a9fb..eb3dca07 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1332,4 +1332,11 @@ footer .dcl-link-separator::before { .promo-section-plain h3 { font-weight: 400; +} + +@media (max-width: 767px) { + .split-text .split-subsection { + margin-left: -15px; + margin-right: -15px; + } } \ No newline at end of file From 3484b75d8b632d74d2dbc6dae60fc0feb3690e49 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 03:22:29 +0530 Subject: [PATCH 11/16] calculaotr plugin allows child promo and html plugin --- datacenterlight/cms_plugins.py | 18 ++++++++++++++---- .../cms/includes/_section_split_content.html | 4 ++-- .../templates/datacenterlight/cms/section.html | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/datacenterlight/cms_plugins.py b/datacenterlight/cms_plugins.py index 40f3c098..a1a3833d 100644 --- a/datacenterlight/cms_plugins.py +++ b/datacenterlight/cms_plugins.py @@ -28,8 +28,8 @@ class DCLSectionPlugin(CMSPluginBase): context = super(DCLSectionPlugin, self).render( context, instance, placeholder ) - context['children_to_right'] = [] - context['children_to_left'] = [] + context['children_to_side'] = [] + context['children_to_content'] = [] if instance.child_plugin_instances is not None: right_children = [ 'DCLSectionImagePluginModel', @@ -37,9 +37,9 @@ class DCLSectionPlugin(CMSPluginBase): ] for child in instance.child_plugin_instances: if child.__class__.__name__ in right_children: - context['children_to_right'].append(child) + context['children_to_side'].append(child) else: - context['children_to_left'].append(child) + context['children_to_content'].append(child) return context @@ -79,12 +79,22 @@ class DCLCalculatorPlugin(CMSPluginBase): model = DCLSectionPluginModel render_template = "datacenterlight/cms/calculator.html" cache = False + allow_children = True + child_classes = [ + 'DCLSectionPromoPlugin', 'UngleichHTMLPlugin' + ] def render(self, context, instance, placeholder): context = super(DCLCalculatorPlugin, self).render( context, instance, placeholder ) context['templates'] = VMTemplate.objects.all() + context['children_to_side'] = [] + context['children_to_content'] = [] + if instance.child_plugin_instances is not None: + context['children_to_content'].extend( + instance.child_plugin_instances + ) return context diff --git a/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html index 9323b52f..0f41740f 100644 --- a/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html +++ b/datacenterlight/templates/datacenterlight/cms/includes/_section_split_content.html @@ -12,9 +12,9 @@
{% endif %} -{% if children_to_left|length %} +{% if children_to_content|length %}
- {% for plugin in children_to_left %} + {% for plugin in children_to_content %} {% render_plugin plugin %} {% endfor %}
diff --git a/datacenterlight/templates/datacenterlight/cms/section.html b/datacenterlight/templates/datacenterlight/cms/section.html index 7500ceb3..5a420a99 100644 --- a/datacenterlight/templates/datacenterlight/cms/section.html +++ b/datacenterlight/templates/datacenterlight/cms/section.html @@ -2,14 +2,14 @@
- {% if children_to_right|length %} + {% if children_to_side|length %}
{% include "datacenterlight/cms/includes/_section_split_content.html" %}
- {% for plugin in children_to_right %} + {% for plugin in children_to_side %} {% render_plugin plugin %} {% endfor %}
From dfe47e43a213081bf50b1a0001a274a96077d626 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Fri, 23 Mar 2018 04:36:40 +0530 Subject: [PATCH 12/16] lineheight fix and line break filter --- datacenterlight/cms_models.py | 2 +- .../static/datacenterlight/css/landing-page.css | 1 + .../templates/datacenterlight/cms/section_promo.html | 4 +++- datacenterlight/templatetags/custom_tags.py | 12 +++++++++++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/datacenterlight/cms_models.py b/datacenterlight/cms_models.py index d5ec180c..8c9ae740 100644 --- a/datacenterlight/cms_models.py +++ b/datacenterlight/cms_models.py @@ -1,7 +1,7 @@ -from djangocms_text_ckeditor.fields import HTMLField from cms.models.pluginmodel import CMSPlugin from django.db import models from django.utils.safestring import mark_safe +from djangocms_text_ckeditor.fields import HTMLField from filer.fields.image import FilerImageField # Models for CMS Plugins diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index eb3dca07..2e1f36e7 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1298,6 +1298,7 @@ footer .dcl-link-separator::before { .promo-section p { font-size: 18px; + line-height: 1.5; } .promo-section.text-center p { diff --git a/datacenterlight/templates/datacenterlight/cms/section_promo.html b/datacenterlight/templates/datacenterlight/cms/section_promo.html index 7a4ad455..c3301225 100644 --- a/datacenterlight/templates/datacenterlight/cms/section_promo.html +++ b/datacenterlight/templates/datacenterlight/cms/section_promo.html @@ -1,7 +1,9 @@ +{% load custom_tags %} +
{% if instance.heading %} -

{{instance.heading}}

+

{{instance.heading|escaped_line_break|linebreaksbr}}

{% endif %} {% if instance.subheading %}

{{instance.subheading}}

diff --git a/datacenterlight/templatetags/custom_tags.py b/datacenterlight/templatetags/custom_tags.py index 908b1f89..a2b20bcb 100644 --- a/datacenterlight/templatetags/custom_tags.py +++ b/datacenterlight/templatetags/custom_tags.py @@ -41,4 +41,14 @@ def multiply(value, arg): :param arg: :return: """ - return value*arg + return value * arg + + +@register.filter('escaped_line_break') +def escaped_line_break(value): + """ + usage: {{ text|escaped_line_break }} + :param value: + :return: + """ + return value.replace("\\n", "\n") From ee65c61f9537dfd5b87fcce87411e553d140d61e Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 25 Mar 2018 20:49:19 +0530 Subject: [PATCH 13/16] promo heading font size reduced for mobile --- .../static/datacenterlight/css/landing-page.css | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 2e1f36e7..0ea1ee9b 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1331,13 +1331,12 @@ footer .dcl-link-separator::before { margin-bottom: 15px; } -.promo-section-plain h3 { - font-weight: 400; -} - @media (max-width: 767px) { .split-text .split-subsection { margin-left: -15px; margin-right: -15px; } + .promo-section h3 { + font-size: 29px; + } } \ No newline at end of file From 412f1f15089ff099bfa824c06e6bfff781dbbed4 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 25 Mar 2018 21:01:59 +0530 Subject: [PATCH 14/16] right section alignment fix --- .../static/datacenterlight/css/landing-page.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 0ea1ee9b..5cd685da 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -536,14 +536,14 @@ textarea { .split-section-plain .split-figure { width: 41.66666667%; } - .split-section-plain .split-figure.col-sm-push-6 { - left: 58.33333333%; + .split-section-plain .split-figure.col-sm-pull-6 { + right: 58.33333333%; } .split-section-plain .split-text { width: 58.33333333%; } - .split-section-plain .split-text.col-sm-pull-6 { - right: 41.66666667%; + .split-section-plain .split-text.col-sm-push-6 { + left: 41.66666667%; } } From bd23d9462bd6e7f6d03009144e9704e4a21173bb Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 25 Mar 2018 21:06:08 +0530 Subject: [PATCH 15/16] mobile font fix --- datacenterlight/static/datacenterlight/css/landing-page.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 5cd685da..07ea61f0 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1070,8 +1070,8 @@ textarea { line-height: 35px; } .split-section .split-title h2 { - font-size: 35px; - line-height: 35px; + font-size: 32px; + line-height: 34px; } .contact-section .title { margin: 0 auto; From 880ee3af4a0f3a819074609a5a185a5bb7ece64a Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Sun, 25 Mar 2018 22:16:46 +0530 Subject: [PATCH 16/16] padding fix for mobile --- datacenterlight/static/datacenterlight/css/landing-page.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 07ea61f0..3ac46295 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -1339,4 +1339,8 @@ footer .dcl-link-separator::before { .promo-section h3 { font-size: 29px; } + .split-text .promo-section { + padding-left: 0; + padding-right: 0; + } } \ No newline at end of file