From b6f130973541f525492af8a5990e6a26e10d1f59 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 09:06:45 +0200 Subject: [PATCH 01/55] Add glasfaser_cms_page.html --- dynamicweb/settings/base.py | 1 + .../ungleich_page/glasfaser_cms_page.html | 315 ++++++++++++++++++ 2 files changed, 316 insertions(+) create mode 100644 ungleich_page/templates/ungleich_page/glasfaser_cms_page.html diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 5af1a6ca..58e9065a 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -218,6 +218,7 @@ CMS_TEMPLATES = ( ('page.html', gettext('Page')), # dcl ('datacenterlight/cms_page.html', gettext('Data Center Light')), + ('ungleich_page/glasfaser_cms_page.html', gettext('Glasfaser')), ) DATABASES = { diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html new file mode 100644 index 00000000..a218090b --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -0,0 +1,315 @@ +{% load static bootstrap3 i18n cms_tags sekizai_tags %} +{% get_current_language as LANGUAGE_CODE %} + + + + + + + + + + + ungleich GmbH + + + + + + + + + + + + + + + + + {% render_block "css" postprocessor "compressor.contrib.sekizai.compress" %} + {% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %} + + + {% include "google_analytics.html" %} + + + + + + +{% cms_toolbar %} + + + {% placeholder 'one' %} + +
+
+
+
+

{% placeholder 'glasfaser_cms_page_text' %}

+
+
+

Surfen Sie mit 100 Mbit/s im Internet!

+

Mit dem neuen Glasfaser-Angebot der ungleich macht das Arbeiten im Internet richtig Spass. Das beste daran: die Geschwindigkeit symmetrisch in beide Richtungen verfügbar. Damit kann ihr Firmennetzwerk auch Dienste bereitstellen.

+

Dieses Angebot ist im Moment ausschliesslich für Firmenkunden verfügbar. Die Aufschaltkosten der Glasfaserleitung sind von der Entfernung zum nächsten Anschlusspunkt abhängig. Fragen Sie noch heute nach einem individuellem Angebot.

+
+
+
+
+
+
+
+
+

Was ist es?

+

+
+
+

Bei diesem Angebot handelt es sich um einen Internetzugang für Firmenkunden.

+

Sie erhalten in Zusammenarbeit mit unseren Partnern einen Glasfaseranschluss und eine Internetverbindung.

+
+
+
+
+ +
+
+
+

Technische Details

+

Im Angebot enthalten sind

+
+
+
+
+ +
+

Business-Internet

+

Symmetrische Internetleitung 100 Mbit/s upload und 100 Mbit/s download

+

Glasfaser-Installation bis ins Haus (keine Hausverkabelung)

+
+
+
+
+
+ +
+

Erreichbarkeit im Internet

+

1 öffentliches IPv6-Netzwerk (/64)

+

1 öffentliche IPv4-Adresse

+
+
+
+
+
+ +
+

Einfach zu nutzen

+

2 vorkonfigurierte Endgeräte (benötigt zwei Steckdosen auf Ihrer Seite)

+

Einfach einstecken und los!

+
+
+
+
+
+
+ + +
+
+
+

Wie funktioniert es?

+

So kommen Sie in wenigen einfachen Schritten zu Ihrem High-Speed-Internet

+
+
+
+
    +
  • +
    + +
    +
    +
    +

    Senden Sie uns via E-Mail Ihren Firmennamen und Ihre Anschrift zu.

    +
    +
    +
  • +
  • +
    + +
    +
    +
    +

    Wir prüfen dann die Entfernung zum nächsten Anschlusspunkt und schicken Ihnen eine Offerte zu.

    +
    +
    +
  • +
  • +
    + +
    +
    +
    +

    Sollten Sie dem Angebot zustimmen, wird die Glasfaser zu Ihrem Standort verlegt und die Endgeräte installiert.

    +
    +
    +
  • +
  • +
    + +
    +
    +
    +

    Sie müssen dann nur noch Ihre Geräte anschliessen und schon surfen Sie bllitzschnell im Internet!

    +
    +
    +
  • +
+
+
+
+
+ + +
+
+
+
+
+
+

Kontakt

+
+
+
+

ungleich GmbH

+
+
+

glasfaser@ungleich.ch

+

In der Au 7, Schwanden 8762

+

Switzerland

+
+
+ +
+
+
+ {% if success %} +
+
+

{% trans "Thank you for contacting us." %}

+
+

+ {% trans "Your message was successfully sent to our team." %} +

+
+ {% else %} +
+
+
+

Senden Sie uns eine Nachricht.

+
+
+
+
+ {% csrf_token %} + +
+ +
+ + {{contact_form.name.errors}} +
+
+
+ +
+ + {{contact_form.email.errors}} +
+
+
+ +
+ + {{contact_form.message.errors}} +
+
+
+
+
{% trans "Sorry, there was an unexpected error. Kindly retry." %}
+ +
+
+
+ {% endif %} +
+
+
+
+
+
+ + + + {% include "ungleich_page/includes/_footer.html" %} + + + + + + + + + + + + + + + + + + + + From a5dea2b399f111e5f755fbf744da81f349b0515c Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 09:30:52 +0200 Subject: [PATCH 02/55] Add ungleich_page cms_plugins and section templates --- ungleich_page/cms_plugins.py | 17 ++++ .../glasfaser/section_contact.html | 83 +++++++++++++++++++ .../glasfaser/section_with_image.html | 10 +++ 3 files changed, 110 insertions(+) create mode 100644 ungleich_page/cms_plugins.py create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/section_contact.html create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py new file mode 100644 index 00000000..21c6f8d9 --- /dev/null +++ b/ungleich_page/cms_plugins.py @@ -0,0 +1,17 @@ +from cms.plugin_base import CMSPluginBase +from cms.plugin_pool import plugin_pool +from cms.models.pluginmodel import CMSPlugin + + +@plugin_pool.register_plugin +class SectionWithImagePlugin(CMSPluginBase): + model = CMSPlugin + render_template = "ungleich_page/glasfaser/section_with_image.html" + cache = False + + +@plugin_pool.register_plugin +class SectionContact(CMSPluginBase): + model = CMSPlugin + render_template = "ungleich_page/glasfaser/section_contact.html" + cache = False diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html new file mode 100644 index 00000000..4fb74d8f --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html @@ -0,0 +1,83 @@ +{% load i18n %} + +
+
+
+
+
+
+

Kontakt

+
+
+
+

ungleich GmbH

+
+
+

glasfaser@ungleich.ch

+

In der Au 7, Schwanden 8762

+

Switzerland

+
+
+ +
+
+
+ {% if success %} +
+
+

{% trans "Thank you for contacting us." %}

+
+

+ {% trans "Your message was successfully sent to our team." %} +

+
+ {% else %} +
+
+
+

Senden Sie uns eine Nachricht.

+
+
+
+
+ {% csrf_token %} + +
+ +
+ + {{contact_form.name.errors}} +
+
+
+ +
+ + {{contact_form.email.errors}} +
+
+
+ +
+ + {{contact_form.message.errors}} +
+
+
+
+
{% trans "Sorry, there was an unexpected error. Kindly retry." %}
+ +
+
+
+ {% endif %} +
+
+
+
+
+
\ No newline at end of file diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html new file mode 100644 index 00000000..0990a3f2 --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html @@ -0,0 +1,10 @@ +
+
+
+
+
+
+

TEST TEST

+
+
+
\ No newline at end of file From 8e76a1c6713b649f69f0541b8b72328d1812f9f1 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 15:52:30 +0200 Subject: [PATCH 03/55] Set image and title dynamically --- ungleich_page/cms_plugins.py | 14 ++++++++++++-- ungleich_page/models.py | 14 ++++++++++++-- .../glasfaser/section_with_image.html | 7 ++----- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 21c6f8d9..8f2b1883 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -1,14 +1,24 @@ +from cms.models.pluginmodel import CMSPlugin from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool -from cms.models.pluginmodel import CMSPlugin + +from .models import UngelichPicture @plugin_pool.register_plugin class SectionWithImagePlugin(CMSPluginBase): - model = CMSPlugin + model = UngelichPicture render_template = "ungleich_page/glasfaser/section_with_image.html" cache = False + def render(self, context, instance, placeholder): + context.update({ + 'image': instance.image, + 'object': instance, + 'placeholder': placeholder + }) + return context + @plugin_pool.register_plugin class SectionContact(CMSPluginBase): diff --git a/ungleich_page/models.py b/ungleich_page/models.py index 0b4331b3..4199e6f7 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -1,3 +1,13 @@ -# from django.db import models +from cms.models.pluginmodel import CMSPlugin +from django.db import models +from filer.fields.image import FilerImageField -# Create your models here. + +class UngelichPicture(CMSPlugin): + image = FilerImageField( + null=True, + blank=True, + related_name="image", + on_delete=models.SET_NULL + ) + title = models.CharField(max_length=200) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html index 0990a3f2..b3477ffe 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html @@ -1,10 +1,7 @@ -
-
-
-
+
-

TEST TEST

+

{{ object.title }}

\ No newline at end of file From 4d485ef178f8acacef3c4109c88ff413e679fa6a Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 15:58:27 +0200 Subject: [PATCH 04/55] Add initial ungleich_page migration --- ungleich_page/migrations/0001_initial.py | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 ungleich_page/migrations/0001_initial.py diff --git a/ungleich_page/migrations/0001_initial.py b/ungleich_page/migrations/0001_initial.py new file mode 100644 index 00000000..2f7f8b69 --- /dev/null +++ b/ungleich_page/migrations/0001_initial.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-17 13:41 +from __future__ import unicode_literals + +import django.db.models.deletion +import filer.fields.image +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('cms', '0014_auto_20160404_1908'), + ('filer', '0005_auto_20171017_1252'), + ] + + operations = [ + migrations.CreateModel( + name='UngelichPicture', + 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')), + ('title', models.CharField(max_length=200)), + ('image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='image', to='filer.Image')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + ] From a709485e77afdebdc0110114771bf38563f82935 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 16:02:04 +0200 Subject: [PATCH 05/55] Add missing ids --- .../templates/ungleich_page/glasfaser/section_contact.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html index 4fb74d8f..bc629f2a 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html @@ -49,14 +49,14 @@
- + {{contact_form.name.errors}}
- + {{contact_form.email.errors}}
From 98a9a35b4fa66965eafb5403eeb83d784d728a00 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 16:23:37 +0200 Subject: [PATCH 06/55] Add 0002_ungleichcontactussection.py migration file --- .../0002_ungelichcontactussection.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ungleich_page/migrations/0002_ungelichcontactussection.py diff --git a/ungleich_page/migrations/0002_ungelichcontactussection.py b/ungleich_page/migrations/0002_ungelichcontactussection.py new file mode 100644 index 00000000..2a7d63ab --- /dev/null +++ b/ungleich_page/migrations/0002_ungelichcontactussection.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-17 14:10 +from __future__ import unicode_literals + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0014_auto_20160404_1908'), + ('ungleich_page', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='UngelichContactUsSection', + 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')), + ('email', models.EmailField(max_length=200)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + ] From 92086ad2ea2a10872627e9dcf11fcb4ce0c0276d Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 16:24:19 +0200 Subject: [PATCH 07/55] Obtain email dynamically --- .../templates/ungleich_page/glasfaser/section_contact.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html index bc629f2a..afc089b1 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html @@ -13,7 +13,7 @@

