diff --git a/foundation/okfplugins/feature_block/cms_plugins.py b/foundation/okfplugins/feature_block/cms_plugins.py index d4ba9d6b..e634e901 100644 --- a/foundation/okfplugins/feature_block/cms_plugins.py +++ b/foundation/okfplugins/feature_block/cms_plugins.py @@ -2,7 +2,24 @@ from cms.plugin_pool import plugin_pool from django.utils.translation import gettext_lazy as _ from .forms import FeatureBlockForm -from .models import FeatureBlock +from .models import FeatureBlock, FeatureBlockContainer + + +@plugin_pool.register_plugin +class FeatureBlockContainerPlugin(CMSPluginBase): + model = FeatureBlockContainer + module = "OKF v2" + + cache = False + allow_children = True + render_template = "feature_block_container_plugin.html" + name = _("Feature Block Container") + child_classes = ["FeatureBlockPlugin"] + + def render(self, context, instance, placeholder): + context = super().render(context, instance, placeholder) + + return context @plugin_pool.register_plugin diff --git a/foundation/okfplugins/feature_block/forms.py b/foundation/okfplugins/feature_block/forms.py index 88de50d8..2dc34644 100644 --- a/foundation/okfplugins/feature_block/forms.py +++ b/foundation/okfplugins/feature_block/forms.py @@ -3,4 +3,4 @@ class FeatureBlockForm(ModelForm): - image = SvgAndImageFormField() + image = SvgAndImageFormField(required=False) diff --git a/foundation/okfplugins/feature_block/migrations/0007_alter_featureblock_block_type.py b/foundation/okfplugins/feature_block/migrations/0007_alter_featureblock_block_type.py index f273405d..04879fa5 100644 --- a/foundation/okfplugins/feature_block/migrations/0007_alter_featureblock_block_type.py +++ b/foundation/okfplugins/feature_block/migrations/0007_alter_featureblock_block_type.py @@ -4,15 +4,27 @@ class Migration(migrations.Migration): - dependencies = [ - ('feature_block', '0006_alter_featureblock_block_type'), + ("feature_block", "0006_alter_featureblock_block_type"), ] operations = [ migrations.AlterField( - model_name='featureblock', - name='block_type', - field=models.CharField(choices=[('yellow', 'Yellow'), ('white', 'White'), ('transparent_title', 'Transparent with Title'), ('transparent', 'Transparent'), ('background_rounded', 'Rounded corners'), ('blue', 'Blue Background'), ('yellow', 'Yellow Background'), ('purple', 'Purple Background')], default='yellow', max_length=20), + model_name="featureblock", + name="block_type", + field=models.CharField( + choices=[ + ("yellow", "Yellow"), + ("white", "White"), + ("transparent_title", "Transparent with Title"), + ("transparent", "Transparent"), + ("background_rounded", "Rounded corners"), + ("blue", "Blue Background"), + ("yellow", "Yellow Background"), + ("purple", "Purple Background"), + ], + default="yellow", + max_length=20, + ), ), ] diff --git a/foundation/okfplugins/feature_block/migrations/0008_alter_featureblock_cmsplugin_ptr.py b/foundation/okfplugins/feature_block/migrations/0008_alter_featureblock_cmsplugin_ptr.py index 058c595b..fbb5164c 100644 --- a/foundation/okfplugins/feature_block/migrations/0008_alter_featureblock_cmsplugin_ptr.py +++ b/foundation/okfplugins/feature_block/migrations/0008_alter_featureblock_cmsplugin_ptr.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("cms", "0022_auto_20180620_1551"), ("feature_block", "0007_alter_featureblock_block_type"), diff --git a/foundation/okfplugins/feature_block/migrations/0010_alter_featureblock_block_type.py b/foundation/okfplugins/feature_block/migrations/0010_alter_featureblock_block_type.py new file mode 100644 index 00000000..28b24459 --- /dev/null +++ b/foundation/okfplugins/feature_block/migrations/0010_alter_featureblock_block_type.py @@ -0,0 +1,31 @@ +# Generated by Django 4.2.3 on 2023-08-09 09:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("feature_block", "0009_alter_featureblock_block_type"), + ] + + operations = [ + migrations.AlterField( + model_name="featureblock", + name="block_type", + field=models.CharField( + choices=[ + ("yellow", "Yellow"), + ("white", "White"), + ("transparent_title", "Transparent with Title"), + ("transparent_no_title", "Transparent without Title"), + ("background_rounded", "Rounded corners"), + ("header_background", "Header Background"), + ("blue", "Blue Background"), + ("yellow", "Yellow Background"), + ("purple", "Purple Background"), + ], + default="yellow", + max_length=20, + ), + ), + ] diff --git a/foundation/okfplugins/feature_block/migrations/0011_featureblockcontainer.py b/foundation/okfplugins/feature_block/migrations/0011_featureblockcontainer.py new file mode 100644 index 00000000..8f99e66f --- /dev/null +++ b/foundation/okfplugins/feature_block/migrations/0011_featureblockcontainer.py @@ -0,0 +1,36 @@ +# Generated by Django 4.2.3 on 2023-08-14 06:08 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + dependencies = [ + ("cms", "0022_auto_20180620_1551"), + ("feature_block", "0010_alter_featureblock_block_type"), + ] + + operations = [ + migrations.CreateModel( + name="FeatureBlockContainer", + fields=[ + ( + "cmsplugin_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + related_name="%(app_label)s_%(class)s", + serialize=False, + to="cms.cmsplugin", + ), + ), + ("title", models.CharField(max_length=200)), + ], + options={ + "abstract": False, + }, + bases=("cms.cmsplugin",), + ), + ] diff --git a/foundation/okfplugins/feature_block/migrations/0012_merge_20230822_0807.py b/foundation/okfplugins/feature_block/migrations/0012_merge_20230822_0807.py new file mode 100644 index 00000000..765cfbbb --- /dev/null +++ b/foundation/okfplugins/feature_block/migrations/0012_merge_20230822_0807.py @@ -0,0 +1,12 @@ +# Generated by Django 4.2.3 on 2023-08-22 08:07 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("feature_block", "0010_featureblock_text_color"), + ("feature_block", "0011_featureblockcontainer"), + ] + + operations = [] diff --git a/foundation/okfplugins/feature_block/migrations/0013_alter_featureblock_block_type.py b/foundation/okfplugins/feature_block/migrations/0013_alter_featureblock_block_type.py new file mode 100644 index 00000000..15f382db --- /dev/null +++ b/foundation/okfplugins/feature_block/migrations/0013_alter_featureblock_block_type.py @@ -0,0 +1,31 @@ +# Generated by Django 4.2.3 on 2023-08-22 08:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("feature_block", "0012_merge_20230822_0807"), + ] + + operations = [ + migrations.AlterField( + model_name="featureblock", + name="block_type", + field=models.CharField( + choices=[ + ("yellow_box", "Yellow Box"), + ("white_box", "White Box"), + ("transparent_title", "Transparent with Title"), + ("transparent_no_title", "Transparent without Title"), + ("background_rounded", "Rounded corners"), + ("header_background", "Header Background"), + ("blue", "Blue Background"), + ("yellow", "Yellow Background"), + ("purple", "Purple Background"), + ], + default="yellow", + max_length=20, + ), + ), + ] diff --git a/foundation/okfplugins/feature_block/migrations/0014_featureblockcontainer_show_title.py b/foundation/okfplugins/feature_block/migrations/0014_featureblockcontainer_show_title.py new file mode 100644 index 00000000..821740b0 --- /dev/null +++ b/foundation/okfplugins/feature_block/migrations/0014_featureblockcontainer_show_title.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.3 on 2023-09-13 07:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("feature_block", "0013_alter_featureblock_block_type"), + ] + + operations = [ + migrations.AddField( + model_name="featureblockcontainer", + name="show_title", + field=models.BooleanField(default=False), + ), + ] diff --git a/foundation/okfplugins/feature_block/models.py b/foundation/okfplugins/feature_block/models.py index 16fb8fce..e7594ac7 100644 --- a/foundation/okfplugins/feature_block/models.py +++ b/foundation/okfplugins/feature_block/models.py @@ -6,18 +6,24 @@ ("yellow_box", "Yellow Box"), ("white_box", "White Box"), ("transparent_title", "Transparent with Title"), - ("transparent", "Transparent"), + ("transparent_no_title", "Transparent without Title"), ("background_rounded", "Rounded corners"), + ("header_background", "Header Background"), ("blue", "Blue Background"), ("yellow", "Yellow Background"), ("purple", "Purple Background"), ) -TEXT_COLOR_CHOICES = ( - ("black", "Black"), - ("white", "White") -) +TEXT_COLOR_CHOICES = (("black", "Black"), ("white", "White")) + + +class FeatureBlockContainer(CMSPlugin): + title = models.CharField(max_length=200) + show_title = models.BooleanField(default=False) + + def __str__(self): + return self.title class FeatureBlock(CMSPlugin): diff --git a/foundation/okfplugins/feature_block/templates/feature_block_container_plugin.html b/foundation/okfplugins/feature_block/templates/feature_block_container_plugin.html new file mode 100644 index 00000000..9ee6fde6 --- /dev/null +++ b/foundation/okfplugins/feature_block/templates/feature_block_container_plugin.html @@ -0,0 +1,12 @@ +
+
+ {% if instance.show_title %} +

