diff --git a/app/contrib/frontend/landpage/migrations/0010_auto_20240117_2042.py b/app/contrib/frontend/landpage/migrations/0010_auto_20240117_2042.py new file mode 100644 index 00000000..473a7cf1 --- /dev/null +++ b/app/contrib/frontend/landpage/migrations/0010_auto_20240117_2042.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2 on 2024-01-17 20:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('landpage', '0009_auto_20231020_1853'), + ] + + operations = [ + migrations.AlterField( + model_name='footer', + name='font', + field=models.CharField(blank=True, choices=[('Abel', 'Abel'), ('Anton', 'Anton'), ('Archivo Narrow', 'Archivo Narrow'), ('Arvo', 'Arvo'), ('Asap', 'Asap'), ('Baloo Bhai', 'Baloo Bhai'), ('Bebas Neue Pro', 'Bebas Neue Pro'), ('Bitter', 'Bitter'), ('Bree Serif', 'Bree Serif'), ('Capriola', 'Capriola'), ('Cabin', 'Cabin'), ('Catamaran', 'Catamaran'), ('Crimson Text', 'Crimson Text'), ('Cuprum', 'Cuprum'), ('David Libre', 'David Libre'), ('Dosis', 'Dosis'), ('Droid Sans', 'Droid Sans'), ('Exo', 'Exo'), ('Exo 2', 'Exo 2'), ('Fira Sans', 'Fira Sans'), ('Fjalla One', 'Fjalla One'), ('Francois One', 'Francois One'), ('Gidugu', 'Gidugu'), ('Hind', 'Hind'), ('Inconsolata', 'Inconsolata'), ('Indie Flower', 'Indie Flower'), ('Josefin Sans', 'Josefin Sans'), ('Karla', 'Karla'), ('Lalezar', 'Lalezar'), ('Lato', 'Lato'), ('Libre Baskerville', 'Libre Baskerville'), ('Lobster', 'Lobster'), ('Lora', 'Lora'), ('Merriweather Sans', 'Merriweather Sans'), ('Montserrat', 'Montserrat'), ('Muli', 'Muli'), ('Noto Serif', 'Noto Serif'), ('Nunito Sans', 'Nunito Sans'), ('Open Sans', 'Open Sans'), ('Open Sans Condensed', 'Open Sans Condensed'), ('Oswald', 'Oswald'), ('Oxygen', 'Oxygen'), ('PT Sans', 'PT Sans'), ('PT Serif', 'PT Serif'), ('Pacifico', 'Pacifico'), ('Playfair Display', 'Playfair Display'), ('Poiret One', 'Poiret One'), ('Poppins', 'Poppins'), ('Quicksand', 'Quicksand'), ('Raleway', 'Raleway'), ('Roboto', 'Roboto'), ('Roboto Condensed', 'Roboto Condensed'), ('Roboto Mono', 'Roboto Mono'), ('Roboto Slab', 'Roboto Slab'), ('Ruslan Display', 'Ruslan Display'), ('Signika', 'Signika'), ('Slabo 27px', 'Slabo 27px'), ('Source Sans Pro', 'Source Sans Pro'), ('Titillium Web', 'Titillium Web'), ('Ubuntu', 'Ubuntu'), ('Ubuntu Condensed', 'Ubuntu Condensed'), ('Varela Round', 'Varela Round'), ('Yanone Kaffeesatz', 'Yanone Kaffeesatz')], max_length=100, null=True, verbose_name='Estilo de fonte'), + ), + migrations.AlterField( + model_name='navbar', + name='font', + field=models.CharField(blank=True, choices=[('Abel', 'Abel'), ('Anton', 'Anton'), ('Archivo Narrow', 'Archivo Narrow'), ('Arvo', 'Arvo'), ('Asap', 'Asap'), ('Baloo Bhai', 'Baloo Bhai'), ('Bebas Neue Pro', 'Bebas Neue Pro'), ('Bitter', 'Bitter'), ('Bree Serif', 'Bree Serif'), ('Capriola', 'Capriola'), ('Cabin', 'Cabin'), ('Catamaran', 'Catamaran'), ('Crimson Text', 'Crimson Text'), ('Cuprum', 'Cuprum'), ('David Libre', 'David Libre'), ('Dosis', 'Dosis'), ('Droid Sans', 'Droid Sans'), ('Exo', 'Exo'), ('Exo 2', 'Exo 2'), ('Fira Sans', 'Fira Sans'), ('Fjalla One', 'Fjalla One'), ('Francois One', 'Francois One'), ('Gidugu', 'Gidugu'), ('Hind', 'Hind'), ('Inconsolata', 'Inconsolata'), ('Indie Flower', 'Indie Flower'), ('Josefin Sans', 'Josefin Sans'), ('Karla', 'Karla'), ('Lalezar', 'Lalezar'), ('Lato', 'Lato'), ('Libre Baskerville', 'Libre Baskerville'), ('Lobster', 'Lobster'), ('Lora', 'Lora'), ('Merriweather Sans', 'Merriweather Sans'), ('Montserrat', 'Montserrat'), ('Muli', 'Muli'), ('Noto Serif', 'Noto Serif'), ('Nunito Sans', 'Nunito Sans'), ('Open Sans', 'Open Sans'), ('Open Sans Condensed', 'Open Sans Condensed'), ('Oswald', 'Oswald'), ('Oxygen', 'Oxygen'), ('PT Sans', 'PT Sans'), ('PT Serif', 'PT Serif'), ('Pacifico', 'Pacifico'), ('Playfair Display', 'Playfair Display'), ('Poiret One', 'Poiret One'), ('Poppins', 'Poppins'), ('Quicksand', 'Quicksand'), ('Raleway', 'Raleway'), ('Roboto', 'Roboto'), ('Roboto Condensed', 'Roboto Condensed'), ('Roboto Mono', 'Roboto Mono'), ('Roboto Slab', 'Roboto Slab'), ('Ruslan Display', 'Ruslan Display'), ('Signika', 'Signika'), ('Slabo 27px', 'Slabo 27px'), ('Source Sans Pro', 'Source Sans Pro'), ('Titillium Web', 'Titillium Web'), ('Ubuntu', 'Ubuntu'), ('Ubuntu Condensed', 'Ubuntu Condensed'), ('Varela Round', 'Varela Round'), ('Yanone Kaffeesatz', 'Yanone Kaffeesatz')], max_length=100, null=True, verbose_name='Estilo de fonte'), + ), + ] diff --git a/app/contrib/frontend/migrations/0005_alter_button_font.py b/app/contrib/frontend/migrations/0005_alter_button_font.py new file mode 100644 index 00000000..4e0f7149 --- /dev/null +++ b/app/contrib/frontend/migrations/0005_alter_button_font.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2 on 2024-01-17 20:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('frontend', '0004_auto_20231005_1254'), + ] + + operations = [ + migrations.AlterField( + model_name='button', + name='font', + field=models.CharField(blank=True, choices=[('Abel', 'Abel'), ('Anton', 'Anton'), ('Archivo Narrow', 'Archivo Narrow'), ('Arvo', 'Arvo'), ('Asap', 'Asap'), ('Baloo Bhai', 'Baloo Bhai'), ('Bebas Neue Pro', 'Bebas Neue Pro'), ('Bitter', 'Bitter'), ('Bree Serif', 'Bree Serif'), ('Capriola', 'Capriola'), ('Cabin', 'Cabin'), ('Catamaran', 'Catamaran'), ('Crimson Text', 'Crimson Text'), ('Cuprum', 'Cuprum'), ('David Libre', 'David Libre'), ('Dosis', 'Dosis'), ('Droid Sans', 'Droid Sans'), ('Exo', 'Exo'), ('Exo 2', 'Exo 2'), ('Fira Sans', 'Fira Sans'), ('Fjalla One', 'Fjalla One'), ('Francois One', 'Francois One'), ('Gidugu', 'Gidugu'), ('Hind', 'Hind'), ('Inconsolata', 'Inconsolata'), ('Indie Flower', 'Indie Flower'), ('Josefin Sans', 'Josefin Sans'), ('Karla', 'Karla'), ('Lalezar', 'Lalezar'), ('Lato', 'Lato'), ('Libre Baskerville', 'Libre Baskerville'), ('Lobster', 'Lobster'), ('Lora', 'Lora'), ('Merriweather Sans', 'Merriweather Sans'), ('Montserrat', 'Montserrat'), ('Muli', 'Muli'), ('Noto Serif', 'Noto Serif'), ('Nunito Sans', 'Nunito Sans'), ('Open Sans', 'Open Sans'), ('Open Sans Condensed', 'Open Sans Condensed'), ('Oswald', 'Oswald'), ('Oxygen', 'Oxygen'), ('PT Sans', 'PT Sans'), ('PT Serif', 'PT Serif'), ('Pacifico', 'Pacifico'), ('Playfair Display', 'Playfair Display'), ('Poiret One', 'Poiret One'), ('Poppins', 'Poppins'), ('Quicksand', 'Quicksand'), ('Raleway', 'Raleway'), ('Roboto', 'Roboto'), ('Roboto Condensed', 'Roboto Condensed'), ('Roboto Mono', 'Roboto Mono'), ('Roboto Slab', 'Roboto Slab'), ('Ruslan Display', 'Ruslan Display'), ('Signika', 'Signika'), ('Slabo 27px', 'Slabo 27px'), ('Source Sans Pro', 'Source Sans Pro'), ('Titillium Web', 'Titillium Web'), ('Ubuntu', 'Ubuntu'), ('Ubuntu Condensed', 'Ubuntu Condensed'), ('Varela Round', 'Varela Round'), ('Yanone Kaffeesatz', 'Yanone Kaffeesatz')], max_length=100, null=True, verbose_name='Estilo de fonte'), + ), + ] diff --git a/app/nossas/plugins/cms_plugins/__init__.py b/app/nossas/plugins/cms_plugins/__init__.py index 577e19a8..2d1599b5 100644 --- a/app/nossas/plugins/cms_plugins/__init__.py +++ b/app/nossas/plugins/cms_plugins/__init__.py @@ -3,6 +3,7 @@ from .button import * from .breadcrumb import * from .breakline import * +from .container import * from .footer import * from .grid import * from .navbar import * diff --git a/app/nossas/plugins/cms_plugins/button.py b/app/nossas/plugins/cms_plugins/button.py index 3fcd9bc6..90583673 100644 --- a/app/nossas/plugins/cms_plugins/button.py +++ b/app/nossas/plugins/cms_plugins/button.py @@ -1,16 +1,11 @@ from django.utils.translation import ugettext_lazy as _ -from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from djangocms_frontend.contrib.link.cms_plugins import LinkPlugin from nossas.plugins.forms.buttonform import LinkButtonForm -# from nossas.design.cms_plugins import UIPaddingMixin, UIBackgroundMixin, CMSUIPlugin -# from nossas.plugins.models.buttonmodel import Button -# from nossas.plugins.forms.buttonform import ButtonPluginForm - @plugin_pool.register_plugin class LinkButtonPlugin(LinkPlugin): diff --git a/app/nossas/plugins/cms_plugins/container.py b/app/nossas/plugins/cms_plugins/container.py new file mode 100644 index 00000000..cd475e58 --- /dev/null +++ b/app/nossas/plugins/cms_plugins/container.py @@ -0,0 +1,34 @@ +from cms.plugin_pool import plugin_pool + +from nossas.design.cms_plugins import UICMSPluginBase + +from nossas.plugins.models.containermodel import Container +from nossas.plugins.forms.containerform import ContainerPluginForm + +@plugin_pool.register_plugin +class ContainerPlugin(UICMSPluginBase): + name = "Container" + module = "NOSSAS" + model = Container + form = ContainerPluginForm + render_template = "nossas/plugins/container.html" + allow_children = True + fieldsets = ( + ("Atributos", {"fields": ["attributes"]}), + ("Fundo", {"fields": ["background"]}) + ) + + def get_form(self, request, obj, change, **kwargs): + if not change: + self.form = ContainerPluginForm + + return super().get_form(request, obj, change, **kwargs) + + def get_fieldsets(self, request, obj=None): + if not obj: + self.fieldsets = ( + (None, {"fields": ["attributes"]}), + ("Fundo", {"fields": ["background"]}), + ) + + return super().get_fieldsets(request, obj) diff --git a/app/nossas/plugins/forms/containerform.py b/app/nossas/plugins/forms/containerform.py new file mode 100644 index 00000000..a79b289b --- /dev/null +++ b/app/nossas/plugins/forms/containerform.py @@ -0,0 +1,16 @@ +from django import forms + +from nossas.design.forms import ( + UIBackgroundFormMixin +) + +from nossas.plugins.models.containermodel import Container + + +class ContainerPluginForm( + UIBackgroundFormMixin, forms.ModelForm +): + class Meta: + model = Container + entangled_fields = {"attributes": []} + diff --git a/app/nossas/plugins/migrations/0009_container.py b/app/nossas/plugins/migrations/0009_container.py new file mode 100644 index 00000000..653cd6c5 --- /dev/null +++ b/app/nossas/plugins/migrations/0009_container.py @@ -0,0 +1,27 @@ +# Generated by Django 3.2 on 2024-01-17 20:42 + +from django.db import migrations, models +import django.db.models.deletion +import nossas.design.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0022_auto_20180620_1551'), + ('plugins', '0008_accordion'), + ] + + operations = [ + migrations.CreateModel( + name='Container', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='plugins_container', serialize=False, to='cms.cmsplugin')), + ('attributes', models.JSONField(blank=True, null=True)), + ], + options={ + 'abstract': False, + }, + bases=(nossas.design.models.UIBackgroundMixin, 'cms.cmsplugin'), + ), + ] diff --git a/app/nossas/plugins/models/__init__.py b/app/nossas/plugins/models/__init__.py index 6015c405..5d09c882 100644 --- a/app/nossas/plugins/models/__init__.py +++ b/app/nossas/plugins/models/__init__.py @@ -1,4 +1,7 @@ +from .accordionmodel import * from .boxmodel import * from .buttonmodel import * +from .containermodel import * +from .gridmodel import * from .navbarmodel import * -from .slidermodel import * \ No newline at end of file +from .slidermodel import * diff --git a/app/nossas/plugins/models/boxmodel.py b/app/nossas/plugins/models/boxmodel.py index ce9882d3..05055adb 100644 --- a/app/nossas/plugins/models/boxmodel.py +++ b/app/nossas/plugins/models/boxmodel.py @@ -1,14 +1,12 @@ from nossas.design.models import ( UICMSPlugin, UIBackgroundMixin, - UIPaddingMixin, UIBorderMixin, ) class Box( UIBackgroundMixin, - UIPaddingMixin, UIBorderMixin, UICMSPlugin, ): diff --git a/app/nossas/plugins/models/containermodel.py b/app/nossas/plugins/models/containermodel.py new file mode 100644 index 00000000..fbc08d06 --- /dev/null +++ b/app/nossas/plugins/models/containermodel.py @@ -0,0 +1,5 @@ +from nossas.design.models import UICMSPlugin, UIBackgroundMixin + + +class Container(UIBackgroundMixin, UICMSPlugin): + pass diff --git a/app/nossas/plugins/templates/nossas/plugins/box.html b/app/nossas/plugins/templates/nossas/plugins/box.html index ee9493e9..d2319e9e 100644 --- a/app/nossas/plugins/templates/nossas/plugins/box.html +++ b/app/nossas/plugins/templates/nossas/plugins/box.html @@ -6,15 +6,3 @@ {% endfor %} - -{% comment %} {% load cms_tags frontend %}{% spaceless %} - {% if instance.parent.plugin_type == "CardLayoutPlugin" and instance.parent.get_plugin_instance.0.card_type == "row" %}
{% endif %} - <{{ instance.tag_type }}{{ instance.get_attributes }}> - {% with parent=instance %} - {% for plugin in instance.child_plugin_instances %} - {% with forloop as parentloop %}{% render_plugin plugin %}{% endwith %} - {% endfor %} - {% endwith %} - - {% if instance.parent.plugin_type == "CardLayoutPlugin" and instance.parent.get_plugin_instance.0.card_type == "row" %}
{% endif %} -{% endspaceless %} {% endcomment %} \ No newline at end of file diff --git a/app/nossas/plugins/templates/nossas/plugins/container.html b/app/nossas/plugins/templates/nossas/plugins/container.html new file mode 100644 index 00000000..7809936a --- /dev/null +++ b/app/nossas/plugins/templates/nossas/plugins/container.html @@ -0,0 +1,9 @@ +{% load cms_tags %} + +
+
+ {% for plugin in instance.child_plugin_instances %} + {% render_plugin plugin %} + {% endfor %} +
+
diff --git a/app/nossas/settings.py b/app/nossas/settings.py index 0ac9b23a..4beb46bc 100644 --- a/app/nossas/settings.py +++ b/app/nossas/settings.py @@ -83,6 +83,7 @@ "plugins": [ "TextPlugin", "BoxPlugin", + "ContainerPlugin", "SliderPlugin", "TeamAccordionPlugin", "FilterCampaignListPlugin",