2024-12-10 22:05:36 +00:00
|
|
|
"""
|
|
|
|
View classes for all possible section types.
|
|
|
|
"""
|
|
|
|
|
2020-03-22 11:46:10 +00:00
|
|
|
from cms.decorators import section_view
|
2022-12-25 20:52:42 +00:00
|
|
|
from cms.views import ContactSectionFormView, SectionView
|
2022-01-29 11:56:45 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2021-07-03 23:59:48 +00:00
|
|
|
|
2020-03-21 17:49:41 +00:00
|
|
|
|
2020-03-22 11:46:10 +00:00
|
|
|
@section_view
|
|
|
|
class Text(SectionView):
|
2024-12-10 22:05:36 +00:00
|
|
|
"""
|
|
|
|
A section that displays text.
|
|
|
|
"""
|
|
|
|
|
2021-07-03 23:59:48 +00:00
|
|
|
verbose_name = _("Text")
|
|
|
|
template_name = "text.html"
|
2022-12-25 20:52:42 +00:00
|
|
|
fields = ["content"]
|
2021-07-03 23:59:48 +00:00
|
|
|
|
2020-03-21 17:49:41 +00:00
|
|
|
|
2020-03-22 11:46:10 +00:00
|
|
|
@section_view
|
|
|
|
class Images(SectionView):
|
2024-12-10 22:05:36 +00:00
|
|
|
"""
|
|
|
|
A section that displays images.
|
|
|
|
"""
|
|
|
|
|
2021-07-03 23:59:48 +00:00
|
|
|
verbose_name = _("Image(s)")
|
|
|
|
template_name = "images.html"
|
2022-12-25 20:52:42 +00:00
|
|
|
fields = ["images"]
|
2021-07-03 23:59:48 +00:00
|
|
|
|
2020-03-21 17:49:41 +00:00
|
|
|
|
2020-03-22 11:46:10 +00:00
|
|
|
@section_view
|
|
|
|
class Video(SectionView):
|
2024-12-10 22:05:36 +00:00
|
|
|
"""
|
|
|
|
A section that displays a video.
|
|
|
|
"""
|
|
|
|
|
2021-07-03 23:59:48 +00:00
|
|
|
verbose_name = _("Video")
|
|
|
|
template_name = "video.html"
|
2022-12-25 20:52:42 +00:00
|
|
|
fields = ["video"]
|
2021-07-03 23:59:48 +00:00
|
|
|
|
2020-03-21 17:49:41 +00:00
|
|
|
|
2020-03-22 11:46:10 +00:00
|
|
|
@section_view
|
2022-12-25 20:52:42 +00:00
|
|
|
class Contact(ContactSectionFormView):
|
2024-12-10 22:05:36 +00:00
|
|
|
"""
|
|
|
|
A section that displays a contact form.
|
|
|
|
"""
|
|
|
|
|
2021-07-03 23:59:48 +00:00
|
|
|
verbose_name = _("Contact")
|
|
|
|
template_name = "contact.html"
|
2022-12-25 20:52:42 +00:00
|
|
|
fields = ["content", "href"]
|