diff --git a/home/migrations/0042_alter_homepage_background_section_and_more.py b/home/migrations/0042_alter_homepage_background_section_and_more.py new file mode 100644 index 0000000..3b63771 --- /dev/null +++ b/home/migrations/0042_alter_homepage_background_section_and_more.py @@ -0,0 +1,64 @@ +# Generated by Django 5.0.9 on 2024-10-02 01:43 + +import wagtail_color_panel.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0041_homepage_externalraws'), + ] + + operations = [ + migrations.AlterField( + model_name='homepage', + name='background_section', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#FFFFFF', max_length=250), + ), + migrations.AlterField( + model_name='homepage', + name='color_gradient_1', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#FF4D79', max_length=250), + ), + migrations.AlterField( + model_name='homepage', + name='color_gradient_2', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#FF809F', max_length=250), + ), + migrations.AlterField( + model_name='homepage', + name='color_primary', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#ff4a67', max_length=250), + ), + migrations.AlterField( + model_name='homepage', + name='color_text_hero', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#FFFFFF', max_length=250), + ), + migrations.AlterField( + model_name='homepage', + name='color_text_section', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#FFFFFF', max_length=250), + ), + migrations.AlterField( + model_name='homepage', + name='navbar_background', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#000000', max_length=250), + ), + migrations.AlterField( + model_name='homepage', + name='navbar_links_color', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#FFFFFF', max_length=250), + ), + migrations.AlterField( + model_name='segmentpage', + name='background_section', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#FFFFFF', max_length=250), + ), + migrations.AlterField( + model_name='segmentpage', + name='color_text_section', + field=wagtail_color_panel.fields.ColorField(blank=True, default='#000000', max_length=250), + ), + ] diff --git a/home/migrations/0042_homepage_fonts.py b/home/migrations/0042_homepage_fonts.py new file mode 100644 index 0000000..5b0f566 --- /dev/null +++ b/home/migrations/0042_homepage_fonts.py @@ -0,0 +1,19 @@ +# Generated by Django 5.0.9 on 2024-09-08 22:45 + +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0041_homepage_externalraws'), + ] + + operations = [ + migrations.AddField( + model_name='homepage', + name='fonts', + field=wagtail.fields.StreamField([('fonts', 3)], blank=True, block_lookup={0: ('wagtail.blocks.CharBlock', (), {'max_length': 250, 'required': True}), 1: ('wagtail.blocks.URLBlock', (), {'required': True}), 2: ('wagtail.blocks.CharBlock', (), {'default': '#000000', 'max_length': 250, 'required': True}), 3: ('wagtail.blocks.StructBlock', [[('name', 0), ('section', 0), ('url', 1), ('font_size', 0), ('font_wight', 0), ('font_family', 0), ('font_color', 2)]], {})}), + ), + ] diff --git a/home/migrations/0043_remove_homepage_fonts_homepage_primaryfontfamily_and_more.py b/home/migrations/0043_remove_homepage_fonts_homepage_primaryfontfamily_and_more.py new file mode 100644 index 0000000..b4fd894 --- /dev/null +++ b/home/migrations/0043_remove_homepage_fonts_homepage_primaryfontfamily_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 5.0.9 on 2024-09-11 02:04 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0042_homepage_fonts'), + ] + + operations = [ + migrations.RemoveField( + model_name='homepage', + name='fonts', + ), + migrations.AddField( + model_name='homepage', + name='primaryFontFamily', + field=models.CharField(default='sans-serif', max_length=250), + ), + migrations.AddField( + model_name='homepage', + name='primaryFontURL', + field=models.URLField(blank=True, max_length=250), + ), + migrations.AddField( + model_name='homepage', + name='secondaryFontFamily', + field=models.CharField(default='sans-serif', max_length=250), + ), + migrations.AddField( + model_name='homepage', + name='secondaryFontURL', + field=models.URLField(blank=True, max_length=250), + ), + ] diff --git a/home/models.py b/home/models.py index 18ce9c4..c751e97 100644 --- a/home/models.py +++ b/home/models.py @@ -1,9 +1,11 @@ from django.db import models -from wagtail.fields import RichTextField, StreamField -from wagtail.models import Page -from wagtail.admin.panels import FieldPanel from wagtail import blocks +from wagtail.admin.panels import FieldPanel +from wagtail.fields import RichTextField, StreamField from wagtail.images.blocks import ImageChooserBlock +from wagtail.models import Page +from wagtail_color_panel.edit_handlers import NativeColorPanel +from wagtail_color_panel.fields import ColorField class HomePage(Page): @@ -47,7 +49,9 @@ class HomePage(Page): on_delete=models.SET_NULL, related_name="+", ) - hero_image_overlay_opacity = models.DecimalField(default=0.70, decimal_places=2, max_digits=3) + hero_image_overlay_opacity = models.DecimalField( + default=0.70, decimal_places=2, max_digits=3 + ) hero_padding_left = models.CharField(max_length=250, default="20px") hero_padding_right = models.CharField(max_length=250, default="20px") footer_title = models.CharField(max_length=250, blank=True) @@ -77,41 +81,54 @@ class HomePage(Page): blank=True, use_json_field=True, ) - color_gradient_1 = models.CharField(max_length=250, blank=True, default="#FF4D79") - color_gradient_2 = models.CharField(max_length=250, blank=True, default="#FF809F") - color_primary = models.CharField(max_length=250, blank=True, default="#ff4a67") - color_text_hero = models.CharField(max_length=250, blank=True, default="#FFFFFF") + + primaryFontURL = models.URLField(max_length=250, blank=True) + primaryFontFamily = models.CharField(max_length=250, default="sans-serif") + secondaryFontURL = models.URLField(max_length=250, blank=True) + secondaryFontFamily = models.CharField(max_length=250, default="sans-serif") + color_gradient_1 = ColorField(max_length=250, blank=True, default="#FF4D79") + color_gradient_2 = ColorField(max_length=250, blank=True, default="#FF809F") + color_primary = ColorField(max_length=250, blank=True, default="#ff4a67") + color_text_hero = ColorField(max_length=250, blank=True, default="#FFFFFF") + show_time = models.BooleanField(default=True) - background_section = models.CharField(max_length=250, blank=True, default="#FFFFFF") - color_text_section = models.CharField(max_length=250, blank=True, default="white") - navbar_background = models.CharField(max_length=250, default="transparent") - navbar_links_color = models.CharField(max_length=250,default="white") - message_show_time = models.CharField(max_length=250, blank=True, default="Próximamente...") + background_section = ColorField(max_length=250, blank=True, default="#FFFFFF") + color_text_section = ColorField(max_length=250, blank=True, default="#FFFFFF") + navbar_background = ColorField(max_length=250, blank=True, default="#000000") + navbar_links_color = ColorField(max_length=250, blank=True, default="#FFFFFF") + message_show_time = models.CharField( + max_length=250, blank=True, default="Próximamente..." + ) menu_links = StreamField( - [ - ( - "menu_links", - blocks.StructBlock( - [ - ("text", blocks.CharBlock(max_length=250, required=True)), - ("url",blocks.CharBlock(max_length=250, required=True, default="#")), - ] - ), + [ + ( + "menu_links", + blocks.StructBlock( + [ + ("text", blocks.CharBlock(max_length=250, required=True)), + ( + "url", + blocks.CharBlock( + max_length=250, required=True, default="#" + ), + ), + ] ), - ], - blank=True, - use_json_field=True, - ) + ), + ], + blank=True, + use_json_field=True, + ) favicon = models.ForeignKey( "wagtailimages.Image", null=True, blank=True, on_delete=models.SET_NULL, related_name="+", - help_text="max size 256x256 png format" + help_text="max size 256x256 png format", ) footer_background = models.CharField(max_length=250, blank=True, default="#161E26") - footer_color_text = models.CharField(max_length=250, blank=True, default="#9e9e9e") + footer_color_text = models.CharField(max_length=250, blank=True, default="#9e9e9e") externalRaws = StreamField( [ ( @@ -129,8 +146,8 @@ class HomePage(Page): content_panels = Page.content_panels + [ FieldPanel("event"), FieldPanel("favicon"), - FieldPanel("navbar_background"), - FieldPanel("navbar_links_color"), + NativeColorPanel("navbar_background"), + NativeColorPanel("navbar_links_color"), FieldPanel("position_event"), FieldPanel("about"), FieldPanel("location"), @@ -142,30 +159,40 @@ class HomePage(Page): FieldPanel("logo_image_big"), FieldPanel("hero_image"), FieldPanel("hero_image_overlay_opacity"), - FieldPanel("color_text_hero"), + NativeColorPanel("color_text_hero"), FieldPanel("hero_padding_left"), FieldPanel("hero_padding_right"), - FieldPanel("color_gradient_1"), - FieldPanel("color_gradient_2"), - FieldPanel("color_primary"), + FieldPanel("primaryFontURL"), + FieldPanel("primaryFontFamily"), + FieldPanel("secondaryFontURL"), + FieldPanel("secondaryFontFamily"), + NativeColorPanel("color_gradient_1"), + NativeColorPanel("color_gradient_2"), + NativeColorPanel("color_primary"), FieldPanel("show_time"), - FieldPanel("background_section"), - FieldPanel("color_text_section"), + NativeColorPanel("background_section"), + NativeColorPanel("color_text_section"), FieldPanel("message_show_time"), FieldPanel("menu_links"), FieldPanel("footer_title"), FieldPanel("footer_site_info"), FieldPanel("footer_networks"), - FieldPanel("footer_background"), - FieldPanel("footer_color_text"), + NativeColorPanel("color_gradient_1"), + NativeColorPanel("footer_background"), + NativeColorPanel("footer_color_text"), FieldPanel("externalRaws"), ] - + def get_context(self, request): # Update context to include only published posts, ordered by reverse-chron context = super().get_context(request) segments = SegmentPage.objects.child_of(self).live().order_by("order") context["segments"] = segments # sorted (segments, key=lambda x: x.order) + context["exist_descendants"] = [ + descendant + for descendant in self.get_descendants() + if descendant.live and descendant.content_type == self.content_type + ] return context @@ -188,6 +215,7 @@ class SponsorBlock(blocks.StructBlock): ) url = blocks.URLBlock(required=False) + class TiersBlock(blocks.StructBlock): classname = blocks.CharBlock(required=False) name = blocks.CharBlock() @@ -200,6 +228,7 @@ class TiersBlock(blocks.StructBlock): url_text = blocks.CharBlock(required=False, default="Buy now") bg_color = blocks.CharBlock(required=False, default="#fff") + class ScheduleDetailBlock(blocks.StructBlock): menu_title = blocks.CharBlock() menu_subtitle = blocks.CharBlock(default="Workshop") @@ -210,15 +239,17 @@ class ScheduleDetailBlock(blocks.StructBlock): location = blocks.CharBlock(required=False) image = ImageChooserBlock(required=False) + class ScheduleBlock(blocks.StructBlock): name = blocks.CharBlock() detail = blocks.CharBlock() schedule_details = blocks.ListBlock(ScheduleDetailBlock(required=False)) + class SegmentPage(Page): order = models.IntegerField(default=0) - background_section = models.CharField(max_length=250, blank=True, default="#FFFFFF") - color_text_section = models.CharField(max_length=250, blank=True, default="black") + background_section = ColorField(max_length=250, blank=True, default="#FFFFFF") + color_text_section = ColorField(max_length=250, blank=True, default="#000000") segments = StreamField( [ # detail segment @@ -253,7 +284,8 @@ class SegmentPage(Page): ), ), ( - "list_style",blocks.BooleanBlock(required=False, default=False), + "list_style", + blocks.BooleanBlock(required=False, default=False), ), ] ), @@ -363,7 +395,12 @@ class SegmentPage(Page): content_panels = Page.content_panels + [ FieldPanel("order"), - FieldPanel("background_section"), - FieldPanel("color_text_section"), + NativeColorPanel("color_text_section"), FieldPanel("segments"), + NativeColorPanel("background_section"), ] + + def get_context(self, request): + context = super().get_context(request) + context["parent"] = self.get_parent().specific + return context diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html index f4e938d..9f98141 100644 --- a/home/templates/home/home_page.html +++ b/home/templates/home/home_page.html @@ -8,6 +8,29 @@ {% block extra_css %} {% image page.hero_image fill-1900x740-c20 format-webp preserve-svg as tmp_hero %} {% image page.favicon max-256x256 as tmp_favicon %} +{% block meta_tags %} + + + + +{% if page.logo_image %} + {% image page.logo_image original as tmp_og_image %} + +{% endif %} + + + + + + + + + +{% if page.logo_image %} + {% image page.logo_image original as tmp_twitter_image %} + +{% endif %} +{% endblock %} @@ -34,6 +59,15 @@ + +{%if page.value.primaryFontURL != "" %} + +{%endif%} + +{%if page.value.secondaryFontURL != "" %} + +{%endif%} + + + + + + + + + + + + + + + +{% endblock extra_css %} + +{% block content %} +
+ + + +
+
+
+
+
+
+ {% if parent.logo_image_big is not None %} + {% image parent.logo_image_big max-300x150 format-webp preserve-svg as tmp_logo_big %} + {{ tmp_logo_big.alt }} +
+
+ + {% endif %} + + +
{{ parent.event|richtext }}
+ +
+ {% if parent.url_get_tickets is not None and parent.url_get_tickets != "" %} + + {% endif %} +
+
+
+
+
+ + + +
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+{% for segment in page.segments %} +{% if segment.block_type == 'detail_segment' %} +
+ {% include 'segments/segment.html' %} +
+{% endif %} +{% if segment.block_type == 'video_segment' %} +
+ {% include 'segments/video.html' %} +
+{% endif %} +{% if segment.block_type == 'information_segment' %} +
+ {% include 'segments/information_bar.html' %} +
+{% endif %} +{% if segment.block_type == 'sponsor_segment' %} +
+ {% include 'segments/sponsor.html' %} +
+{% endif %} +{% if segment.block_type == 'maps_segment' %} +
+ {% include 'segments/maps.html' %} +
+{% endif %} +{% if segment.block_type == 'pricing_segment' %} +
+ {% include 'segments/pricing.html' %} +
+{% endif %} +{% if segment.block_type == 'schedule_segment' %} +
+ {% include 'segments/schedule.html' %} +
+{% endif %} +{% endfor %} +{% endblock %} +{% block extra_js %} + + + + + + + + + + + + + +{% endblock %} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 22f11c0..8124482 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ Django>=4.2,<5.1 wagtail>=6.2,<6.3 django-mathfilters==1.0.0 whitenoise==6.2.0 -mysqlclient==2.2.1 \ No newline at end of file +mysqlclient==2.2.1 +wagtail-color-panel==1.5.0 \ No newline at end of file diff --git a/website/settings/base.py b/website/settings/base.py index e98ca72..7c52a08 100644 --- a/website/settings/base.py +++ b/website/settings/base.py @@ -52,7 +52,8 @@ "django.contrib.messages", "django.contrib.staticfiles", "mathfilters", - 'wagtail.contrib.search_promotions' + 'wagtail.contrib.search_promotions', + 'wagtail_color_panel' ] MIDDLEWARE = [ diff --git a/website/static/2023/css/main.css b/website/static/2023/css/main.css index f15b1d3..40920f1 100644 --- a/website/static/2023/css/main.css +++ b/website/static/2023/css/main.css @@ -7,7 +7,7 @@ html { body { font-size: 15px; font-weight: 400; - font-family: 'Open Sans', sans-serif; + font-family: var(--secondary-font), sans-serif; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; @@ -26,7 +26,7 @@ h4, h5 { font-size: 36px; font-weight: 700; - font-family: 'Roboto', sans-serif; + font-family: var(--primary-font), sans-serif; } a { @@ -46,7 +46,7 @@ a a:focus { p { font-weight: 400; - font-family: 'Open Sans', sans-serif; + font-family: var(--secondary-font), sans-serif; margin: 0px; font-size: 14px; } @@ -198,7 +198,7 @@ ol li { padding: 10px 30px; line-height: 22px; border-radius: 0px; - font-family: 'Roboto', sans-serif; + font-family: var(--primary-font), sans-serif; cursor: pointer; font-weight: 500; color: #fff; @@ -324,15 +324,6 @@ a.back-to-top:focus { text-decoration: none; } -#preloader { - position: fixed; - background: var(--cg1); - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 9999999999; -} .sk-circle { margin: 0px auto; @@ -621,7 +612,7 @@ a.back-to-top:focus { padding: 0 15px; margin-top: 10px; margin-bottom: 10px; - font-family: 'Roboto', sans-serif; + font-family: var(--primary-font), sans-serif; font-weight: 500; line-height: 40px; text-transform: uppercase; @@ -2195,7 +2186,7 @@ footer { line-height: 45px; font-weight: 700; letter-spacing: 0.3; - font-family: 'Roboto', sans-serif; + font-family: var(--primary-font), sans-serif; display: block; margin-bottom: 10px; padding: 1px; @@ -2211,7 +2202,7 @@ footer { border: none; position: relative; height: auto; - font-family: 'Roboto', sans-serif; + font-family: var(--primary-font), sans-serif; border-radius: 4px; text-align: center; font-weight: 400; @@ -2225,7 +2216,7 @@ footer { line-height: 45px; font-weight: 700; letter-spacing: 0.3; - font-family: 'Roboto', sans-serif; + font-family: var(--primary-font), sans-serif; display: block; margin-bottom: 10px; } @@ -2544,4 +2535,10 @@ footer { margin-left: auto; padding: revert; list-style: decimal !important; -} \ No newline at end of file +} + +.past-events { + display: flex; + flex-direction: column; + align-items: flex-start; /* Alineación a la izquierda */ +} diff --git a/website/static/2023/js/main.js b/website/static/2023/js/main.js index d961e45..bd011ab 100644 --- a/website/static/2023/js/main.js +++ b/website/static/2023/js/main.js @@ -6,8 +6,6 @@ /*Page Loader active ========================================================*/ - $('#preloader').fadeOut(); - // Sticky Nav $(window).on('scroll', function () { if ($(window).scrollTop() > 200) { @@ -97,6 +95,5 @@ }); }); - $('#preloader').fadeOut(); }(jQuery)); \ No newline at end of file