ungleich GmbH

-

glasfaser@ungleich.ch

+

{{instance.email}}

In der Au 7, Schwanden 8762

Switzerland

From ef47e999f1c5da26046c2c882f320733590de23d Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 16:25:01 +0200 Subject: [PATCH 08/55] Create SectionContact CMSPlugin --- ungleich_page/cms_plugins.py | 5 ++--- ungleich_page/models.py | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 8f2b1883..30444d9f 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -1,8 +1,7 @@ -from cms.models.pluginmodel import CMSPlugin from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool -from .models import UngelichPicture +from .models import UngelichPicture, UngelichContactUsSection @plugin_pool.register_plugin @@ -22,6 +21,6 @@ class SectionWithImagePlugin(CMSPluginBase): @plugin_pool.register_plugin class SectionContact(CMSPluginBase): - model = CMSPlugin + model = UngelichContactUsSection render_template = "ungleich_page/glasfaser/section_contact.html" cache = False diff --git a/ungleich_page/models.py b/ungleich_page/models.py index 4199e6f7..3762a1aa 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -11,3 +11,7 @@ class UngelichPicture(CMSPlugin): on_delete=models.SET_NULL ) title = models.CharField(max_length=200) + + +class UngelichContactUsSection(CMSPlugin): + email = models.EmailField(max_length=200) From 27766329c944e349de55af5a83dcc00133fe2293 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 17:46:08 +0200 Subject: [PATCH 09/55] Add dcl glasfaser text section templates --- .../ungleich_page/glasfaser/section_text_dcl.html | 12 ++++++++++++ .../glasfaser/section_text_glasfaser.html | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/section_text_dcl.html create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_text_dcl.html b/ungleich_page/templates/ungleich_page/glasfaser/section_text_dcl.html new file mode 100644 index 00000000..54836fbc --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_text_dcl.html @@ -0,0 +1,12 @@ +
+
+
+
+

{{instance.title}}

+
+
+

{{instance.description}}

+
+
+
+
\ No newline at end of file diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html b/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html new file mode 100644 index 00000000..edb035ce --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html @@ -0,0 +1,13 @@ +
+
+
+
+

{{instance.title}}

+

+
+
+

{{instance.description}}

+
+
+
+
\ No newline at end of file From 14bbfe901def33e1b822ea7400291dad95e807fc Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 17:47:40 +0200 Subject: [PATCH 10/55] Add SectionTextParagraphDCL and SectionTextParagraphGlasfaser --- ungleich_page/cms_plugins.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 30444d9f..a6c8747f 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -1,7 +1,9 @@ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool -from .models import UngelichPicture, UngelichContactUsSection +from .models import ( + UngelichPicture, UngelichContactUsSection, UngelichTextSection +) @plugin_pool.register_plugin @@ -24,3 +26,17 @@ class SectionContact(CMSPluginBase): model = UngelichContactUsSection render_template = "ungleich_page/glasfaser/section_contact.html" cache = False + + +@plugin_pool.register_plugin +class SectionTextParagraphDCL(CMSPluginBase): + model = UngelichTextSection + render_template = "ungleich_page/glasfaser/section_text_dcl.html" + cache = False + + +@plugin_pool.register_plugin +class SectionTextParagraphGlasfaser(CMSPluginBase): + model = UngelichTextSection + render_template = "ungleich_page/glasfaser/section_text_glasfaser.html" + cache = False From e9142b17ae31897361647a8be1ac583215e9b757 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 17:51:01 +0200 Subject: [PATCH 11/55] Add UngleichTextSection --- ungleich_page/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ungleich_page/models.py b/ungleich_page/models.py index 3762a1aa..c371020d 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -1,5 +1,6 @@ from cms.models.pluginmodel import CMSPlugin from django.db import models +from djangocms_text_ckeditor.fields import HTMLField from filer.fields.image import FilerImageField @@ -15,3 +16,8 @@ class UngelichPicture(CMSPlugin): class UngelichContactUsSection(CMSPlugin): email = models.EmailField(max_length=200) + + +class UngelichTextSection(CMSPlugin): + title = models.CharField(max_length=200) + description = HTMLField() From 36a9c386cb3f62d22130b02cd9339bce6b1659e5 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 17:52:01 +0200 Subject: [PATCH 12/55] Add migrations --- .../migrations/0003_ungelichtextsection.py | 29 +++++++++++++++++++ .../migrations/0004_auto_20171017_1519.py | 21 ++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 ungleich_page/migrations/0003_ungelichtextsection.py create mode 100644 ungleich_page/migrations/0004_auto_20171017_1519.py diff --git a/ungleich_page/migrations/0003_ungelichtextsection.py b/ungleich_page/migrations/0003_ungelichtextsection.py new file mode 100644 index 00000000..549f9be8 --- /dev/null +++ b/ungleich_page/migrations/0003_ungelichtextsection.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-17 14:47 +from __future__ import unicode_literals + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0014_auto_20160404_1908'), + ('ungleich_page', '0002_ungelichcontactussection'), + ] + + operations = [ + migrations.CreateModel( + name='UngelichTextSection', + 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')), + ('title', models.CharField(max_length=200)), + ('description', models.TextField()), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + ] diff --git a/ungleich_page/migrations/0004_auto_20171017_1519.py b/ungleich_page/migrations/0004_auto_20171017_1519.py new file mode 100644 index 00000000..d0a88b61 --- /dev/null +++ b/ungleich_page/migrations/0004_auto_20171017_1519.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-17 15:19 +from __future__ import unicode_literals + +import djangocms_text_ckeditor.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('ungleich_page', '0003_ungelichtextsection'), + ] + + operations = [ + migrations.AlterField( + model_name='ungelichtextsection', + name='description', + field=djangocms_text_ckeditor.fields.HTMLField(), + ), + ] From 4cba13a509fa2a6cfe0bf7a4f24300e0fb4cdcf4 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 23:31:57 +0200 Subject: [PATCH 13/55] Add div space for price tag container --- .../templates/ungleich_page/glasfaser/section_with_image.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html index b3477ffe..3673ced0 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html @@ -1,4 +1,7 @@
+
+
+

{{ object.title }}