{{ instance.title | safe }}

+ {% endif %} +
+ {% for instance in instance.child_plugin_instances %} + {% include 'feature_block_plugin.html' with instance=instance %} + {% endfor %} +
+
+
\ No newline at end of file diff --git a/foundation/okfplugins/feature_block/templates/feature_block_plugin.html b/foundation/okfplugins/feature_block/templates/feature_block_plugin.html index a0e3f0ac..854aa655 100644 --- a/foundation/okfplugins/feature_block/templates/feature_block_plugin.html +++ b/foundation/okfplugins/feature_block/templates/feature_block_plugin.html @@ -1,3 +1,4 @@ + {% if instance.block_type == 'white_box'%} {% if instance.url and instance.url != '' %} @@ -12,9 +13,27 @@

{{ instance.title }}

{% else %} {% endif %} + + +{% elif instance.block_type == 'yellow_box' %} + {% if instance.url and instance.url != '' %} +
+ {% else %} +
+ {% endif %} +

{{ instance.title }}

+

{{ instance.text }}

+ + {% if instance.url and instance.url != '' %} +
+ {% else %} +
+ {% endif %} + + {% elif instance.block_type == 'transparent_title' %} {% if instance.url and instance.url != '' %} - + {% else %}
{% endif %} @@ -36,49 +55,53 @@

