-
- {% for plugin in instance.child_plugin_instances %}
- {% render_plugin plugin %}
- {% endfor %}
+
+{% if instance.gallery_type == 'image_slider' %}
+
+
+
+
+ {% for plugin in instance.child_plugin_instances %}
+ {% render_plugin plugin %}
+ {% endfor %}
+
-
-
+
+
+{% elif instance.gallery_type == 'logo_static' %}
+
+
+
{{instance.title}}
+
+ {% for plugin in instance.child_plugin_instances %}
+ {% render_plugin plugin %}
+ {% endfor %}
+
+
{{instance.url_text}}
+
+
+
+{% elif instance.gallery_type == 'in_column' %}
+
+
+ {% if instance.title %}
+
{{instance.title | safe}}
+ {% endif %}
+
+ {% for plugin in instance.child_plugin_instances %}
+ {% render_plugin plugin %}
+ {% endfor %}
+
+
+
+{% endif %}
diff --git a/foundation/okfplugins/hero_punch/cms_plugins.py b/foundation/okfplugins/hero_punch/cms_plugins.py
index e4b6b03e..10d3bcd3 100644
--- a/foundation/okfplugins/hero_punch/cms_plugins.py
+++ b/foundation/okfplugins/hero_punch/cms_plugins.py
@@ -3,6 +3,7 @@
from django.utils.translation import gettext_lazy as _
from .models import HeroPunch
+from .forms import HeroPunchForm
@plugin_pool.register_plugin
@@ -12,3 +13,4 @@ class HeroPunchPlugin(CMSPluginBase):
render_template = "hero_punch_plugin.html"
cache = False
name = _("HeroPunch")
+ form = HeroPunchForm
diff --git a/foundation/okfplugins/hero_punch/forms.py b/foundation/okfplugins/hero_punch/forms.py
new file mode 100644
index 00000000..c6acd956
--- /dev/null
+++ b/foundation/okfplugins/hero_punch/forms.py
@@ -0,0 +1,6 @@
+from django.forms import ModelForm
+from foundation.core.svg import SvgAndImageFormField
+
+
+class HeroPunchForm(ModelForm):
+ image = SvgAndImageFormField()
diff --git a/foundation/okfplugins/hero_punch/migrations/0003_heropunch_banner_type_heropunch_text_heropunch_url_and_more.py b/foundation/okfplugins/hero_punch/migrations/0003_heropunch_banner_type_heropunch_text_heropunch_url_and_more.py
new file mode 100644
index 00000000..d6378364
--- /dev/null
+++ b/foundation/okfplugins/hero_punch/migrations/0003_heropunch_banner_type_heropunch_text_heropunch_url_and_more.py
@@ -0,0 +1,41 @@
+# Generated by Django 4.2.3 on 2023-08-09 08:51
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("hero_punch", "0002_alter_heropunch_cmsplugin_ptr"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="heropunch",
+ name="banner_type",
+ field=models.CharField(
+ choices=[
+ ("default", "Default"),
+ ("opening_default", "Opening Default"),
+ ("opening_center", "Opening Center"),
+ ("cta_newsletter", "Newsletter"),
+ ],
+ default="default",
+ max_length=15,
+ ),
+ ),
+ migrations.AddField(
+ model_name="heropunch",
+ name="text",
+ field=models.CharField(blank=True, max_length=400),
+ ),
+ migrations.AddField(
+ model_name="heropunch",
+ name="url",
+ field=models.CharField(blank=True, max_length=400),
+ ),
+ migrations.AddField(
+ model_name="heropunch",
+ name="url_text",
+ field=models.CharField(blank=True, max_length=100),
+ ),
+ ]
diff --git a/foundation/okfplugins/hero_punch/migrations/0004_alter_heropunch_banner_type.py b/foundation/okfplugins/hero_punch/migrations/0004_alter_heropunch_banner_type.py
new file mode 100644
index 00000000..25fec672
--- /dev/null
+++ b/foundation/okfplugins/hero_punch/migrations/0004_alter_heropunch_banner_type.py
@@ -0,0 +1,28 @@
+# Generated by Django 4.2.3 on 2023-08-18 02:18
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ (
+ "hero_punch",
+ "0003_heropunch_banner_type_heropunch_text_heropunch_url_and_more",
+ ),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="heropunch",
+ name="banner_type",
+ field=models.CharField(
+ choices=[
+ ("default", "Default"),
+ ("opening_default", "Opening Default"),
+ ("opening_center", "Opening Center"),
+ ],
+ default="default",
+ max_length=15,
+ ),
+ ),
+ ]
diff --git a/foundation/okfplugins/hero_punch/models.py b/foundation/okfplugins/hero_punch/models.py
index eef8496a..59813bf6 100644
--- a/foundation/okfplugins/hero_punch/models.py
+++ b/foundation/okfplugins/hero_punch/models.py
@@ -1,11 +1,21 @@
from django.db import models
from cms.models.pluginmodel import CMSPlugin
+LIST_TYPES = (
+ ("default", "Default"),
+ ("opening_default", "Opening Default"),
+ ("opening_center", "Opening Center"),
+)
+
class HeroPunch(CMSPlugin):
title = models.CharField(max_length=200)
+ text = models.CharField(max_length=400, blank=True)
image = models.ImageField(upload_to="hero_punch/images")
image_alt = models.CharField(max_length=200, default="", blank=True)
+ banner_type = models.CharField(max_length=15, choices=LIST_TYPES, default="default")
+ url = models.CharField(max_length=400, blank=True)
+ url_text = models.CharField(max_length=100, blank=True)
def __str__(self):
return self.title
diff --git a/foundation/okfplugins/hero_punch/templates/hero_punch_plugin.html b/foundation/okfplugins/hero_punch/templates/hero_punch_plugin.html
index 70456e60..60130577 100644
--- a/foundation/okfplugins/hero_punch/templates/hero_punch_plugin.html
+++ b/foundation/okfplugins/hero_punch/templates/hero_punch_plugin.html
@@ -1,16 +1,49 @@
-
-
-
-
-
-
- {{ instance.title }}
-
+
+{% if instance.banner_type == 'default' %}
+
+
+
+
+
+ {{ instance.title }}
+
+
+
+
+
-
-
+
+
+
+
+{% elif instance.banner_type == 'opening_default' %}
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+{% elif instance.banner_type == 'opening_center' %}
+
+
+
+
{{ instance.title | safe }}
+
+ {{ instance.text | safe}}
+
+
{{ instance.url_text }}
+
+
+{% endif %}
diff --git a/foundation/okfplugins/image/migrations/0006_okimage_full_width.py b/foundation/okfplugins/image/migrations/0006_okimage_full_width.py
index e159ecc2..b398a8ac 100644
--- a/foundation/okfplugins/image/migrations/0006_okimage_full_width.py
+++ b/foundation/okfplugins/image/migrations/0006_okimage_full_width.py
@@ -4,15 +4,14 @@
class Migration(migrations.Migration):
-
dependencies = [
- ('image', '0005_okimage_text_black'),
+ ("image", "0005_okimage_text_black"),
]
operations = [
migrations.AddField(
- model_name='okimage',
- name='full_width',
+ model_name="okimage",
+ name="full_width",
field=models.BooleanField(default=False),
),
]
diff --git a/foundation/okfplugins/image/migrations/0007_okimage_in_carousel.py b/foundation/okfplugins/image/migrations/0007_okimage_in_carousel.py
index b66a39a9..4dba17ed 100644
--- a/foundation/okfplugins/image/migrations/0007_okimage_in_carousel.py
+++ b/foundation/okfplugins/image/migrations/0007_okimage_in_carousel.py
@@ -4,15 +4,14 @@
class Migration(migrations.Migration):
-
dependencies = [
- ('image', '0006_okimage_full_width'),
+ ("image", "0006_okimage_full_width"),
]
operations = [
migrations.AddField(
- model_name='okimage',
- name='in_carousel',
+ model_name="okimage",
+ name="in_carousel",
field=models.BooleanField(default=False),
),
]
diff --git a/foundation/okfplugins/image/migrations/0008_alter_okimage_cmsplugin_ptr.py b/foundation/okfplugins/image/migrations/0008_alter_okimage_cmsplugin_ptr.py
index ca581779..e39d9412 100644
--- a/foundation/okfplugins/image/migrations/0008_alter_okimage_cmsplugin_ptr.py
+++ b/foundation/okfplugins/image/migrations/0008_alter_okimage_cmsplugin_ptr.py
@@ -5,7 +5,6 @@
class Migration(migrations.Migration):
-
dependencies = [
("cms", "0022_auto_20180620_1551"),
("image", "0007_okimage_in_carousel"),
diff --git a/foundation/okfplugins/image/migrations/0010_okimage_is_logo.py b/foundation/okfplugins/image/migrations/0010_okimage_is_logo.py
new file mode 100644
index 00000000..8d808f67
--- /dev/null
+++ b/foundation/okfplugins/image/migrations/0010_okimage_is_logo.py
@@ -0,0 +1,17 @@
+# Generated by Django 4.2.3 on 2023-08-22 09:25
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("image", "0009_alter_okimage_show_caption"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="okimage",
+ name="is_logo",
+ field=models.BooleanField(default=False),
+ ),
+ ]
diff --git a/foundation/okfplugins/image/models.py b/foundation/okfplugins/image/models.py
index 80f13244..83598967 100644
--- a/foundation/okfplugins/image/models.py
+++ b/foundation/okfplugins/image/models.py
@@ -16,6 +16,7 @@ class OKImage(CMSPlugin):
in_column = models.BooleanField(default=False)
in_gallery = models.BooleanField(default=False)
in_carousel = models.BooleanField(default=False)
+ is_logo = models.BooleanField(default=False)
text_black = models.BooleanField(default=False)
full_width = models.BooleanField(default=False)
diff --git a/foundation/okfplugins/image/templates/okimage_plugin.html b/foundation/okfplugins/image/templates/okimage_plugin.html
index 845eac94..c8600206 100644
--- a/foundation/okfplugins/image/templates/okimage_plugin.html
+++ b/foundation/okfplugins/image/templates/okimage_plugin.html
@@ -1,14 +1,31 @@
+
{% if instance.in_gallery %}
-
-
-
+
+
+ {% if instance.is_logo %}
+ {% if instance.url %}
+
+ {% endif %}
+
+ {% if instance.url %}
+
+ {% endif %}
+ {% else %}
+
+
+
+ {% endif %}
+
+
{% elif instance.in_carousel %}