From 39ca45cfb92de8fa63b250afa3f13b1bd3efdcb1 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Oct 2017 17:23:19 +0200 Subject: [PATCH] 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}}