{{ instance.title }}

{% else %}
{% endif %} -{% elif instance.block_type == 'transparent' %} + + +{% elif instance.block_type == 'transparent_no_title' %} {% if instance.url and instance.url != '' %}
{% else %}
{% endif %} -
- -
- {{ instance.text}} +
+ +
+ {{ instance.text}} {% if instance.url and instance.url != '' %} - - Learn more - + + Learn more +
{% else %}
{% endif %} + + {% elif instance.block_type == 'background_rounded' %} - -

{{ instance.title }}

-
- OKFN -
-
-{% elif instance.block_type == 'yellow_box' %} - {% if instance.url and instance.url != '' %} - - {% else %} -
- {% endif %} -

{{ instance.title }}

-

{{ instance.text }}

- - {% if instance.url and instance.url != '' %} +
+

{{ instance.title }}

+
+ OKFN +
- {% else %} -
- {% endif %} + + {% elif instance.block_type == 'blue' or instance.block_type == 'purple' or instance.block_type == 'yellow'%} - -

{{ instance.title }}

-
+ +

{{ instance.title }}

+
+ + +{% elif instance.block_type == 'header_background' %} + +

+ {{ instance.title }} + {{ instance.text }} +

+ Learn more +
+ + {% else %} {% if instance.url and instance.url != '' %} @@ -94,4 +117,4 @@

{{ instance.title }}

