Make fields of contact section customizable

This commit is contained in:
M.Ravi 2017-10-19 17:23:19 +02:00
parent e7c7f6f73a
commit 39ca45cfb9
3 changed files with 66 additions and 6 deletions

View file

@ -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),
),
]

View file

@ -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):

View file

@ -6,16 +6,16 @@
<div class="row">
<div class="col-sm-6">
<div class="title">
<h2>Kontakt</h2>
<h2>{{instance.contact_text}}</h2>
</div>
<div class="contact-details">
<div class="subtitle">
<h3>ungleich GmbH</h3>
<h3>{{instance.organization_name}}</h3>
</div>
<div class="description">
<p>{{instance.email}}</p>
<p>In der Au 7, Schwanden 8762</p>
<p>Switzerland</p>
<p>{{instance.address}}</p>
<p>{{instance.country}}</p>
</div>
</div>
<div class="social">
@ -39,7 +39,7 @@
<div class="row">
<div class="col-sm-offset-2 col-sm-10">
<div class="subtitle">
<h3>Senden Sie uns eine Nachricht.</h3>
<h3>{{instance.contact_form_header_text}}</h3>
</div>
</div>
</div>