From 6dca628f3a3461f105fbb16e713c1efe9cbfc2ff Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Fri, 29 Mar 2024 16:01:51 +0200 Subject: [PATCH 01/11] Extract StructValue class for LinkBlock --- ietf/templates/includes/megamenu.html | 2 +- ietf/utils/blocks.py | 27 +++++++++++++++++++++++++++ ietf/utils/context_processors.py | 26 ++------------------------ 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/ietf/templates/includes/megamenu.html b/ietf/templates/includes/megamenu.html index e4203207..2a952df3 100644 --- a/ietf/templates/includes/megamenu.html +++ b/ietf/templates/includes/megamenu.html @@ -68,7 +68,7 @@
{{ section.title }}
{% for link in section.links %}
  • - {{ link.title }} + {{ link.text }}
  • {% endfor %} diff --git a/ietf/utils/blocks.py b/ietf/utils/blocks.py index ce8bae73..e17bb592 100644 --- a/ietf/utils/blocks.py +++ b/ietf/utils/blocks.py @@ -1,3 +1,4 @@ +from django.utils.functional import cached_property from wagtail.blocks import ( CharBlock, FloatBlock, @@ -7,6 +8,7 @@ RichTextBlock, StreamBlock, StructBlock, + StructValue, URLBlock, ) from wagtail.contrib.table_block.blocks import TableBlock @@ -28,11 +30,36 @@ class Meta: template = "blocks/note_well_block.html" +class LinkStructValue(StructValue): + @cached_property + def url(self): + if external_url := self.get("external_url"): + return external_url + + if page := self.get("page"): + return page.url + + return "" + + @cached_property + def text(self): + if title := self.get("title"): + return title + + if page := self.get("page"): + return page.title + + return self.get("external_url") + + class LinkBlock(StructBlock): page = PageChooserBlock(label="Page", required=False) title = CharBlock(label="Link text", required=False) external_url = URLBlock(label="External URL", required=False) + class Meta: # type: ignore + value_class = LinkStructValue + class MainMenuSection(StructBlock): title = CharBlock(label="Section title", required=True) diff --git a/ietf/utils/context_processors.py b/ietf/utils/context_processors.py index 8d24da25..ed5f1e90 100644 --- a/ietf/utils/context_processors.py +++ b/ietf/utils/context_processors.py @@ -16,32 +16,10 @@ def get_introduction(self, page): return "" - def get_link_url(self, link): - if external_url := link.get("external_url"): - return external_url - - if page := link.get("page"): - return page.get_url(current_site=self.site) - - return "" - - def get_link_title(self, link): - if title := link.get("title"): - return title - - if page := link.get("page"): - return page.title - - return link.get("external_url") - def get_section_links(self, section): for link in section.value.get("links"): - item = { - "title": self.get_link_title(link), - "url": self.get_link_url(link), - } - if item["title"] and item["url"]: - yield item + if link.text and link.url: + yield link def get_menu_item(self, item): main_section_links = [ From c4b62c7cc965fda308b832516ed7dfe7e81ecdf8 Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Fri, 29 Mar 2024 17:42:48 +0200 Subject: [PATCH 02/11] Add footer columns --- ietf/context_processors.py | 3 +- ietf/static_src/css/utilities.scss | 4 ++ ietf/templates/includes/footer.html | 45 +++++++++++++++++++--- ietf/utils/context_processors.py | 22 +++++------ ietf/utils/migrations/0010_footercolumn.py | 29 ++++++++++++++ ietf/utils/models.py | 20 +++++++++- ietf/utils/wagtail_hooks.py | 18 +++++++-- 7 files changed, 119 insertions(+), 22 deletions(-) create mode 100644 ietf/utils/migrations/0010_footercolumn.py diff --git a/ietf/context_processors.py b/ietf/context_processors.py index 18cbdf9d..3486bf25 100644 --- a/ietf/context_processors.py +++ b/ietf/context_processors.py @@ -4,7 +4,7 @@ from ietf.home.models import HomePage, IABHomePage from ietf.utils.models import SecondaryMenuItem, SocialMediaSettings -from ietf.utils.context_processors import get_main_menu +from ietf.utils.context_processors import get_footer, get_main_menu def home_page(site): @@ -46,4 +46,5 @@ def global_pages(request): "MENU": lambda: get_main_menu(site), "SECONDARY_MENU": lambda: secondary_menu(site), "SOCIAL_MENU": lambda: social_menu(site), + "FOOTER": lambda: get_footer(), } diff --git a/ietf/static_src/css/utilities.scss b/ietf/static_src/css/utilities.scss index f10be72e..dccbb5c4 100644 --- a/ietf/static_src/css/utilities.scss +++ b/ietf/static_src/css/utilities.scss @@ -21,3 +21,7 @@ .fw-semibold { font-weight: 600 !important; } + +.u-first-no-border:first-child { + border: none !important; +} diff --git a/ietf/templates/includes/footer.html b/ietf/templates/includes/footer.html index afd08de3..e1114a3a 100644 --- a/ietf/templates/includes/footer.html +++ b/ietf/templates/includes/footer.html @@ -1,9 +1,44 @@
    -
    - +
    + +
    +
    +
    + social +
    + +
    diff --git a/ietf/utils/context_processors.py b/ietf/utils/context_processors.py index ed5f1e90..3a8e0328 100644 --- a/ietf/utils/context_processors.py +++ b/ietf/utils/context_processors.py @@ -1,6 +1,6 @@ from operator import attrgetter -from ietf.utils.models import MainMenuItem +from ietf.utils.models import FooterColumn, MainMenuItem class MainMenu: @@ -16,11 +16,6 @@ def get_introduction(self, page): return "" - def get_section_links(self, section): - for link in section.value.get("links"): - if link.text and link.url: - yield link - def get_menu_item(self, item): main_section_links = [ { @@ -32,7 +27,11 @@ def get_menu_item(self, item): secondary_sections = [ { "title": section.value.get("title"), - "links": list(self.get_section_links(section)), + "links": [ + link + for link in section.value.get("links") + if link.text and link.url + ], } for section in item.secondary_sections ] @@ -48,10 +47,7 @@ def get_menu_item(self, item): } def get_menu(self): - return [ - self.get_menu_item(item) - for item in self.get_items() - ] + return [self.get_menu_item(item) for item in self.get_items()] class PreviewMainMenu(MainMenu): @@ -85,3 +81,7 @@ def get_main_menu(site): return get_iab_main_menu(site) return MainMenu(site).get_menu() + + +def get_footer(): + return FooterColumn.objects.all() diff --git a/ietf/utils/migrations/0010_footercolumn.py b/ietf/utils/migrations/0010_footercolumn.py new file mode 100644 index 00000000..35d73676 --- /dev/null +++ b/ietf/utils/migrations/0010_footercolumn.py @@ -0,0 +1,29 @@ +# Generated by Django 4.2.7 on 2024-03-29 14:06 + +from django.db import migrations, models +import wagtail.blocks +import wagtail.fields +import wagtail.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('utils', '0009_megamenu'), + ] + + operations = [ + migrations.CreateModel( + name='FooterColumn', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=255)), + ('links', wagtail.fields.StreamField([('link', wagtail.blocks.StructBlock([('page', wagtail.blocks.PageChooserBlock(label='Page', required=False)), ('title', wagtail.blocks.CharBlock(label='Link text', required=False)), ('external_url', wagtail.blocks.URLBlock(label='External URL', required=False))]))], blank=True, use_json_field=True)), + ('sort_order', models.PositiveSmallIntegerField()), + ], + options={ + 'ordering': ['sort_order'], + }, + bases=(wagtail.models.PreviewableMixin, models.Model), + ), + ] diff --git a/ietf/utils/models.py b/ietf/utils/models.py index 1c5be375..5702d8c3 100644 --- a/ietf/utils/models.py +++ b/ietf/utils/models.py @@ -9,7 +9,7 @@ from wagtail.models import Orderable, PreviewableMixin, Site from wagtailorderable.models import Orderable as WagtailOrderable -from ietf.utils.blocks import MainMenuSection +from ietf.utils.blocks import LinkBlock, MainMenuSection class LinkFields(models.Model): @@ -197,6 +197,24 @@ class Meta: verbose_name_plural = "Secondary Menu" +class FooterColumn(PreviewableMixin, models.Model): + title = models.CharField(max_length=255) + links = StreamField( + [ + ("link", LinkBlock()), + ], + blank=True, + use_json_field=True, + ) + sort_order = models.PositiveSmallIntegerField() + + class Meta: + ordering = ["sort_order"] + + def __str__(self): # pragma: no cover + return self.title + + @register_setting class SocialMediaSettings(BaseSiteSetting): twitter_handle = models.CharField( diff --git a/ietf/utils/wagtail_hooks.py b/ietf/utils/wagtail_hooks.py index 046d5072..d75dca5c 100644 --- a/ietf/utils/wagtail_hooks.py +++ b/ietf/utils/wagtail_hooks.py @@ -6,10 +6,10 @@ from wagtail_modeladmin.options import ModelAdmin, modeladmin_register from wagtailorderable.modeladmin.mixins import OrderableMixin -from ietf.utils.models import MainMenuItem, SecondaryMenuItem +from .models import FooterColumn, MainMenuItem, SecondaryMenuItem -@hooks.register("insert_global_admin_css") +@hooks.register("insert_global_admin_css") # type: ignore def editor_css(): return format_html( ' Date: Mon, 1 Apr 2024 13:50:32 +0300 Subject: [PATCH 03/11] Move social icons to footer --- ietf/static_src/css/utilities.scss | 4 ---- ietf/templates/includes/footer.html | 15 +++++++++++---- ietf/templates/includes/header.html | 7 ------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/ietf/static_src/css/utilities.scss b/ietf/static_src/css/utilities.scss index dccbb5c4..f10be72e 100644 --- a/ietf/static_src/css/utilities.scss +++ b/ietf/static_src/css/utilities.scss @@ -21,7 +21,3 @@ .fw-semibold { font-weight: 600 !important; } - -.u-first-no-border:first-child { - border: none !important; -} diff --git a/ietf/templates/includes/footer.html b/ietf/templates/includes/footer.html index e1114a3a..9283379a 100644 --- a/ietf/templates/includes/footer.html +++ b/ietf/templates/includes/footer.html @@ -23,13 +23,20 @@

    {{ column.title }}

    -
    -
    - social +
    +
    + {% for item in SOCIAL_MENU %} + + + + {% endfor %}
    -
    Date: Mon, 1 Apr 2024 14:04:44 +0300 Subject: [PATCH 04/11] Preview in Wagtail snippet editor --- ietf/utils/context_processors.py | 10 ++++++++++ ietf/utils/models.py | 11 +++++++++++ ietf/utils/templates/previews/footer_column.html | 1 + 3 files changed, 22 insertions(+) create mode 100644 ietf/utils/templates/previews/footer_column.html diff --git a/ietf/utils/context_processors.py b/ietf/utils/context_processors.py index 3a8e0328..1e285076 100644 --- a/ietf/utils/context_processors.py +++ b/ietf/utils/context_processors.py @@ -85,3 +85,13 @@ def get_main_menu(site): def get_footer(): return FooterColumn.objects.all() + + +def get_preview_footer(current): + items = [ + current if item == current else item + for item in FooterColumn.objects.all() + ] + if not current.pk: + items.append(current) + return sorted(items, key=attrgetter("sort_order")) diff --git a/ietf/utils/models.py b/ietf/utils/models.py index 5702d8c3..b2785062 100644 --- a/ietf/utils/models.py +++ b/ietf/utils/models.py @@ -214,6 +214,17 @@ class Meta: def __str__(self): # pragma: no cover return self.title + def get_preview_template(self, request, mode_name): + return "previews/footer_column.html" + + def get_preview_context(self, request, mode_name): + from .context_processors import get_preview_footer + + return { + **super().get_preview_context(request, mode_name), + "FOOTER": get_preview_footer(current=self), + } + @register_setting class SocialMediaSettings(BaseSiteSetting): diff --git a/ietf/utils/templates/previews/footer_column.html b/ietf/utils/templates/previews/footer_column.html new file mode 100644 index 00000000..b4473501 --- /dev/null +++ b/ietf/utils/templates/previews/footer_column.html @@ -0,0 +1 @@ +{% extends settings.utils.LayoutSettings.base_template %} From 5be20a36c7e120c795d7a9c656c4cf6ede5c5bf7 Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Mon, 1 Apr 2024 14:32:06 +0300 Subject: [PATCH 05/11] Tests for the footer --- ietf/utils/tests/test_footer.py | 94 +++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 ietf/utils/tests/test_footer.py diff --git a/ietf/utils/tests/test_footer.py b/ietf/utils/tests/test_footer.py new file mode 100644 index 00000000..d53f3a0e --- /dev/null +++ b/ietf/utils/tests/test_footer.py @@ -0,0 +1,94 @@ +from bs4 import BeautifulSoup +import pytest +from django.test import Client, RequestFactory + +from ietf.home.models import HomePage +from ietf.standard.factories import StandardIndexPageFactory, StandardPageFactory +from ietf.standard.models import StandardIndexPage, StandardPage +from ietf.utils.models import FooterColumn + +pytestmark = pytest.mark.django_db + + +class TestFooterColumns: + @pytest.fixture(autouse=True) + def set_up(self, home: HomePage, client: Client): + self.home = home + self.client = client + + self.standard_index: StandardIndexPage = StandardIndexPageFactory( + parent=self.home, + ) # type: ignore + + self.standard_page: StandardPage = StandardPageFactory( + parent=self.standard_index, + show_in_menus=True, + ) # type: ignore + + def test_links(self): + FooterColumn.objects.create( + title="Column Title", + links=[ + { + "type": "link", + "value": { + "page": self.standard_index.pk, + }, + }, + { + "type": "link", + "value": { + "page": self.standard_page.pk, + "title": "My Page Title", + }, + }, + { + "type": "link", + "value": { + "external_url": "http://example.com", + }, + }, + { + "type": "link", + "value": { + "external_url": "http://example.com", + "title": "My External Link Title", + }, + }, + ], + sort_order=1, + ) + + response = self.client.get("/") + assert response.status_code == 200 + html = response.content.decode() + soup = BeautifulSoup(html, "html.parser") + [section] = soup.select("footer section") + + [h4] = section.select("h4") + assert h4.get_text() == "Column Title" + + [link1, link2, link3, link4] = section.select("ul li a") + assert link1.get_text().strip() == self.standard_index.title + assert link1.attrs["href"] == self.standard_index.url + assert link2.get_text().strip() == "My Page Title" + assert link2.attrs["href"] == self.standard_page.url + assert link3.get_text().strip() == "http://example.com" + assert link3.attrs["href"] == "http://example.com" + assert link4.get_text().strip() == "My External Link Title" + assert link4.attrs["href"] == "http://example.com" + + def test_order_in_preview(self): + item1 = FooterColumn.objects.create(title="One", sort_order=10) + item2 = FooterColumn.objects.create(title="Two", sort_order=20) + + item1.sort_order = 30 + context = item1.get_preview_context(RequestFactory().get("/"), "") + assert [i.title for i in context["FOOTER"]] == ["Two", "One"] + + def test_order_in_preview_new_object(self): + item1 = FooterColumn.objects.create(title="One", sort_order=10) + item2 = FooterColumn(title="Two", sort_order=5) + + context = item2.get_preview_context(RequestFactory().get("/"), "") + assert [i.title for i in context["FOOTER"]] == ["Two", "One"] From 7f165d9bae4341e4f1bc10d055cc1739ec9d91b9 Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Mon, 1 Apr 2024 17:06:56 +0300 Subject: [PATCH 06/11] Responsive styling --- ...{custom-spacers.scss => bs-configure.scss} | 2 + ietf/static_src/css/main.scss | 2 +- ietf/static_src/css/utilities.scss | 6 ++ ietf/templates/includes/footer.html | 67 +++++++++++-------- ietf/templates/includes/styles/footer.scss | 17 +++++ ietf/templates/includes/styles/index.scss | 1 + 6 files changed, 67 insertions(+), 28 deletions(-) rename ietf/static_src/css/{custom-spacers.scss => bs-configure.scss} (85%) create mode 100644 ietf/templates/includes/styles/footer.scss diff --git a/ietf/static_src/css/custom-spacers.scss b/ietf/static_src/css/bs-configure.scss similarity index 85% rename from ietf/static_src/css/custom-spacers.scss rename to ietf/static_src/css/bs-configure.scss index 068f3d5a..6de4a683 100644 --- a/ietf/static_src/css/custom-spacers.scss +++ b/ietf/static_src/css/bs-configure.scss @@ -11,3 +11,5 @@ $custom-spacers: ( ); $spacers: map-merge($spacers, $custom-spacers); + +$enable-negative-margins: true; diff --git a/ietf/static_src/css/main.scss b/ietf/static_src/css/main.scss index d4700877..05ba1fa5 100644 --- a/ietf/static_src/css/main.scss +++ b/ietf/static_src/css/main.scss @@ -2,7 +2,7 @@ @import 'bootstrap/scss/functions'; @import 'bootstrap/scss/variables'; -@import './custom-spacers.scss'; +@import './bs-configure.scss'; @import '@ietf-tools/common-bootstrap-theme/scss/ietf-theme.scss'; @import 'bootstrap/scss/bootstrap'; diff --git a/ietf/static_src/css/utilities.scss b/ietf/static_src/css/utilities.scss index f10be72e..70e5dbfd 100644 --- a/ietf/static_src/css/utilities.scss +++ b/ietf/static_src/css/utilities.scss @@ -21,3 +21,9 @@ .fw-semibold { font-weight: 600 !important; } + +.u-border-lg-bottom-0 { + @include media-breakpoint-up(lg) { + border-bottom: 0 !important; + } +} diff --git a/ietf/templates/includes/footer.html b/ietf/templates/includes/footer.html index 9283379a..d6f881ea 100644 --- a/ietf/templates/includes/footer.html +++ b/ietf/templates/includes/footer.html @@ -2,45 +2,50 @@
    {% for column in FOOTER %} -
    -

    {{ column.title }}

    -
    +
    +
    +

    + {{ column.title }} + +

    +
      + {% for link in column.links %} + {% if link.value.url and link.value.text %} + + {% endif %} + {% endfor %} +
    +
    {% endfor %}
    -
    -
    +
    +
    {% for item in SOCIAL_MENU %} {% endfor %}
    -
    + + diff --git a/ietf/templates/includes/styles/footer.scss b/ietf/templates/includes/styles/footer.scss new file mode 100644 index 00000000..d81ec991 --- /dev/null +++ b/ietf/templates/includes/styles/footer.scss @@ -0,0 +1,17 @@ +footer section { + &.expanded h4 button { + transform: rotate(180deg); + } + + ul { + opacity: .65; + display: none; + @include media-breakpoint-up(lg) { + display: block; + } + } + + &.expanded ul { + display: block; + } +} diff --git a/ietf/templates/includes/styles/index.scss b/ietf/templates/includes/styles/index.scss index 90c7e145..65f0fed5 100644 --- a/ietf/templates/includes/styles/index.scss +++ b/ietf/templates/includes/styles/index.scss @@ -1,4 +1,5 @@ @import 'header.scss'; +@import 'footer.scss'; .block-paragraph { .h2, h2 { From f85881affad5a67912760e1f90dd0a3894b81369 Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Wed, 3 Apr 2024 12:10:22 +0300 Subject: [PATCH 07/11] Make the footer expansion accessible --- ietf/templates/includes/footer.html | 12 ++++++------ ietf/templates/includes/styles/footer.scss | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ietf/templates/includes/footer.html b/ietf/templates/includes/footer.html index d6f881ea..ebc59cc8 100644 --- a/ietf/templates/includes/footer.html +++ b/ietf/templates/includes/footer.html @@ -4,11 +4,9 @@ {% for column in FOOTER %}
    -

    +

      {% for link in column.links %} @@ -57,8 +55,10 @@

      diff --git a/ietf/templates/includes/styles/footer.scss b/ietf/templates/includes/styles/footer.scss index d81ec991..dad0c490 100644 --- a/ietf/templates/includes/styles/footer.scss +++ b/ietf/templates/includes/styles/footer.scss @@ -1,5 +1,19 @@ footer section { - &.expanded h4 button { + h4[role=button] { + @include media-breakpoint-up(lg) { + cursor: text; + } + } + + h4 .bi-chevron-down { + display: block; + float: right; + @include media-breakpoint-up(lg) { + display: none; + } + } + + &.expanded h4 .bi-chevron-down { transform: rotate(180deg); } From 5ecbf463b53ef5933a7273974330663752a878aa Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Wed, 3 Apr 2024 12:23:12 +0300 Subject: [PATCH 08/11] Make tests work after rebasing onto `main` branch --- ietf/conftest.py | 26 ++++++++++++++++++++++++++ ietf/home/factories.py | 21 +++++++++++++++++++++ ietf/standard/factories.py | 19 +++++++++++++++++++ ietf/utils/tests/test_footer.py | 2 +- 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 ietf/conftest.py create mode 100644 ietf/home/factories.py create mode 100644 ietf/standard/factories.py diff --git a/ietf/conftest.py b/ietf/conftest.py new file mode 100644 index 00000000..cddadbc4 --- /dev/null +++ b/ietf/conftest.py @@ -0,0 +1,26 @@ +import pytest +from wagtail.models import Page, Site + +from ietf.home.factories import HomePageFactory + + +@pytest.fixture(autouse=True) +def disable_caches(settings): + """ + Tests run with the "dev" settings, which use memcached. We override them + with the dummy cache so we don't pollute our local development cache. + """ + + settings.CACHES = { + "default": {"BACKEND": "django.core.cache.backends.dummy.DummyCache"}, + "sessions": {"BACKEND": "django.core.cache.backends.dummy.DummyCache"}, + "dummy": {"BACKEND": "django.core.cache.backends.dummy.DummyCache"}, + } + + +@pytest.fixture +def home(): + site = Site.objects.get() + site.root_page = HomePageFactory(parent=Page.get_first_root_node()) + site.save(update_fields=["root_page"]) + return site.root_page diff --git a/ietf/home/factories.py b/ietf/home/factories.py new file mode 100644 index 00000000..0f01b199 --- /dev/null +++ b/ietf/home/factories.py @@ -0,0 +1,21 @@ +import factory +import wagtail_factories + +from .models import HomePage, IABHomePage + + +class HomePageFactory(wagtail_factories.PageFactory): + title = factory.Faker("name") + heading = factory.Faker("name") + introduction = factory.Faker("name") + + class Meta: # type: ignore + model = HomePage + + +class IABHomePageFactory(wagtail_factories.PageFactory): + title = factory.Faker("name") + heading = factory.Faker("name") + + class Meta: # type: ignore + model = IABHomePage diff --git a/ietf/standard/factories.py b/ietf/standard/factories.py new file mode 100644 index 00000000..60702c0d --- /dev/null +++ b/ietf/standard/factories.py @@ -0,0 +1,19 @@ +import factory +import wagtail_factories + +from .models import IABStandardPage, StandardIndexPage, StandardPage + + +class StandardPageFactory(wagtail_factories.PageFactory): + title = factory.Faker("name") + introduction = factory.Faker("paragraph") + + class Meta: # type: ignore + model = StandardPage + + +class StandardIndexPageFactory(wagtail_factories.PageFactory): + title = factory.Faker("name") + + class Meta: # type: ignore + model = StandardIndexPage diff --git a/ietf/utils/tests/test_footer.py b/ietf/utils/tests/test_footer.py index d53f3a0e..4cd22be8 100644 --- a/ietf/utils/tests/test_footer.py +++ b/ietf/utils/tests/test_footer.py @@ -66,7 +66,7 @@ def test_links(self): [section] = soup.select("footer section") [h4] = section.select("h4") - assert h4.get_text() == "Column Title" + assert h4.get_text().strip() == "Column Title" [link1, link2, link3, link4] = section.select("ul li a") assert link1.get_text().strip() == self.standard_index.title From 7ba5d73fc17ae80e4db9807f4eae4c738aa5a9e9 Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Wed, 27 Mar 2024 13:15:23 +0200 Subject: [PATCH 09/11] Add wagtail-factories dependency --- requirements/base.txt | 4 +- requirements/dev.in | 1 + requirements/dev.txt | 152 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 155 insertions(+), 2 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index e8487015..b4c969af 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -122,4 +122,6 @@ webencodings==0.5.1 # bleach # html5lib willow[heif]==1.6.3 - # via wagtail + # via + # wagtail + # willow diff --git a/requirements/dev.in b/requirements/dev.in index 03bac4d6..78f9dcca 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -3,3 +3,4 @@ pip-tools pytest-cov pytest-django +wagtail-factories diff --git a/requirements/dev.txt b/requirements/dev.txt index ef30d09b..eca6a1f5 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,19 +4,120 @@ # # pip-compile dev.in # +anyascii==0.3.2 + # via + # -c base.txt + # wagtail +asgiref==3.7.2 + # via + # -c base.txt + # django +beautifulsoup4==4.11.2 + # via + # -c base.txt + # wagtail build==1.0.3 # via pip-tools +certifi==2023.11.17 + # via + # -c base.txt + # requests +charset-normalizer==3.3.2 + # via + # -c base.txt + # requests click==8.1.7 # via pip-tools coverage[toml]==7.3.2 - # via pytest-cov + # via + # coverage + # pytest-cov +defusedxml==0.7.1 + # via + # -c base.txt + # willow +django==4.2.7 + # via + # -c base.txt + # django-filter + # django-modelcluster + # django-permissionedforms + # django-taggit + # django-treebeard + # djangorestframework + # wagtail +django-filter==23.4 + # via + # -c base.txt + # wagtail +django-modelcluster==6.1 + # via + # -c base.txt + # wagtail +django-permissionedforms==0.1 + # via + # -c base.txt + # wagtail +django-taggit==4.0.0 + # via + # -c base.txt + # wagtail +django-treebeard==4.7 + # via + # -c base.txt + # wagtail +djangorestframework==3.14.0 + # via + # -c base.txt + # wagtail +draftjs-exporter==2.1.7 + # via + # -c base.txt + # wagtail +et-xmlfile==1.1.0 + # via + # -c base.txt + # openpyxl +factory-boy==3.3.0 + # via wagtail-factories +faker==24.4.0 + # via factory-boy +filetype==1.2.0 + # via + # -c base.txt + # willow +html5lib==1.1 + # via + # -c base.txt + # wagtail +idna==3.6 + # via + # -c base.txt + # requests iniconfig==2.0.0 # via pytest +l18n==2021.3 + # via + # -c base.txt + # wagtail +openpyxl==3.1.2 + # via + # -c base.txt + # wagtail packaging==23.2 # via # -c base.txt # build # pytest +pillow==10.1.0 + # via + # -c base.txt + # pillow-heif + # wagtail +pillow-heif==0.13.1 + # via + # -c base.txt + # willow pip-tools==7.3.0 # via -r dev.in pluggy==1.3.0 @@ -31,8 +132,57 @@ pytest-cov==4.1.0 # via -r dev.in pytest-django==4.7.0 # via -r dev.in +python-dateutil==2.9.0.post0 + # via faker +pytz==2023.3.post1 + # via + # -c base.txt + # django-modelcluster + # djangorestframework + # l18n +requests==2.31.0 + # via + # -c base.txt + # wagtail +six==1.16.0 + # via + # -c base.txt + # html5lib + # l18n + # python-dateutil +soupsieve==2.5 + # via + # -c base.txt + # beautifulsoup4 +sqlparse==0.4.4 + # via + # -c base.txt + # django +telepath==0.3.1 + # via + # -c base.txt + # wagtail +urllib3==2.1.0 + # via + # -c base.txt + # requests +wagtail==5.2.1 + # via + # -c base.txt + # wagtail-factories +wagtail-factories==4.1.0 + # via -r dev.in +webencodings==0.5.1 + # via + # -c base.txt + # html5lib wheel==0.42.0 # via pip-tools +willow[heif]==1.6.3 + # via + # -c base.txt + # wagtail + # willow # The following packages are considered to be unsafe in a requirements file: # pip From 9b557a52808b8eb0824d1315a463c69cd9e6cdb7 Mon Sep 17 00:00:00 2001 From: Alex Morega Date: Thu, 4 Apr 2024 14:28:45 +0300 Subject: [PATCH 10/11] Improve accessibility --- ietf/templates/includes/footer.html | 4 ++-- ietf/templates/includes/styles/footer.scss | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ietf/templates/includes/footer.html b/ietf/templates/includes/footer.html index ebc59cc8..b15a2b42 100644 --- a/ietf/templates/includes/footer.html +++ b/ietf/templates/includes/footer.html @@ -8,13 +8,13 @@ -
        +
          {% for link in column.links %} {% if link.value.url and link.value.text %}