2017-10-17 13:52:30 +00:00
|
|
|
from cms.models.pluginmodel import CMSPlugin
|
|
|
|
from django.db import models
|
2017-10-17 15:51:01 +00:00
|
|
|
from djangocms_text_ckeditor.fields import HTMLField
|
2017-10-17 13:52:30 +00:00
|
|
|
from filer.fields.image import FilerImageField
|
2016-04-10 21:12:43 +00:00
|
|
|
|
2017-10-17 13:52:30 +00:00
|
|
|
|
|
|
|
class UngelichPicture(CMSPlugin):
|
|
|
|
image = FilerImageField(
|
|
|
|
null=True,
|
|
|
|
blank=True,
|
|
|
|
related_name="image",
|
|
|
|
on_delete=models.SET_NULL
|
|
|
|
)
|
2017-11-17 14:48:44 +00:00
|
|
|
title = HTMLField()
|
2017-10-17 14:25:01 +00:00
|
|
|
|
|
|
|
|
2017-10-18 22:28:34 +00:00
|
|
|
class SectionWithImage(UngelichPicture):
|
2017-10-19 11:40:48 +00:00
|
|
|
menu_text = models.CharField(max_length=100, default="", blank=True)
|
2017-10-18 22:28:34 +00:00
|
|
|
price_tag_image = FilerImageField(
|
|
|
|
null=True,
|
|
|
|
blank=True,
|
|
|
|
related_name="price_tag_image",
|
|
|
|
on_delete=models.SET_NULL
|
|
|
|
)
|
2017-10-19 11:40:48 +00:00
|
|
|
price_tag_url = models.URLField(max_length=300, default="", blank=True)
|
2017-10-18 22:28:34 +00:00
|
|
|
|
|
|
|
|
2017-10-17 14:25:01 +00:00
|
|
|
class UngelichContactUsSection(CMSPlugin):
|
2017-10-19 11:40:48 +00:00
|
|
|
menu_text = models.CharField(max_length=100, default="", blank=True)
|
2017-10-19 15:23:19 +00:00
|
|
|
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
|
|
|
|
)
|
2017-10-17 15:51:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
class UngelichTextSection(CMSPlugin):
|
2017-10-19 11:40:48 +00:00
|
|
|
menu_text = models.CharField(max_length=100, default="", blank=True)
|
2017-10-17 15:51:01 +00:00
|
|
|
title = models.CharField(max_length=200)
|
|
|
|
description = HTMLField()
|
2017-10-18 07:10:50 +00:00
|
|
|
|
|
|
|
|
2017-10-18 13:43:12 +00:00
|
|
|
class Service(CMSPlugin):
|
2017-10-19 11:40:48 +00:00
|
|
|
menu_text = models.CharField(max_length=100, default="", blank=True)
|
2017-10-18 13:43:12 +00:00
|
|
|
title = models.CharField(max_length=200)
|
|
|
|
sub_title = models.CharField(max_length=200)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.title
|
|
|
|
|
|
|
|
|
|
|
|
class ServiceItem(CMSPlugin):
|
2017-10-18 07:10:50 +00:00
|
|
|
image = FilerImageField(
|
|
|
|
null=True,
|
|
|
|
blank=True,
|
2017-10-18 13:43:12 +00:00
|
|
|
related_name="service_item_image",
|
2017-10-18 07:10:50 +00:00
|
|
|
on_delete=models.SET_NULL
|
2017-10-18 13:43:12 +00:00
|
|
|
)
|
|
|
|
title = models.CharField(max_length=200)
|
|
|
|
description = HTMLField()
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.title
|
|
|
|
|
2017-10-18 14:53:32 +00:00
|
|
|
|
|
|
|
class About(Service):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class AboutItem(UngelichPicture):
|
|
|
|
inverted = models.BooleanField(default=False)
|
2017-10-20 06:50:30 +00:00
|
|
|
link_url = models.URLField(max_length=300, default="", blank=True)
|
2017-10-18 14:53:32 +00:00
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
alignment = "Right" if self.inverted else "Left"
|
|
|
|
return "{alignment} - {title}".format(
|
|
|
|
alignment=alignment, title=self.title
|
|
|
|
)
|
2017-11-17 16:36:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
class UngleichServiceItem(ServiceItem):
|
|
|
|
data_replaced_image = FilerImageField(
|
|
|
|
null=True,
|
|
|
|
blank=True,
|
|
|
|
related_name="service_item_data_replaced_image",
|
|
|
|
on_delete=models.SET_NULL
|
|
|
|
)
|