{% endif %} -{% endif %} +{% endif %} \ No newline at end of file diff --git a/foundation/okfplugins/gallery/migrations/0002_alter_gallery_cmsplugin_ptr.py b/foundation/okfplugins/gallery/migrations/0002_alter_gallery_cmsplugin_ptr.py index 382511f1..021e1ec0 100644 --- a/foundation/okfplugins/gallery/migrations/0002_alter_gallery_cmsplugin_ptr.py +++ b/foundation/okfplugins/gallery/migrations/0002_alter_gallery_cmsplugin_ptr.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("cms", "0022_auto_20180620_1551"), ("gallery", "0001_initial"), diff --git a/foundation/okfplugins/gallery/migrations/0003_gallery_gallery_type_gallery_url_gallery_url_text.py b/foundation/okfplugins/gallery/migrations/0003_gallery_gallery_type_gallery_url_gallery_url_text.py new file mode 100644 index 00000000..61d8f9e8 --- /dev/null +++ b/foundation/okfplugins/gallery/migrations/0003_gallery_gallery_type_gallery_url_gallery_url_text.py @@ -0,0 +1,34 @@ +# Generated by Django 4.2.3 on 2023-08-09 08:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("gallery", "0002_alter_gallery_cmsplugin_ptr"), + ] + + operations = [ + migrations.AddField( + model_name="gallery", + name="gallery_type", + field=models.CharField( + choices=[ + ("image_slider", "Image Slider"), + ("logo_static", "Static Logo"), + ], + default="image_slider", + max_length=20, + ), + ), + migrations.AddField( + model_name="gallery", + name="url", + field=models.CharField(blank=True, max_length=400), + ), + migrations.AddField( + model_name="gallery", + name="url_text", + field=models.CharField(blank=True, max_length=100), + ), + ] diff --git a/foundation/okfplugins/gallery/migrations/0004_merge_20230830_0745.py b/foundation/okfplugins/gallery/migrations/0004_merge_20230830_0745.py new file mode 100644 index 00000000..a32e90b3 --- /dev/null +++ b/foundation/okfplugins/gallery/migrations/0004_merge_20230830_0745.py @@ -0,0 +1,12 @@ +# Generated by Django 4.2.3 on 2023-08-30 07:45 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("gallery", "0003_gallery_circle_position_gallery_color_gallery_size"), + ("gallery", "0003_gallery_gallery_type_gallery_url_gallery_url_text"), + ] + + operations = [] diff --git a/foundation/okfplugins/gallery/migrations/0005_alter_gallery_gallery_type.py b/foundation/okfplugins/gallery/migrations/0005_alter_gallery_gallery_type.py new file mode 100644 index 00000000..9c3fb8ce --- /dev/null +++ b/foundation/okfplugins/gallery/migrations/0005_alter_gallery_gallery_type.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.3 on 2023-09-13 07:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("gallery", "0004_merge_20230830_0745"), + ] + + operations = [ + migrations.AlterField( + model_name="gallery", + name="gallery_type", + field=models.CharField( + choices=[ + ("image_slider", "Image Slider"), + ("logo_static", "Static Logo"), + ("column", "In Column"), + ], + default="image_slider", + max_length=20, + ), + ), + ] diff --git a/foundation/okfplugins/gallery/migrations/0006_alter_gallery_gallery_type.py b/foundation/okfplugins/gallery/migrations/0006_alter_gallery_gallery_type.py new file mode 100644 index 00000000..1c8ff860 --- /dev/null +++ b/foundation/okfplugins/gallery/migrations/0006_alter_gallery_gallery_type.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.3 on 2023-09-13 07:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("gallery", "0005_alter_gallery_gallery_type"), + ] + + operations = [ + migrations.AlterField( + model_name="gallery", + name="gallery_type", + field=models.CharField( + choices=[ + ("image_slider", "Image Slider"), + ("logo_static", "Static Logo"), + ("in_column", "In Column"), + ], + default="image_slider", + max_length=20, + ), + ), + ] diff --git a/foundation/okfplugins/gallery/models.py b/foundation/okfplugins/gallery/models.py index e99efab7..49b3205b 100644 --- a/foundation/okfplugins/gallery/models.py +++ b/foundation/okfplugins/gallery/models.py @@ -1,9 +1,16 @@ from django.db import models from ..background.models import AbstractBackgroundPlugin +GALLERY_TYPES = (("image_slider", "Image Slider"), ("logo_static", "Static Logo"), ("in_column", "In Column")) + class Gallery(AbstractBackgroundPlugin): title = models.CharField(max_length=200, blank=True) + gallery_type = models.CharField( + max_length=20, choices=GALLERY_TYPES, default="image_slider" + ) + 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/gallery/templates/gallery_plugin.html b/foundation/okfplugins/gallery/templates/gallery_plugin.html index 24682709..9227b7c5 100644 --- a/foundation/okfplugins/gallery/templates/gallery_plugin.html +++ b/foundation/okfplugins/gallery/templates/gallery_plugin.html @@ -1,13 +1,43 @@ {% load cms_tags %} - + + +{% 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 }} +

