wagtail-enap-designsystem 1.2.1.198__py3-none-any.whl → 1.2.1.200__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wagtail-enap-designsystem might be problematic. Click here for more details.

Files changed (19) hide show
  1. enap_designsystem/blocks/__init__.py +4 -1
  2. enap_designsystem/blocks/html_blocks.py +61 -0
  3. enap_designsystem/migrations/0469_alter_areaaluno_body_alter_cursoeadpage_curso_and_more.py +64758 -0
  4. enap_designsystem/migrations/0470_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py +63570 -0
  5. enap_designsystem/migrations/0471_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py +63574 -0
  6. enap_designsystem/migrations/0472_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py +63566 -0
  7. enap_designsystem/migrations/0473_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py +63406 -0
  8. enap_designsystem/migrations/0474_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py +63570 -0
  9. enap_designsystem/static/enap_designsystem/blocks/capsulas.css +4 -0
  10. enap_designsystem/static/enap_designsystem/blocks/cards.css +6 -0
  11. enap_designsystem/static/enap_designsystem/blocks/carousel_responsive.css +5 -0
  12. enap_designsystem/templates/enap_designsystem/blocks/carousel_images.html +47 -0
  13. enap_designsystem/templates/enap_designsystem/pages/capsula_page.html +3 -3
  14. enap_designsystem/templates/enap_designsystem/pages/mini/cards.html +182 -0
  15. {wagtail_enap_designsystem-1.2.1.198.dist-info → wagtail_enap_designsystem-1.2.1.200.dist-info}/METADATA +1 -1
  16. {wagtail_enap_designsystem-1.2.1.198.dist-info → wagtail_enap_designsystem-1.2.1.200.dist-info}/RECORD +19 -12
  17. {wagtail_enap_designsystem-1.2.1.198.dist-info → wagtail_enap_designsystem-1.2.1.200.dist-info}/WHEEL +0 -0
  18. {wagtail_enap_designsystem-1.2.1.198.dist-info → wagtail_enap_designsystem-1.2.1.200.dist-info}/licenses/LICENSE +0 -0
  19. {wagtail_enap_designsystem-1.2.1.198.dist-info → wagtail_enap_designsystem-1.2.1.200.dist-info}/top_level.txt +0 -0
@@ -35,7 +35,8 @@ from .html_blocks import (
35
35
  SecaoApresentacaoCardsBlock,
36
36
  LogosSimpleBlock,
37
37
  NumerosBlock,
38
- SecaoCardsVariavelBlock
38
+ SecaoCardsVariavelBlock,
39
+ CardIndexBlock
39
40
  )
40
41
 
41
42
  from .semana_blocks import (
@@ -497,6 +498,7 @@ LAYOUT_STREAMBLOCKS = [
497
498
  # ===== SEÇÃO COMPLEXA (MANTIDA PARA COMPATIBILIDADE) =====
498
499
  ('recaptcha', RecaptchaBlock()),
499
500
  ('footer_generico', FooterGenericoBlock()),
501
+ ('cards_pags', CardIndexBlock()),
500
502
  ("enap_section", EnapSectionBlock([
501
503
  ("faq_tematico", FAQSnippetBlock()),
502
504
  ("button", ButtonBlock()),
@@ -507,6 +509,7 @@ LAYOUT_STREAMBLOCKS = [
507
509
  ('menus', MenuNavigationBlock()),
508
510
  ('buttoncenter', ButtonCenter()),
509
511
  ("enap_accordion", EnapAccordionBlock()),
512
+ ('cards_pags', CardIndexBlock()),
510
513
  ("timeline", TimelineBlock()),
511
514
  ("timeline_container", TimelineContainerBlock()),
512
515
  ("cronograma", CronogramaBlock()),
@@ -1503,6 +1503,56 @@ class EventsCarouselBlock(BaseBlock):
1503
1503
 
1504
1504
 
1505
1505
 
1506
+
1507
+ class CardIndexBlock(BaseBlock):
1508
+ """
1509
+ Renders a grid of selected capsula pages.
1510
+ """
1511
+
1512
+ indexed_by = blocks.PageChooserBlock(
1513
+ required=True,
1514
+ label=_("Parent page"),
1515
+ help_text=_(
1516
+ "Show a preview of capsulas that are children of the selected page. "
1517
+ "Uses ordering specified in the page's publication date."
1518
+ ),
1519
+ )
1520
+
1521
+ num_capsulas = blocks.IntegerBlock(
1522
+ default=3,
1523
+ label=_("Number of capsulas to show"),
1524
+ )
1525
+
1526
+ card_type = blocks.ChoiceBlock(
1527
+ choices=[
1528
+ ('card-info-white', _('Card Info White')),
1529
+ ('card-info-dark', _('Card Info Dark')),
1530
+ ],
1531
+ default='card-info-white',
1532
+ label=_("Card Type"),
1533
+ )
1534
+
1535
+ class Meta:
1536
+ template = "enap_designsystem/pages/mini/cards.html"
1537
+ icon = "snippet"
1538
+ label = _("Renderização de páginas")
1539
+
1540
+ def get_context(self, value, parent_context=None):
1541
+ context = super().get_context(value, parent_context=parent_context)
1542
+
1543
+ indexer = value["indexed_by"].specific
1544
+
1545
+ if hasattr(indexer, "get_index_children"):
1546
+ capsulas = indexer.get_index_children()
1547
+ else:
1548
+ capsulas = indexer.get_children().live()
1549
+
1550
+ capsulas = capsulas.order_by('-first_published_at')
1551
+
1552
+ context["capsulas_relacionadas"] = capsulas[:value["num_capsulas"]]
1553
+ return context
1554
+
1555
+
1506
1556
  class SuapEventsBlock(StructBlock):
1507
1557
  title = CharBlock(required=False, label="Título")
1508
1558
  description = CharBlock(required=False, label="Descrição")
@@ -6462,6 +6512,17 @@ class CarouselSlideBlock(blocks.StructBlock):
6462
6512
  label="Imagem Mobile",
6463
6513
  help_text="Imagem para dispositivos móveis"
6464
6514
  )
6515
+
6516
+ links = blocks.StreamBlock(
6517
+ [
6518
+ ("button", ButtonBlock()),
6519
+ ],
6520
+ max_num=3,
6521
+ blank=True,
6522
+ required=False,
6523
+ label="Botões (links)",
6524
+ help_text="Adicione até 3 botões para o card"
6525
+ )
6465
6526
 
6466
6527
  # Configurações do Botão
6467
6528
  mostrar_botao = blocks.BooleanBlock(