From 77d92719d318556ba84dc484f076da714dd90b16 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 23:39:41 +0200 Subject: [PATCH 14/55] Add glasfaser cms.css --- ungleich_page/static/ungleich_page/css/cms.css | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ungleich_page/static/ungleich_page/css/cms.css diff --git a/ungleich_page/static/ungleich_page/css/cms.css b/ungleich_page/static/ungleich_page/css/cms.css new file mode 100644 index 00000000..d899cf6f --- /dev/null +++ b/ungleich_page/static/ungleich_page/css/cms.css @@ -0,0 +1,6 @@ +.lead, .split-description.wow.fadeInUp p{ + font-family: "Raleway" , "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 21px; + color: #3a3a3a; + font-weight: 300 !important; +} \ No newline at end of file From f610a1869197990c4ec84b14f5f8488211f277cf Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 23:40:58 +0200 Subject: [PATCH 15/55] Add glasfaser cms.css --- ungleich_page/templates/ungleich_page/glasfaser_cms_page.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index a218090b..7d9a1b0a 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -30,6 +30,9 @@ + {% addtoblock "css" %} + + {% endaddtoblock %} {% render_block "css" postprocessor "compressor.contrib.sekizai.compress" %} {% render_block "js" postprocessor "compressor.contrib.sekizai.compress" %} From d42e2d6e39994928a2fa89df9120335ba44696bb Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 23:56:28 +0200 Subject: [PATCH 16/55] Make all migrations into one file --- ungleich_page/migrations/0001_initial.py | 32 +++++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/ungleich_page/migrations/0001_initial.py b/ungleich_page/migrations/0001_initial.py index 2f7f8b69..ae87b951 100644 --- a/ungleich_page/migrations/0001_initial.py +++ b/ungleich_page/migrations/0001_initial.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2017-10-17 13:41 +# Generated by Django 1.9.4 on 2017-10-17 21:49 from __future__ import unicode_literals -import django.db.models.deletion -import filer.fields.image from django.db import migrations, models +import django.db.models.deletion +import djangocms_text_ckeditor.fields +import filer.fields.image class Migration(migrations.Migration): @@ -13,10 +14,21 @@ class Migration(migrations.Migration): dependencies = [ ('cms', '0014_auto_20160404_1908'), - ('filer', '0005_auto_20171017_1252'), + ('filer', '0004_auto_20160328_1434'), ] operations = [ + migrations.CreateModel( + name='UngelichContactUsSection', + 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')), + ('email', models.EmailField(max_length=200)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), migrations.CreateModel( name='UngelichPicture', fields=[ @@ -29,4 +41,16 @@ class Migration(migrations.Migration): }, bases=('cms.cmsplugin',), ), + migrations.CreateModel( + name='UngelichTextSection', + 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')), + ('title', models.CharField(max_length=200)), + ('description', djangocms_text_ckeditor.fields.HTMLField()), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), ] From 4fcc24d8b79fc195612b765f26cd302bfab93a60 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Tue, 17 Oct 2017 23:57:12 +0200 Subject: [PATCH 17/55] Delete unnecessary migration files --- .../0002_ungelichcontactussection.py | 28 ------------------ .../migrations/0003_ungelichtextsection.py | 29 ------------------- .../migrations/0004_auto_20171017_1519.py | 21 -------------- 3 files changed, 78 deletions(-) delete mode 100644 ungleich_page/migrations/0002_ungelichcontactussection.py delete mode 100644 ungleich_page/migrations/0003_ungelichtextsection.py delete mode 100644 ungleich_page/migrations/0004_auto_20171017_1519.py diff --git a/ungleich_page/migrations/0002_ungelichcontactussection.py b/ungleich_page/migrations/0002_ungelichcontactussection.py deleted file mode 100644 index 2a7d63ab..00000000 --- a/ungleich_page/migrations/0002_ungelichcontactussection.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2017-10-17 14:10 -from __future__ import unicode_literals - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms', '0014_auto_20160404_1908'), - ('ungleich_page', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='UngelichContactUsSection', - 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')), - ('email', models.EmailField(max_length=200)), - ], - options={ - 'abstract': False, - }, - bases=('cms.cmsplugin',), - ), - ] diff --git a/ungleich_page/migrations/0003_ungelichtextsection.py b/ungleich_page/migrations/0003_ungelichtextsection.py deleted file mode 100644 index 549f9be8..00000000 --- a/ungleich_page/migrations/0003_ungelichtextsection.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2017-10-17 14:47 -from __future__ import unicode_literals - -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cms', '0014_auto_20160404_1908'), - ('ungleich_page', '0002_ungelichcontactussection'), - ] - - operations = [ - migrations.CreateModel( - name='UngelichTextSection', - 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')), - ('title', models.CharField(max_length=200)), - ('description', models.TextField()), - ], - options={ - 'abstract': False, - }, - bases=('cms.cmsplugin',), - ), - ] diff --git a/ungleich_page/migrations/0004_auto_20171017_1519.py b/ungleich_page/migrations/0004_auto_20171017_1519.py deleted file mode 100644 index d0a88b61..00000000 --- a/ungleich_page/migrations/0004_auto_20171017_1519.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2017-10-17 15:19 -from __future__ import unicode_literals - -import djangocms_text_ckeditor.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('ungleich_page', '0003_ungelichtextsection'), - ] - - operations = [ - migrations.AlterField( - model_name='ungelichtextsection', - name='description', - field=djangocms_text_ckeditor.fields.HTMLField(), - ), - ] From 97ba0bafd351b6b3b65a46ac9e4e77034a034c3d Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 00:12:48 +0200 Subject: [PATCH 18/55] Define various sections in glasfaser cms template --- .../ungleich_page/glasfaser_cms_page.html | 116 +----------------- 1 file changed, 5 insertions(+), 111 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index 7d9a1b0a..2e167109 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -76,36 +76,11 @@
- {% placeholder 'one' %} + {% placeholder 'Top Section' %} + + {% placeholder 'Middle Section' %} + -
-
-
-
-

{% placeholder 'glasfaser_cms_page_text' %}

-
-
-

Surfen Sie mit 100 Mbit/s im Internet!

-

Mit dem neuen Glasfaser-Angebot der ungleich macht das Arbeiten im Internet richtig Spass. Das beste daran: die Geschwindigkeit symmetrisch in beide Richtungen verfügbar. Damit kann ihr Firmennetzwerk auch Dienste bereitstellen.

-

Dieses Angebot ist im Moment ausschliesslich für Firmenkunden verfügbar. Die Aufschaltkosten der Glasfaserleitung sind von der Entfernung zum nächsten Anschlusspunkt abhängig. Fragen Sie noch heute nach einem individuellem Angebot.

-
-
-
-
-
-
-
-
-

Was ist es?

-

-
-
-

Bei diesem Angebot handelt es sich um einen Internetzugang für Firmenkunden.

-

Sie erhalten in Zusammenarbeit mit unseren Partnern einen Glasfaseranschluss und eine Internetverbindung.

-
-
-
-
@@ -205,88 +180,7 @@
-
-
-
-
-
-
-

Kontakt

-
-
-
-

ungleich GmbH

-
-
-

glasfaser@ungleich.ch

-

In der Au 7, Schwanden 8762

-

Switzerland

-
-
- -
-
-
- {% if success %} -
-
-

{% trans "Thank you for contacting us." %}

-
-

- {% trans "Your message was successfully sent to our team." %} -

-
- {% else %} -
-
-
-

Senden Sie uns eine Nachricht.

-
-
-
-
- {% csrf_token %} - -
- -
- - {{contact_form.name.errors}} -
-
-
- -
- - {{contact_form.email.errors}} -
-
-
- -
- - {{contact_form.message.errors}} -
-
-
-
-
{% trans "Sorry, there was an unexpected error. Kindly retry." %}
- -
-
-
- {% endif %} -
-
-
-
-
-
- + {% placeholder 'Contact Section' %} {% include "ungleich_page/includes/_footer.html" %} From f6468a7c8c6882d6a76c494308a3afcb8bfc76e4 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 09:10:50 +0200 Subject: [PATCH 19/55] First attempt to services section - base.py: add settings to load GlasfaserServicesPlugin by default - glasfaser_cms_page.html: create a placeholder for services - cms_plugins.py: add the plugin code - models.py: add UngelichTextSectionWithImage model --- dynamicweb/settings/base.py | 9 ++++ ungleich_page/cms_plugins.py | 18 +++++++- ungleich_page/models.py | 9 ++++ .../ungleich_page/glasfaser_cms_page.html | 43 +------------------ 4 files changed, 36 insertions(+), 43 deletions(-) diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 58e9065a..611439cd 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -321,6 +321,15 @@ CMS_PLACEHOLDER_CONF = { }, ] }, + 'glasfaser_services': { + 'name': "Services", + 'plugins': ['GlasfaserServicesPlugin'], + 'default_plugins': [ + { + 'plugin_type': 'GlasfaserServicesPlugin', + }, + ] + }, } CACHES = { diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index a6c8747f..1731a7f4 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -2,7 +2,8 @@ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .models import ( - UngelichPicture, UngelichContactUsSection, UngelichTextSection + UngelichPicture, UngelichContactUsSection, UngelichTextSection, + UngelichTextSectionWithImage ) @@ -40,3 +41,18 @@ class SectionTextParagraphGlasfaser(CMSPluginBase): model = UngelichTextSection render_template = "ungleich_page/glasfaser/section_text_glasfaser.html" cache = False + + +@plugin_pool.register_plugin +class GlasfaserServicesPlugin(CMSPluginBase): + model = UngelichTextSectionWithImage + render_template = "ungleich_page/glasfaser/section_services.html" + cache = False + + def render(self, context, instance, placeholder): + context.update({ + 'image': instance.image, + 'object': instance, + 'placeholder': placeholder + }) + return context diff --git a/ungleich_page/models.py b/ungleich_page/models.py index c371020d..e5916f18 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -21,3 +21,12 @@ class UngelichContactUsSection(CMSPlugin): class UngelichTextSection(CMSPlugin): title = models.CharField(max_length=200) description = HTMLField() + + +class UngelichTextSectionWithImage(UngelichTextSection): + image = FilerImageField( + null=True, + blank=True, + related_name="utswi_image", + on_delete=models.SET_NULL + ) \ No newline at end of file diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index 2e167109..dc5811ea 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -80,48 +80,7 @@ {% placeholder 'Middle Section' %} - - -
-
-
-

Technische Details

-

Im Angebot enthalten sind

-
-
-
-
- -
-

Business-Internet

-

Symmetrische Internetleitung 100 Mbit/s upload und 100 Mbit/s download

-

Glasfaser-Installation bis ins Haus (keine Hausverkabelung)

-
-
-
-
-
- -
-

Erreichbarkeit im Internet

-

1 öffentliches IPv6-Netzwerk (/64)

-

1 öffentliche IPv4-Adresse

-
-
-
-
-
- -
-

Einfach zu nutzen

-

2 vorkonfigurierte Endgeräte (benötigt zwei Steckdosen auf Ihrer Seite)

-

Einfach einstecken und los!

-
-
-
-
-
-
+ {% placeholder 'Glasfaser Services' %}
From 977966f3ba7d58a2a9f1b06b1a3c2520ceb04e7c Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 09:11:31 +0200 Subject: [PATCH 20/55] Add glasfaser_services.html --- .../glasfaser/section_services.html | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/section_services.html diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html new file mode 100644 index 00000000..03e48051 --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html @@ -0,0 +1,49 @@ +{% load static i18n cms_tags %} +{% with total_plugins=instance.get_plugins_list|length %} +

There's {{ total_plugins }} here !!!

+{% endwith %} + +{% for plugins in placeholder "glasfaser_services" %} + +{% endfor %} + +
+
+
+

Technische Details

+

Im Angebot enthalten sind

+
+
+
+
+ +
+

Business-Internet

+

Symmetrische Internetleitung 100 Mbit/s upload und 100 Mbit/s download

+

Glasfaser-Installation bis ins Haus (keine Hausverkabelung)

+
+
+
+
+
+ +
+

Erreichbarkeit im Internet

+

1 öffentliches IPv6-Netzwerk (/64)

+

1 öffentliche IPv4-Adresse

+
+
+
+
+
+ +
+

Einfach zu nutzen

+

2 vorkonfigurierte Endgeräte (benötigt zwei Steckdosen auf Ihrer Seite)

+

Einfach einstecken und los!

+
+
+
+
+
+
\ No newline at end of file From a9e97a8bc6dcf1c4ea34cabb306cd7f4fdcccfa9 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 09:14:05 +0200 Subject: [PATCH 21/55] Add UngelichTextSectionWithImage migration --- .../0002_ungelichtextsectionwithimage.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ungleich_page/migrations/0002_ungelichtextsectionwithimage.py diff --git a/ungleich_page/migrations/0002_ungelichtextsectionwithimage.py b/ungleich_page/migrations/0002_ungelichtextsectionwithimage.py new file mode 100644 index 00000000..9695e82e --- /dev/null +++ b/ungleich_page/migrations/0002_ungelichtextsectionwithimage.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-17 22:42 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import filer.fields.image + + +class Migration(migrations.Migration): + + dependencies = [ + ('filer', '0004_auto_20160328_1434'), + ('ungleich_page', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='UngelichTextSectionWithImage', + fields=[ + ('ungelichtextsection_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ungleich_page.UngelichTextSection')), + ('image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='utswi_image', to='filer.Image')), + ], + options={ + 'abstract': False, + }, + bases=('ungleich_page.ungelichtextsection',), + ), + ] From ef0ab2d24aa1a31e3b9c8a0e594e31fb2022a60a Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 11:05:47 +0200 Subject: [PATCH 22/55] Add missing styles to intro section --- .../templates/ungleich_page/glasfaser/section_with_image.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html index 3673ced0..207d7ec4 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html @@ -1,4 +1,4 @@ -
+
From d05ef79ecce686e6699cc7d6d07396de3049ef43 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 15:43:12 +0200 Subject: [PATCH 23/55] Add Service and ServiceItem models and corresponding migration --- ungleich_page/migrations/0001_initial.py | 30 ++++++++++++++++++++++-- ungleich_page/models.py | 23 +++++++++++++++--- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/ungleich_page/migrations/0001_initial.py b/ungleich_page/migrations/0001_initial.py index ae87b951..c40ccf40 100644 --- a/ungleich_page/migrations/0001_initial.py +++ b/ungleich_page/migrations/0001_initial.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2017-10-17 21:49 +# Generated by Django 1.9.4 on 2017-10-18 13:40 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 +from django.db import migrations, models class Migration(migrations.Migration): @@ -18,6 +18,32 @@ class Migration(migrations.Migration): ] operations = [ + migrations.CreateModel( + name='Service', + 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')), + ('title', models.CharField(max_length=200)), + ('sub_title', models.CharField(max_length=200)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='ServiceItem', + 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')), + ('title', models.CharField(max_length=200)), + ('description', djangocms_text_ckeditor.fields.HTMLField()), + ('glasfaser_service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ungleich_page.Service')), + ('image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_item_image', to='filer.Image')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), migrations.CreateModel( name='UngelichContactUsSection', fields=[ diff --git a/ungleich_page/models.py b/ungleich_page/models.py index e5916f18..f961e373 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -23,10 +23,27 @@ class UngelichTextSection(CMSPlugin): description = HTMLField() -class UngelichTextSectionWithImage(UngelichTextSection): +class Service(CMSPlugin): + title = models.CharField(max_length=200) + sub_title = models.CharField(max_length=200) + + def __str__(self): + return self.title + + +class ServiceItem(CMSPlugin): image = FilerImageField( null=True, blank=True, - related_name="utswi_image", + related_name="service_item_image", on_delete=models.SET_NULL - ) \ No newline at end of file + ) + title = models.CharField(max_length=200) + description = HTMLField() + glasfaser_service = models.ForeignKey(Service) + + def __str__(self): + return self.title + + def copy_relations(self, oldinstance): + self.glasfaser_service = oldinstance.glasfaser_service From a8c49b7fde52df8c1d447ae1d5b86b6500585386 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 15:44:18 +0200 Subject: [PATCH 24/55] Delete 0002_ungleichtextsectionwithimage.py --- .../0002_ungelichtextsectionwithimage.py | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 ungleich_page/migrations/0002_ungelichtextsectionwithimage.py diff --git a/ungleich_page/migrations/0002_ungelichtextsectionwithimage.py b/ungleich_page/migrations/0002_ungelichtextsectionwithimage.py deleted file mode 100644 index 9695e82e..00000000 --- a/ungleich_page/migrations/0002_ungelichtextsectionwithimage.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2017-10-17 22:42 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import filer.fields.image - - -class Migration(migrations.Migration): - - dependencies = [ - ('filer', '0004_auto_20160328_1434'), - ('ungleich_page', '0001_initial'), - ] - - operations = [ - migrations.CreateModel( - name='UngelichTextSectionWithImage', - fields=[ - ('ungelichtextsection_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ungleich_page.UngelichTextSection')), - ('image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='utswi_image', to='filer.Image')), - ], - options={ - 'abstract': False, - }, - bases=('ungleich_page.ungelichtextsection',), - ), - ] From 9c07565b73852bd80b34056ebf96421955507ea5 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 15:46:57 +0200 Subject: [PATCH 25/55] Add section_services.html and section_services_item.html --- .../glasfaser/section_services.html | 48 ++++--------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html index 03e48051..ae7ef31c 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html @@ -1,49 +1,17 @@ {% load static i18n cms_tags %} -{% with total_plugins=instance.get_plugins_list|length %} -

There's {{ total_plugins }} here !!!

-{% endwith %} - -{% for plugins in placeholder "glasfaser_services" %} - -{% endfor %} -
-

Technische Details

-

Im Angebot enthalten sind

+

{{ service_instance.title }}

+

{{ service_instance.sub_title }}

-
-
- -
-

Business-Internet

-

Symmetrische Internetleitung 100 Mbit/s upload und 100 Mbit/s download

-

Glasfaser-Installation bis ins Haus (keine Hausverkabelung)

-
-
-
-
-
- -
-

Erreichbarkeit im Internet

-

1 öffentliches IPv6-Netzwerk (/64)

-

1 öffentliche IPv4-Adresse

-
-
-
-
-
- -
-

Einfach zu nutzen

-

2 vorkonfigurierte Endgeräte (benötigt zwei Steckdosen auf Ihrer Seite)

-

Einfach einstecken und los!

-
-
-
+ {% for plugin in service_instance.child_plugin_instances %} +
+ {% render_plugin plugin %} +
+ {% endfor %} +
\ No newline at end of file From f3e4ede52e22033be16cd24c5e23a5b3fa562160 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 15:48:01 +0200 Subject: [PATCH 26/55] Add section_services_item.html --- .../ungleich_page/glasfaser/section_services_item.html | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/section_services_item.html diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_services_item.html b/ungleich_page/templates/ungleich_page/glasfaser/section_services_item.html new file mode 100644 index 00000000..e2433953 --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_services_item.html @@ -0,0 +1,7 @@ +
+ +
+

{{ instance.title }}

+

{{ instance.description }}

+
+
\ No newline at end of file From cfcc3e0eb14cf916d7a20d38fff4087ae34707d5 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 15:51:47 +0200 Subject: [PATCH 27/55] Add GlasfaserServicesPlugin and GlasfaserServicesItemPlugin --- ungleich_page/cms_plugins.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 1731a7f4..6314585d 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -2,8 +2,8 @@ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .models import ( - UngelichPicture, UngelichContactUsSection, UngelichTextSection, - UngelichTextSectionWithImage + UngelichPicture, UngelichContactUsSection, UngelichTextSection, Service, + ServiceItem ) @@ -45,14 +45,27 @@ class SectionTextParagraphGlasfaser(CMSPluginBase): @plugin_pool.register_plugin class GlasfaserServicesPlugin(CMSPluginBase): - model = UngelichTextSectionWithImage + name = "Glasfaser Services Plugin" + model = Service render_template = "ungleich_page/glasfaser/section_services.html" cache = False + allow_children = True + child_classes = ['GlasfaserServicesItemPlugin'] def render(self, context, instance, placeholder): - context.update({ - 'image': instance.image, - 'object': instance, - 'placeholder': placeholder - }) + context['service_instance'] = instance + return context + + +@plugin_pool.register_plugin +class GlasfaserServicesItemPlugin(CMSPluginBase): + name = "Glasfaser Service Item Plugin" + model = ServiceItem + render_template = "ungleich_page/glasfaser/section_services_item.html" + cache = False + require_parent = True + parent_classes = ['GlasfaserServicesPlugin'] + + def render(self, context, instance, placeholder): + context['instance'] = instance return context From 9ff5b4015f18d204c8aa21258a5bbb0b0f38bd8c Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 15:58:50 +0200 Subject: [PATCH 28/55] Rename section_services_item.html to _services_item.html --- ungleich_page/cms_plugins.py | 2 +- .../{section_services_item.html => _services_item.html} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ungleich_page/templates/ungleich_page/glasfaser/{section_services_item.html => _services_item.html} (100%) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 6314585d..75e3b698 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -61,7 +61,7 @@ class GlasfaserServicesPlugin(CMSPluginBase): class GlasfaserServicesItemPlugin(CMSPluginBase): name = "Glasfaser Service Item Plugin" model = ServiceItem - render_template = "ungleich_page/glasfaser/section_services_item.html" + render_template = "ungleich_page/glasfaser/_services_item.html" cache = False require_parent = True parent_classes = ['GlasfaserServicesPlugin'] diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_services_item.html b/ungleich_page/templates/ungleich_page/glasfaser/_services_item.html similarity index 100% rename from ungleich_page/templates/ungleich_page/glasfaser/section_services_item.html rename to ungleich_page/templates/ungleich_page/glasfaser/_services_item.html From 5e2d1966f8f66cc1e25ea5e456c3e08c36100b2a Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 16:53:05 +0200 Subject: [PATCH 29/55] Add section_about and _about_item templates --- .../ungleich_page/glasfaser/_about_item.html | 10 ++++++++++ .../ungleich_page/glasfaser/section_about.html | 18 ++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/_about_item.html create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/section_about.html diff --git a/ungleich_page/templates/ungleich_page/glasfaser/_about_item.html b/ungleich_page/templates/ungleich_page/glasfaser/_about_item.html new file mode 100644 index 00000000..fee322d4 --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/_about_item.html @@ -0,0 +1,10 @@ +
  • +
    + +
    +
    +
    +

    {{ instance.title }}

    +
    +
    +
  • \ No newline at end of file diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_about.html b/ungleich_page/templates/ungleich_page/glasfaser/section_about.html new file mode 100644 index 00000000..e9c811ce --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_about.html @@ -0,0 +1,18 @@ +{% load cms_tags %} +
    +
    +
    +

    {{ about_instance.title }}

    +

    {{ about_instance.sub_title }}

    +
    +
    +
    +
      + {% for plugin in about_instance.child_plugin_instances %} + {% render_plugin plugin %} + {% endfor %} +
    +
    +
    +
    +
    \ No newline at end of file From 04e72696f1b6ad5434298f8429cbfe6587d3b84d Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 16:53:32 +0200 Subject: [PATCH 30/55] Add About and AboutItem models --- ungleich_page/models.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ungleich_page/models.py b/ungleich_page/models.py index f961e373..57201f9d 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -11,7 +11,7 @@ class UngelichPicture(CMSPlugin): related_name="image", on_delete=models.SET_NULL ) - title = models.CharField(max_length=200) + title = models.CharField(max_length=400) class UngelichContactUsSection(CMSPlugin): @@ -47,3 +47,21 @@ class ServiceItem(CMSPlugin): def copy_relations(self, oldinstance): self.glasfaser_service = oldinstance.glasfaser_service + + +class About(Service): + pass + + +class AboutItem(UngelichPicture): + inverted = models.BooleanField(default=False) + glasfaser_about = models.ForeignKey(About) + + def __str__(self): + alignment = "Right" if self.inverted else "Left" + return "{alignment} - {title}".format( + alignment=alignment, title=self.title + ) + + def copy_relations(self, oldinstance): + self.glasfaser_about = oldinstance.glasfaser_about From 621424f182f5d2651f44d1b497eea53ca79cc424 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 16:56:00 +0200 Subject: [PATCH 31/55] Add updated migration file --- ungleich_page/migrations/0001_initial.py | 44 +++++++++++++++++++++--- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/ungleich_page/migrations/0001_initial.py b/ungleich_page/migrations/0001_initial.py index c40ccf40..41919cba 100644 --- a/ungleich_page/migrations/0001_initial.py +++ b/ungleich_page/migrations/0001_initial.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2017-10-18 13:40 +# Generated by Django 1.9.4 on 2017-10-18 14:43 from __future__ import unicode_literals import django.db.models.deletion @@ -36,8 +36,6 @@ class Migration(migrations.Migration): ('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')), ('title', models.CharField(max_length=200)), ('description', djangocms_text_ckeditor.fields.HTMLField()), - ('glasfaser_service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ungleich_page.Service')), - ('image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_item_image', to='filer.Image')), ], options={ 'abstract': False, @@ -59,8 +57,7 @@ class Migration(migrations.Migration): name='UngelichPicture', 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')), - ('title', models.CharField(max_length=200)), - ('image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='image', to='filer.Image')), + ('title', models.CharField(max_length=400)), ], options={ 'abstract': False, @@ -79,4 +76,41 @@ class Migration(migrations.Migration): }, bases=('cms.cmsplugin',), ), + migrations.CreateModel( + name='About', + fields=[ + ('service_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ungleich_page.Service')), + ], + options={ + 'abstract': False, + }, + bases=('ungleich_page.service',), + ), + migrations.CreateModel( + name='AboutItem', + fields=[ + ('ungelichpicture_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ungleich_page.UngelichPicture')), + ('inverted', models.BooleanField(default=False)), + ('glasfaser_about', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ungleich_page.About')), + ], + options={ + 'abstract': False, + }, + bases=('ungleich_page.ungelichpicture',), + ), + migrations.AddField( + model_name='ungelichpicture', + name='image', + field=filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='image', to='filer.Image'), + ), + migrations.AddField( + model_name='serviceitem', + name='glasfaser_service', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ungleich_page.Service'), + ), + migrations.AddField( + model_name='serviceitem', + name='image', + field=filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_item_image', to='filer.Image'), + ), ] From 609501f9876f1c1edb2128ab432eab0346002fe2 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 16:56:41 +0200 Subject: [PATCH 32/55] Add GlasfaserAboutPlugin and GlasfaserAboutItemPlugin --- ungleich_page/cms_plugins.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 75e3b698..ba82801e 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -3,7 +3,7 @@ from cms.plugin_pool import plugin_pool from .models import ( UngelichPicture, UngelichContactUsSection, UngelichTextSection, Service, - ServiceItem + ServiceItem, About, AboutItem ) @@ -69,3 +69,31 @@ class GlasfaserServicesItemPlugin(CMSPluginBase): def render(self, context, instance, placeholder): context['instance'] = instance return context + + +@plugin_pool.register_plugin +class GlasfaserAboutPlugin(CMSPluginBase): + name = "Glasfaser About Plugin" + model = About + render_template = "ungleich_page/glasfaser/section_about.html" + cache = False + allow_children = True + child_classes = ['GlasfaserAboutItemPlugin'] + + def render(self, context, instance, placeholder): + context['about_instance'] = instance + return context + + +@plugin_pool.register_plugin +class GlasfaserAboutItemPlugin(CMSPluginBase): + name = "Glasfaser About Item Plugin" + model = AboutItem + render_template = "ungleich_page/glasfaser/_about_item.html" + cache = False + require_parent = True + parent_classes = ['GlasfaserAboutPlugin'] + + def render(self, context, instance, placeholder): + context['instance'] = instance + return context From c753d3061db13652805abeb906b086140f952180 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 16:57:15 +0200 Subject: [PATCH 33/55] Refactor glasfaser_cms_page.html template --- .../ungleich_page/glasfaser_cms_page.html | 63 ++----------------- 1 file changed, 4 insertions(+), 59 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index dc5811ea..a804ec73 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -76,69 +76,14 @@
    - {% placeholder 'Top Section' %} + {% placeholder 'Top Section' %} - {% placeholder 'Middle Section' %} + {% placeholder 'Middle Section' %} - {% placeholder 'Glasfaser Services' %} + {% placeholder 'Glasfaser Services' %} - -
    -
    -
    -

    Wie funktioniert es?

    -

    So kommen Sie in wenigen einfachen Schritten zu Ihrem High-Speed-Internet

    -
    -
    -
    -
      -
    • -
      - -
      -
      -
      -

      Senden Sie uns via E-Mail Ihren Firmennamen und Ihre Anschrift zu.

      -
      -
      -
    • -
    • -
      - -
      -
      -
      -

      Wir prüfen dann die Entfernung zum nächsten Anschlusspunkt und schicken Ihnen eine Offerte zu.

      -
      -
      -
    • -
    • -
      - -
      -
      -
      -

      Sollten Sie dem Angebot zustimmen, wird die Glasfaser zu Ihrem Standort verlegt und die Endgeräte installiert.

      -
      -
      -
    • -
    • -
      - -
      -
      -
      -

      Sie müssen dann nur noch Ihre Geräte anschliessen und schon surfen Sie bllitzschnell im Internet!

      -
      -
      -
    • -
    -
    -
    -
    -
    + {% placeholder 'Glasfaser About' %} - {% placeholder 'Contact Section' %} From db45597e4efb99c939f8930e29d8ee8e2964ca18 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 20:24:50 +0200 Subject: [PATCH 34/55] Remove foreign keys between nested plugins --- ungleich_page/cms_plugins.py | 6 ++++++ ungleich_page/migrations/0001_initial.py | 18 ++++-------------- ungleich_page/models.py | 8 -------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index ba82801e..4f377e68 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -67,6 +67,9 @@ class GlasfaserServicesItemPlugin(CMSPluginBase): parent_classes = ['GlasfaserServicesPlugin'] def render(self, context, instance, placeholder): + context = super(GlasfaserServicesItemPlugin, self).render( + context, instance, placeholder + ) context['instance'] = instance return context @@ -95,5 +98,8 @@ class GlasfaserAboutItemPlugin(CMSPluginBase): parent_classes = ['GlasfaserAboutPlugin'] def render(self, context, instance, placeholder): + context = super(GlasfaserAboutItemPlugin, self).render( + context, instance, placeholder + ) context['instance'] = instance return context diff --git a/ungleich_page/migrations/0001_initial.py b/ungleich_page/migrations/0001_initial.py index 41919cba..f9be10dc 100644 --- a/ungleich_page/migrations/0001_initial.py +++ b/ungleich_page/migrations/0001_initial.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2017-10-18 14:43 +# Generated by Django 1.9.4 on 2017-10-18 18:23 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 -from django.db import migrations, models class Migration(migrations.Migration): @@ -13,8 +13,8 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('cms', '0014_auto_20160404_1908'), ('filer', '0004_auto_20160328_1434'), + ('cms', '0014_auto_20160404_1908'), ] operations = [ @@ -36,6 +36,7 @@ class Migration(migrations.Migration): ('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')), ('title', models.CharField(max_length=200)), ('description', djangocms_text_ckeditor.fields.HTMLField()), + ('image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_item_image', to='filer.Image')), ], options={ 'abstract': False, @@ -91,7 +92,6 @@ class Migration(migrations.Migration): fields=[ ('ungelichpicture_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ungleich_page.UngelichPicture')), ('inverted', models.BooleanField(default=False)), - ('glasfaser_about', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ungleich_page.About')), ], options={ 'abstract': False, @@ -103,14 +103,4 @@ class Migration(migrations.Migration): name='image', field=filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='image', to='filer.Image'), ), - migrations.AddField( - model_name='serviceitem', - name='glasfaser_service', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ungleich_page.Service'), - ), - migrations.AddField( - model_name='serviceitem', - name='image', - field=filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='service_item_image', to='filer.Image'), - ), ] diff --git a/ungleich_page/models.py b/ungleich_page/models.py index 57201f9d..9ed1ed64 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -40,14 +40,10 @@ class ServiceItem(CMSPlugin): ) title = models.CharField(max_length=200) description = HTMLField() - glasfaser_service = models.ForeignKey(Service) def __str__(self): return self.title - def copy_relations(self, oldinstance): - self.glasfaser_service = oldinstance.glasfaser_service - class About(Service): pass @@ -55,13 +51,9 @@ class About(Service): class AboutItem(UngelichPicture): inverted = models.BooleanField(default=False) - glasfaser_about = models.ForeignKey(About) def __str__(self): alignment = "Right" if self.inverted else "Left" return "{alignment} - {title}".format( alignment=alignment, title=self.title ) - - def copy_relations(self, oldinstance): - self.glasfaser_about = oldinstance.glasfaser_about From 38330d562cf20239041744ff2d977a2c86be9d99 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Wed, 18 Oct 2017 23:29:57 +0200 Subject: [PATCH 35/55] Remove unused cms config from base.py --- dynamicweb/settings/base.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index e81d8080..48a2399f 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -321,15 +321,6 @@ CMS_PLACEHOLDER_CONF = { }, ] }, - 'glasfaser_services': { - 'name': "Services", - 'plugins': ['GlasfaserServicesPlugin'], - 'default_plugins': [ - { - 'plugin_type': 'GlasfaserServicesPlugin', - }, - ] - }, } CACHES = { From 8ce273ea1fbb4b7cb5bf742675b5b3d4bc0312ea Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 00:28:34 +0200 Subject: [PATCH 36/55] Add SectionWithImage model and its migration --- .../migrations/0002_sectionwithimage.py | 30 +++++++++++++++++++ ungleich_page/models.py | 10 +++++++ 2 files changed, 40 insertions(+) create mode 100644 ungleich_page/migrations/0002_sectionwithimage.py diff --git a/ungleich_page/migrations/0002_sectionwithimage.py b/ungleich_page/migrations/0002_sectionwithimage.py new file mode 100644 index 00000000..87e742b3 --- /dev/null +++ b/ungleich_page/migrations/0002_sectionwithimage.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-18 22:02 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import filer.fields.image + + +class Migration(migrations.Migration): + + dependencies = [ + ('filer', '0004_auto_20160328_1434'), + ('ungleich_page', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='SectionWithImage', + fields=[ + ('ungelichpicture_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='ungleich_page.UngelichPicture')), + ('price_tag_url', models.URLField(default='', max_length=300)), + ('price_tag_image', filer.fields.image.FilerImageField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='price_tag_image', to='filer.Image')), + ], + options={ + 'abstract': False, + }, + bases=('ungleich_page.ungelichpicture',), + ), + ] diff --git a/ungleich_page/models.py b/ungleich_page/models.py index 9ed1ed64..2869373e 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -14,6 +14,16 @@ class UngelichPicture(CMSPlugin): title = models.CharField(max_length=400) +class SectionWithImage(UngelichPicture): + price_tag_image = FilerImageField( + null=True, + blank=True, + related_name="price_tag_image", + on_delete=models.SET_NULL + ) + price_tag_url = models.URLField(max_length=300, default="") + + class UngelichContactUsSection(CMSPlugin): email = models.EmailField(max_length=200) From bf044a4bf3097a7e9c3f0518586da3cd33e41fcc Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 00:29:34 +0200 Subject: [PATCH 37/55] Improve section_with_image.html to include price_tag image and url --- .../templates/ungleich_page/glasfaser/section_with_image.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html index 207d7ec4..7d921016 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html @@ -1,6 +1,6 @@ -
    +
    -
    +
    From 878a823e207abf51fb3e7494796d5461d90b5353 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 00:30:07 +0200 Subject: [PATCH 38/55] Use SectionWithImage --- ungleich_page/cms_plugins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 4f377e68..19afce96 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -2,14 +2,14 @@ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from .models import ( - UngelichPicture, UngelichContactUsSection, UngelichTextSection, Service, - ServiceItem, About, AboutItem + UngelichContactUsSection, UngelichTextSection, Service, ServiceItem, + About, AboutItem, SectionWithImage ) @plugin_pool.register_plugin class SectionWithImagePlugin(CMSPluginBase): - model = UngelichPicture + model = SectionWithImage render_template = "ungleich_page/glasfaser/section_with_image.html" cache = False From c147b48af7c00da45c132be1d43affd4c7877eec Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 13:39:56 +0200 Subject: [PATCH 39/55] Add first version of cms_menus.py --- ungleich_page/cms_menus.py | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 ungleich_page/cms_menus.py diff --git a/ungleich_page/cms_menus.py b/ungleich_page/cms_menus.py new file mode 100644 index 00000000..ebba3515 --- /dev/null +++ b/ungleich_page/cms_menus.py @@ -0,0 +1,59 @@ +from menus.base import NavigationNode +from menus.menu_pool import menu_pool +from django.utils.translation import ugettext_lazy as _ +from cms.menu_bases import CMSAttachMenu +from cms.templatetags.cms_tags import _get_placeholder +from cms.utils.plugins import get_plugins + + +class TestMenu(CMSAttachMenu): + + name = _("Glasfaser menu") + + def get_nodes(self, request): + nodes = [] + if request and request.current_page: + template_context = { + "request": request, + } + placeholder_name_list = [ + 'Top Section', 'Middle Section', 'Glasfaser Services', + 'Glasfaser About', 'Contact Section' + ] + plugins_list = [ + 'SectionWithImage', 'UngelichContactUsSection', + 'UngelichTextSection', 'Service', 'About' + ] + for placeholder_name in placeholder_name_list: + placeholder = _get_placeholder( + request.current_page, request.current_page, + template_context, placeholder_name + ) + plugins = get_plugins( + request, placeholder, request.current_page.get_template() + ) + for plugin in plugins: + if type(plugin).__name__ in plugins_list: + section_hash = request.build_absolute_uri() + if hasattr(plugin, 'menu_text'): + menu_text = plugin.menu_text + menu_words = menu_text.split() + if len(menu_words) > 0: + section_hash = '{}#{}'.format( + section_hash, + menu_words[0] + ) + else: + continue + newnode = NavigationNode( + menu_text, + url=section_hash, + id="{}-{}".format( + request.current_page.id, plugin.id + ) + ) + nodes.append(newnode) + return nodes + + +menu_pool.register_menu(TestMenu) \ No newline at end of file From 73818fd5b915fe56b92917363c34179d23904762 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 13:40:48 +0200 Subject: [PATCH 40/55] Add menu_text fields for various plugins --- ungleich_page/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ungleich_page/models.py b/ungleich_page/models.py index 2869373e..bac70d2a 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -15,25 +15,29 @@ class UngelichPicture(CMSPlugin): class SectionWithImage(UngelichPicture): + menu_text = models.CharField(max_length=100, default="", blank=True) price_tag_image = FilerImageField( null=True, blank=True, related_name="price_tag_image", on_delete=models.SET_NULL ) - price_tag_url = models.URLField(max_length=300, default="") + price_tag_url = models.URLField(max_length=300, default="", blank=True) class UngelichContactUsSection(CMSPlugin): + menu_text = models.CharField(max_length=100, default="", blank=True) email = models.EmailField(max_length=200) class UngelichTextSection(CMSPlugin): + menu_text = models.CharField(max_length=100, default="", blank=True) title = models.CharField(max_length=200) description = HTMLField() class Service(CMSPlugin): + menu_text = models.CharField(max_length=100, default="", blank=True) title = models.CharField(max_length=200) sub_title = models.CharField(max_length=200) From b21a533aeb7164bdf4f8f73f4dbc5fa4478db313 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 13:44:21 +0200 Subject: [PATCH 41/55] Show menu using cms --- .../templates/ungleich_page/glasfaser_cms_page.html | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index a804ec73..f0b8c050 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -1,4 +1,4 @@ -{% load static bootstrap3 i18n cms_tags sekizai_tags %} +{% load static bootstrap3 i18n cms_tags sekizai_tags menu_tags %} {% get_current_language as LANGUAGE_CODE %} @@ -61,15 +61,7 @@ From 0935877a4fc65efaea058a1f6e4ff633a3a0a1a0 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 13:45:28 +0200 Subject: [PATCH 42/55] Add get_section_id --- ungleich_page/cms_plugins.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 19afce96..388e6049 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -7,6 +7,22 @@ from .models import ( ) +def get_section_id(plugin_instance, default): + """ + A helper function to get the section id from a given menu text + :param plugin_instance: + :param default: The default section id to return in case a section id + is not found + :return: The section id for the plugin_instance + """ + section_id = default + if hasattr(plugin_instance, 'menu_text'): + menu_words = plugin_instance.menu_text.split() + if len(menu_words) > 0: + section_id = menu_words[0] + return section_id + + @plugin_pool.register_plugin class SectionWithImagePlugin(CMSPluginBase): model = SectionWithImage @@ -35,6 +51,14 @@ class SectionTextParagraphDCL(CMSPluginBase): render_template = "ungleich_page/glasfaser/section_text_dcl.html" cache = False + def render(self, context, instance, placeholder): + context = super(SectionTextParagraphDCL, self).render( + context, instance, placeholder + ) + context['instance'] = instance + context['section_id'] = get_section_id(instance, 'your') + return context + @plugin_pool.register_plugin class SectionTextParagraphGlasfaser(CMSPluginBase): @@ -42,6 +66,14 @@ class SectionTextParagraphGlasfaser(CMSPluginBase): render_template = "ungleich_page/glasfaser/section_text_glasfaser.html" cache = False + def render(self, context, instance, placeholder): + context = super(SectionTextParagraphGlasfaser, self).render( + context, instance, placeholder + ) + context['instance'] = instance + context['section_id'] = get_section_id(instance, 'our') + return context + @plugin_pool.register_plugin class GlasfaserServicesPlugin(CMSPluginBase): From 24fe8c4c6ecd01135e8c03a997d0c5d38f06d1c3 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 13:46:20 +0200 Subject: [PATCH 43/55] Load section ids from cms --- .../templates/ungleich_page/glasfaser/section_text_dcl.html | 2 +- .../ungleich_page/glasfaser/section_text_glasfaser.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_text_dcl.html b/ungleich_page/templates/ungleich_page/glasfaser/section_text_dcl.html index 54836fbc..e45504f3 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_text_dcl.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_text_dcl.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html b/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html index edb035ce..d3d83dfc 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_text_glasfaser.html @@ -1,4 +1,4 @@ -
    +
    From ac5c43822f6d6004392545ff99f1b2ccdbd729c5 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 13:48:13 +0200 Subject: [PATCH 44/55] Add menus template for glasfaser template --- .../templates/ungleich_page/glasfaser/menus.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ungleich_page/templates/ungleich_page/glasfaser/menus.html diff --git a/ungleich_page/templates/ungleich_page/glasfaser/menus.html b/ungleich_page/templates/ungleich_page/glasfaser/menus.html new file mode 100644 index 00000000..aa5d8abf --- /dev/null +++ b/ungleich_page/templates/ungleich_page/glasfaser/menus.html @@ -0,0 +1,12 @@ +{% load menu_tags %} + +{% for child in children %} +
  • + {{ child.get_menu_title }} + {% if child.children %} +
      + {% show_menu from_level to_level extra_inactive extra_active template "" "" child %} +
    + {% endif %} +
  • +{% endfor %} \ No newline at end of file From 428d329d9942d169dfc8ae40e27dfcc535e1e163 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 13:49:30 +0200 Subject: [PATCH 45/55] Add migrations --- .../migrations/0003_auto_20171019_1007.py | 35 ++++++++++++++++ .../migrations/0004_auto_20171019_1113.py | 40 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 ungleich_page/migrations/0003_auto_20171019_1007.py create mode 100644 ungleich_page/migrations/0004_auto_20171019_1113.py diff --git a/ungleich_page/migrations/0003_auto_20171019_1007.py b/ungleich_page/migrations/0003_auto_20171019_1007.py new file mode 100644 index 00000000..33f19a29 --- /dev/null +++ b/ungleich_page/migrations/0003_auto_20171019_1007.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-19 10:07 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ungleich_page', '0002_sectionwithimage'), + ] + + operations = [ + migrations.AddField( + model_name='sectionwithimage', + name='menu_text', + field=models.CharField(default='', max_length=100), + ), + migrations.AddField( + model_name='service', + name='menu_text', + field=models.CharField(default='', max_length=100), + ), + migrations.AddField( + model_name='ungelichcontactussection', + name='menu_text', + field=models.CharField(default='', max_length=100), + ), + migrations.AddField( + model_name='ungelichtextsection', + name='menu_text', + field=models.CharField(default='', max_length=100), + ), + ] diff --git a/ungleich_page/migrations/0004_auto_20171019_1113.py b/ungleich_page/migrations/0004_auto_20171019_1113.py new file mode 100644 index 00000000..b1877091 --- /dev/null +++ b/ungleich_page/migrations/0004_auto_20171019_1113.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-19 11:13 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ungleich_page', '0003_auto_20171019_1007'), + ] + + operations = [ + migrations.AlterField( + model_name='sectionwithimage', + name='menu_text', + field=models.CharField(blank=True, default='', max_length=100), + ), + migrations.AlterField( + model_name='sectionwithimage', + name='price_tag_url', + field=models.URLField(blank=True, default='', max_length=300), + ), + migrations.AlterField( + model_name='service', + name='menu_text', + field=models.CharField(blank=True, default='', max_length=100), + ), + migrations.AlterField( + model_name='ungelichcontactussection', + name='menu_text', + field=models.CharField(blank=True, default='', max_length=100), + ), + migrations.AlterField( + model_name='ungelichtextsection', + name='menu_text', + field=models.CharField(blank=True, default='', max_length=100), + ), + ] From 502d822a02850b291bef1fe91c8e9f07f14f528a Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 14:05:17 +0200 Subject: [PATCH 46/55] Add section id from cms in the contact us section --- ungleich_page/cms_plugins.py | 8 ++++++++ .../ungleich_page/glasfaser/section_contact.html | 4 ++-- .../templates/ungleich_page/glasfaser_cms_page.html | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index 388e6049..d6035499 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -44,6 +44,14 @@ class SectionContact(CMSPluginBase): render_template = "ungleich_page/glasfaser/section_contact.html" cache = False + def render(self, context, instance, placeholder): + context = super(SectionContact, self).render( + context, instance, placeholder + ) + context['instance'] = instance + context['section_id'] = get_section_id(instance, 'contact') + return context + @plugin_pool.register_plugin class SectionTextParagraphDCL(CMSPluginBase): diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html index afc089b1..cd1c856b 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html @@ -1,7 +1,7 @@ {% load i18n %} -
    -
    +
    +
    diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index f0b8c050..8f76b29f 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -86,7 +86,7 @@ From 46baaaf621107871fd1f3d831ff1db0b4f942872 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 14:14:29 +0200 Subject: [PATCH 47/55] Add section id from cms for services --- ungleich_page/cms_plugins.py | 1 + .../templates/ungleich_page/glasfaser/section_services.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index d6035499..a75e0605 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -94,6 +94,7 @@ class GlasfaserServicesPlugin(CMSPluginBase): def render(self, context, instance, placeholder): context['service_instance'] = instance + context['section_id'] = get_section_id(instance, 'services') return context diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html index ae7ef31c..4f2331ef 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html @@ -1,5 +1,5 @@ {% load static i18n cms_tags %} -
    +

    {{ service_instance.title }}

    From 6322140813ad15cdd23da2df827e2fd12e9a025f Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 14:22:02 +0200 Subject: [PATCH 48/55] Add section id from cms for about --- ungleich_page/cms_plugins.py | 1 + .../templates/ungleich_page/glasfaser/section_about.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ungleich_page/cms_plugins.py b/ungleich_page/cms_plugins.py index a75e0605..a5b10d5f 100644 --- a/ungleich_page/cms_plugins.py +++ b/ungleich_page/cms_plugins.py @@ -126,6 +126,7 @@ class GlasfaserAboutPlugin(CMSPluginBase): def render(self, context, instance, placeholder): context['about_instance'] = instance + context['section_id'] = get_section_id(instance, 'about') return context diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_about.html b/ungleich_page/templates/ungleich_page/glasfaser/section_about.html index e9c811ce..5e3f0410 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_about.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_about.html @@ -1,5 +1,5 @@ {% load cms_tags %} -
    +

    {{ about_instance.title }}

    From 55dd96570c283c7179028ad4c24f919e4aede84a Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 15:24:00 +0200 Subject: [PATCH 49/55] Add custom padding bottom for services section --- ungleich_page/static/ungleich_page/css/cms.css | 8 +++++++- .../ungleich_page/glasfaser/section_services.html | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ungleich_page/static/ungleich_page/css/cms.css b/ungleich_page/static/ungleich_page/css/cms.css index d899cf6f..ac2a7526 100644 --- a/ungleich_page/static/ungleich_page/css/cms.css +++ b/ungleich_page/static/ungleich_page/css/cms.css @@ -3,4 +3,10 @@ font-size: 21px; color: #3a3a3a; font-weight: 300 !important; -} \ No newline at end of file +} + +@media(min-width: 768px) { + .custom-padding-bottom{ + padding-bottom: 0; + } +} diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html index 4f2331ef..a4b50e5c 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_services.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_services.html @@ -1,5 +1,5 @@ {% load static i18n cms_tags %} -
    +

    {{ service_instance.title }}

    From c4485623841e0995b3a5cfdec29d4b661370a10e Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 16:04:18 +0200 Subject: [PATCH 50/55] Remove empty items from menu --- ungleich_page/cms_menus.py | 4 +++- ungleich_page/templates/ungleich_page/glasfaser_cms_page.html | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ungleich_page/cms_menus.py b/ungleich_page/cms_menus.py index ebba3515..f3a2a694 100644 --- a/ungleich_page/cms_menus.py +++ b/ungleich_page/cms_menus.py @@ -37,6 +37,8 @@ class TestMenu(CMSAttachMenu): section_hash = request.build_absolute_uri() if hasattr(plugin, 'menu_text'): menu_text = plugin.menu_text + if menu_text.strip() == '': + continue menu_words = menu_text.split() if len(menu_words) > 0: section_hash = '{}#{}'.format( @@ -56,4 +58,4 @@ class TestMenu(CMSAttachMenu): return nodes -menu_pool.register_menu(TestMenu) \ No newline at end of file +menu_pool.register_menu(TestMenu) diff --git a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html index 8f76b29f..0aebb93c 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html +++ b/ungleich_page/templates/ungleich_page/glasfaser_cms_page.html @@ -61,7 +61,7 @@ From e7c7f6f73aa9e5f7889e4275955e13e0e4404a05 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 16:23:28 +0200 Subject: [PATCH 51/55] Show background image and link only if specified --- .../templates/ungleich_page/glasfaser/section_with_image.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html index 7d921016..6d9fe47b 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_with_image.html @@ -1,6 +1,6 @@
    From 39ca45cfb92de8fa63b250afa3f13b1bd3efdcb1 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 17:23:19 +0200 Subject: [PATCH 52/55] Make fields of contact section customizable --- .../migrations/0005_auto_20171019_1517.py | 45 +++++++++++++++++++ ungleich_page/models.py | 17 ++++++- .../glasfaser/section_contact.html | 10 ++--- 3 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 ungleich_page/migrations/0005_auto_20171019_1517.py diff --git a/ungleich_page/migrations/0005_auto_20171019_1517.py b/ungleich_page/migrations/0005_auto_20171019_1517.py new file mode 100644 index 00000000..915f3582 --- /dev/null +++ b/ungleich_page/migrations/0005_auto_20171019_1517.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.4 on 2017-10-19 15:17 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('ungleich_page', '0004_auto_20171019_1113'), + ] + + operations = [ + migrations.AddField( + model_name='ungelichcontactussection', + name='address', + field=models.CharField(blank=True, default='In der Au 7, Schwanden 8762', max_length=100), + ), + migrations.AddField( + model_name='ungelichcontactussection', + name='contact_form_header_text', + field=models.CharField(blank=True, default='Send us a message.', max_length=100), + ), + migrations.AddField( + model_name='ungelichcontactussection', + name='contact_text', + field=models.CharField(blank=True, default='Contact', max_length=100), + ), + migrations.AddField( + model_name='ungelichcontactussection', + name='country', + field=models.CharField(blank=True, default='Switzerland', max_length=100), + ), + migrations.AddField( + model_name='ungelichcontactussection', + name='organization_name', + field=models.CharField(blank=True, default='ungleich GmbH', max_length=100), + ), + migrations.AlterField( + model_name='ungelichcontactussection', + name='email', + field=models.EmailField(default='info@ungleich.ch', max_length=200), + ), + ] diff --git a/ungleich_page/models.py b/ungleich_page/models.py index bac70d2a..f32c7414 100644 --- a/ungleich_page/models.py +++ b/ungleich_page/models.py @@ -27,7 +27,22 @@ class SectionWithImage(UngelichPicture): class UngelichContactUsSection(CMSPlugin): menu_text = models.CharField(max_length=100, default="", blank=True) - email = models.EmailField(max_length=200) + email = models.EmailField(max_length=200, default="info@ungleich.ch") + contact_text = models.CharField( + max_length=100, default="Contact", blank=True + ) + organization_name = models.CharField( + max_length=100, default="ungleich GmbH", blank=True + ) + address = models.CharField( + max_length=100, default="In der Au 7, Schwanden 8762", blank=True + ) + country = models.CharField( + max_length=100, default="Switzerland", blank=True + ) + contact_form_header_text = models.CharField( + max_length=100, default="Send us a message.", blank=True + ) class UngelichTextSection(CMSPlugin): diff --git a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html index cd1c856b..26a3275c 100644 --- a/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html +++ b/ungleich_page/templates/ungleich_page/glasfaser/section_contact.html @@ -6,16 +6,16 @@
    -

    Kontakt

    +

    {{instance.contact_text}}

    -

    ungleich GmbH

    +

    {{instance.organization_name}}

    {{instance.email}}

    -

    In der Au 7, Schwanden 8762

    -

    Switzerland

    +

    {{instance.address}}

    +

    {{instance.country}}