+
+
+ {{ instance.image_alt }} +
-
- {{ instance.image_alt }} +
+
+ + +{% elif instance.banner_type == 'opening_default' %} +
+
+
+
+
+ {{ instance.image_alt }} +
+
+
+

{{ instance.title | safe}}

+ {{ instance.text | safe }} + {{ instance.url_text }} +
-
-
- + + + +{% elif instance.banner_type == 'opening_center' %} +
+
+ {{ instance.image_alt }} +

{{ 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 %} +
+ {{ instance.alt }} +
+ {% if instance.url %} +
+ {% endif %} + {% else %} + + {% endif %} + + {% elif instance.in_carousel %}
@@ -18,7 +35,11 @@ {{ instance.text }}
+ + {% else %} + + {% if not instance.in_column %}
diff --git a/templates/cms_default.html b/templates/cms_default.html index d4f587cd..6d42a18d 100644 --- a/templates/cms_default.html +++ b/templates/cms_default.html @@ -9,33 +9,7 @@ {% block body-class %}page-template{% endblock %} {% block body %} - {% placeholder "page content" %} - -
-
-
- -
-

Don't miss
a thing

-

- Stay on top of what's happening in the
- #OpenMovement around the world.
- (We will never spam you!) -

-
- -
-
-
-
-
- - + {% placeholder "page content" %} {% endblock %} {% block breadcrumb %} diff --git a/templates/cms_homepage.html b/templates/cms_homepage.html index fc22111d..46dc650c 100644 --- a/templates/cms_homepage.html +++ b/templates/cms_homepage.html @@ -6,360 +6,82 @@ {% block body-class %}home-template{% endblock %} {% block body %} - -{% placeholder "Header Banner" %} - - - -
-
-
- {% placeholder "First Featured blocks" %} -
-
-
- - -{% placeholder "Homepage content" %} - -
-
-
- {% placeholder "Content Headlines" %} -
-
-
- -{% placeholder "Number stats block" %} - - -
-
-

Open Knowledge in
practice

- -
- {% placeholder "Practice Features 1" %} - - {% placeholder "Practice Features 2" %} - - {% placeholder "Practice Features 3" %} - + + {% placeholder "Header Banner" %} + + +
+
+
+ {% placeholder "First Featured blocks" %} +
-
-
- - - - -
-
- - -
- -
+ + {% placeholder "Homepage content" %} - The home of a set of legal tools and licenses to help you publish, provide and use open data: Open Database License (ODbL), Open Data Commons Attribution License, and Open Data Commons Public Domain Dedication and License (PDDL). - - Learn more - -
- +
+
+
+ {% placeholder "Content Headlines" %} +
- + {% placeholder "Number stats block" %} - - - -
-
-
-
-
- Home Hero -
-
-
-

Global
movement in
action

- Open Knowledge Foundation is part of a worldwide movement working together for a fair, free and open future. - Join us! + +
+
+

Open Knowledge in
practice

+
+ {% placeholder "Practice Features 1" %} + {% placeholder "Practice Features 2" %} + {% placeholder "Practice Features 3" %}
-
-
- -
- -
- - - + - - - - - {% placeholder featured_news %} - -
-
- -

Open Knowledge library

-

- Free resources to enable organizations, governments and initiatives to be #OpenByDesign. -

- Find out more -
-
- -
- -
+ +
+
+
+ {% placeholder "Third Featured Blocks" %} +
+
+
- -
-
-
- -
-

Don't miss
a thing

-

- Stay on top of what's happening in the
- #OpenMovement around the world.
- (We will never spam you!) -

-
- -
-
-
-
-
- + + {% placeholder "Newsletter" %} -
+ {% endblock %} {% block pre_footer %}{% endblock %} {% block javascript-asynchronous %} - {% endblock %}