wagtail-enap-designsystem 1.2.1.164__py3-none-any.whl → 1.2.1.166__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.
- enap_designsystem/blocks/html_blocks.py +2 -50
- enap_designsystem/templates/enap_designsystem/base.html +3 -1
- {wagtail_enap_designsystem-1.2.1.164.dist-info → wagtail_enap_designsystem-1.2.1.166.dist-info}/METADATA +1 -1
- {wagtail_enap_designsystem-1.2.1.164.dist-info → wagtail_enap_designsystem-1.2.1.166.dist-info}/RECORD +7 -7
- {wagtail_enap_designsystem-1.2.1.164.dist-info → wagtail_enap_designsystem-1.2.1.166.dist-info}/WHEEL +0 -0
- {wagtail_enap_designsystem-1.2.1.164.dist-info → wagtail_enap_designsystem-1.2.1.166.dist-info}/licenses/LICENSE +0 -0
- {wagtail_enap_designsystem-1.2.1.164.dist-info → wagtail_enap_designsystem-1.2.1.166.dist-info}/top_level.txt +0 -0
|
@@ -551,58 +551,10 @@ class NewsCarouselBlock(BaseBlock):
|
|
|
551
551
|
pages_final = sorted(pages, key=get_page_date, reverse=True)[:num_posts]
|
|
552
552
|
context["pages"] = pages_final
|
|
553
553
|
return context
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
all_children = indexer.get_children().live().select_related('content_type').order_by('-first_published_at')[:20]
|
|
557
|
-
enap_noticias = []
|
|
558
|
-
outras_pages = []
|
|
559
|
-
noticias_ids = set() # Usar set para busca O(1)
|
|
560
|
-
|
|
561
|
-
for page in all_children:
|
|
562
|
-
if isinstance(page.specific, ENAPNoticia):
|
|
563
|
-
enap_noticias.append(page.specific)
|
|
564
|
-
noticias_ids.add(page.specific.id)
|
|
565
|
-
else:
|
|
566
|
-
outras_pages.append(page)
|
|
567
|
-
|
|
568
554
|
|
|
569
|
-
|
|
570
|
-
# Ordenar TODAS as notícias por data primeiro
|
|
571
|
-
def get_page_date(page):
|
|
572
|
-
return getattr(page, "date_display", None) or page.first_published_at.date()
|
|
573
|
-
|
|
574
|
-
todas_noticias_ordenadas = sorted(enap_noticias, key=get_page_date, reverse=True)
|
|
575
|
-
|
|
576
|
-
# Pegar a notícia em destaque
|
|
577
|
-
destaque = None
|
|
578
|
-
try:
|
|
579
|
-
destaque_temp = ENAPNoticia.get_noticia_destaque()
|
|
580
|
-
# Verificar se o destaque está entre as 20 filhas carregadas
|
|
581
|
-
if destaque_temp and destaque_temp.id in noticias_ids and destaque_temp.live:
|
|
582
|
-
destaque = destaque_temp
|
|
583
|
-
except Exception:
|
|
584
|
-
pass
|
|
585
|
-
|
|
586
|
-
if destaque:
|
|
587
|
-
# Remove o destaque da lista ordenada
|
|
588
|
-
print("ESSA É O NOME DA NOTICIA DESTAQUE QUE MOSTRA NA HOME:", destaque)
|
|
589
|
-
noticias_sem_destaque = [n for n in todas_noticias_ordenadas if n.id != destaque.id]
|
|
590
|
-
|
|
591
|
-
# Destaque primeiro, depois as outras em ordem cronológica
|
|
592
|
-
pages_final = [destaque] + noticias_sem_destaque[:num_posts-1]
|
|
593
|
-
else:
|
|
594
|
-
# Não há destaque entre as filhas, ordenação normal
|
|
595
|
-
pages_final = todas_noticias_ordenadas[:num_posts]
|
|
596
|
-
|
|
597
|
-
else:
|
|
598
|
-
pages = indexer.get_children().live().select_related('content_type').order_by("-first_published_at")[:50]
|
|
599
|
-
|
|
600
|
-
def get_page_date(page):
|
|
601
|
-
return getattr(page.specific, "date_display", None) or page.first_published_at.date()
|
|
602
|
-
|
|
603
|
-
pages_final = sorted(pages, key=get_page_date, reverse=True)[:num_posts]
|
|
555
|
+
todas_noticias = ENAPNoticia.get_todas_noticias_ordenadas(limit=num_posts)
|
|
604
556
|
|
|
605
|
-
context["pages"] =
|
|
557
|
+
context["pages"] = todas_noticias
|
|
606
558
|
return context
|
|
607
559
|
|
|
608
560
|
|
|
@@ -59,13 +59,15 @@
|
|
|
59
59
|
{% endwith %}
|
|
60
60
|
{% elif page.image %}
|
|
61
61
|
{# Prioridade 3: campo image genérico (se existir) #}
|
|
62
|
-
{%
|
|
62
|
+
{% with page.image.0.value as first_image %}
|
|
63
|
+
{% image first_image fill-1200x630 as og_image %}
|
|
63
64
|
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{{ og_image.url }}">
|
|
64
65
|
<meta property="og:image:secure_url" content="https://{{ request.get_host }}{{ og_image.url }}">
|
|
65
66
|
<meta property="og:image:width" content="1200">
|
|
66
67
|
<meta property="og:image:height" content="630">
|
|
67
68
|
<meta property="og:image:alt" content="{{ page.title }}">
|
|
68
69
|
<meta property="og:image:type" content="image/jpeg">
|
|
70
|
+
{% endwith %}
|
|
69
71
|
{% else %}
|
|
70
72
|
{# Fallback: Imagem padrão ENAP #}
|
|
71
73
|
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{% static 'enap_designsystem/blocks/suap/default_1.png' %}">
|
|
@@ -12,7 +12,7 @@ enap_designsystem/blocks/base_blocks.py,sha256=ZuqVWn4PEAvD3pKM1ST7wjo4lwv98ooen
|
|
|
12
12
|
enap_designsystem/blocks/chatbot_blocks.py,sha256=YeCznrXMbFa9MP9vjdTYl53ZhKsywkGOXvFK2bwcqW0,1133
|
|
13
13
|
enap_designsystem/blocks/content_blocks.py,sha256=1rq45z-ljvCHB0G3Sw3COItFOFYO-UhmvWUINVyoW_I,18227
|
|
14
14
|
enap_designsystem/blocks/form.py,sha256=oK0Lswd1nIH0bLTdBL_XF_1LbNPixEYr5FJWj8DAxHY,88782
|
|
15
|
-
enap_designsystem/blocks/html_blocks.py,sha256=
|
|
15
|
+
enap_designsystem/blocks/html_blocks.py,sha256=mog27FEhYjhspfs7Y1osr7zvrTJSCz_Cjz3th5Q3ry0,260778
|
|
16
16
|
enap_designsystem/blocks/layout_blocks.py,sha256=gKmpWPAcw_cXFb4m3lgKB1drhIUnGAnS7m_gmQXxLG0,24248
|
|
17
17
|
enap_designsystem/blocks/security.py,sha256=QA7lmQ_eQ6iopunatl_DrHkEegAwMZJGwXunRulbCjk,2099
|
|
18
18
|
enap_designsystem/blocks/semana_blocks.py,sha256=AfaxJQmStvFkw6yrPeKyZurC6jzCxWxyzmdny_pret0,70929
|
|
@@ -654,7 +654,7 @@ enap_designsystem/templates/admin/csv_export.html,sha256=VEKnMKncJJ0hGHOVmq30hmn
|
|
|
654
654
|
enap_designsystem/templates/admin/exportar_respostas.html,sha256=jF7hGJ6LkbKo536-7ZIulTXjJQVOOf07-dJbIbzKbBI,6017
|
|
655
655
|
enap_designsystem/templates/admin/meta_tags_manager.html,sha256=_zJZLEvEfZD4AFoK_YYEOE0C3_dHsYiHv-lumvXFr5s,11826
|
|
656
656
|
enap_designsystem/templates/enap_designsystem/accordion_v2.html,sha256=SE-72OoHu-WucITL-CPR4XJzfLHrq78kmiytaSJB3Lc,4228
|
|
657
|
-
enap_designsystem/templates/enap_designsystem/base.html,sha256=
|
|
657
|
+
enap_designsystem/templates/enap_designsystem/base.html,sha256=2GN8rv8yRg-cnq524PONYK_VrWWp3iDOTROp8qtJE24,18623
|
|
658
658
|
enap_designsystem/templates/enap_designsystem/sistema_votacao_page.html,sha256=N8EoF3iXltBsD49yKAAO5n6zSop_DI1pv3WI8Js9quc,64128
|
|
659
659
|
enap_designsystem/templates/enap_designsystem/blocks/accordions.html,sha256=WXBQrkO4U0R8SDbdbFRWBx742gdpiYiKEviiyQURZMk,2940
|
|
660
660
|
enap_designsystem/templates/enap_designsystem/blocks/accordionsv2.html,sha256=-WXIV6zFjdbRAylWhF9mQkMxUr1Df4-d3OazVm1xT9s,5186
|
|
@@ -896,8 +896,8 @@ enap_designsystem/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
896
896
|
enap_designsystem/utils/decorators.py,sha256=aq6SbLn0LcH2rfE3ZFit8jkD7pSx9fLVBUUwVB747hg,335
|
|
897
897
|
enap_designsystem/utils/services.py,sha256=6dG5jLSbwH49jpZV9ZNpWlaZqI49gTlwlr1vaerxdiU,5824
|
|
898
898
|
enap_designsystem/utils/sso.py,sha256=vjAuoYgoLeQAa_dkkyQ6-LmHvKMaVCxizNFpe5y3iUA,1145
|
|
899
|
-
wagtail_enap_designsystem-1.2.1.
|
|
900
|
-
wagtail_enap_designsystem-1.2.1.
|
|
901
|
-
wagtail_enap_designsystem-1.2.1.
|
|
902
|
-
wagtail_enap_designsystem-1.2.1.
|
|
903
|
-
wagtail_enap_designsystem-1.2.1.
|
|
899
|
+
wagtail_enap_designsystem-1.2.1.166.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
|
|
900
|
+
wagtail_enap_designsystem-1.2.1.166.dist-info/METADATA,sha256=n7lp8TUVA72D2OPGnDLv_Q2GUCwLzjt7D9hUK_lgX7I,3651
|
|
901
|
+
wagtail_enap_designsystem-1.2.1.166.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
902
|
+
wagtail_enap_designsystem-1.2.1.166.dist-info/top_level.txt,sha256=RSFgMASxoA-hVftm5i4Qd0rArlX4Dq08lLv5G4sYD-g,18
|
|
903
|
+
wagtail_enap_designsystem-1.2.1.166.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|