wagtail-enap-designsystem 1.2.1.163__py3-none-any.whl → 1.2.1.165__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 +5 -52
- {wagtail_enap_designsystem-1.2.1.163.dist-info → wagtail_enap_designsystem-1.2.1.165.dist-info}/METADATA +1 -1
- {wagtail_enap_designsystem-1.2.1.163.dist-info → wagtail_enap_designsystem-1.2.1.165.dist-info}/RECORD +6 -6
- {wagtail_enap_designsystem-1.2.1.163.dist-info → wagtail_enap_designsystem-1.2.1.165.dist-info}/WHEEL +0 -0
- {wagtail_enap_designsystem-1.2.1.163.dist-info → wagtail_enap_designsystem-1.2.1.165.dist-info}/licenses/LICENSE +0 -0
- {wagtail_enap_designsystem-1.2.1.163.dist-info → wagtail_enap_designsystem-1.2.1.165.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
|
-
|
|
569
|
-
if enap_noticias:
|
|
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
554
|
|
|
603
|
-
|
|
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
|
|
|
@@ -4955,8 +4907,9 @@ class JobVacancyPage(Page):
|
|
|
4955
4907
|
|
|
4956
4908
|
def get_context(self, request, *args, **kwargs):
|
|
4957
4909
|
context = super().get_context(request, *args, **kwargs)
|
|
4958
|
-
|
|
4959
|
-
context['
|
|
4910
|
+
|
|
4911
|
+
if self.registration_start and self.registration_end: context['registration_period'] = f"{self.registration_start.strftime('%d/%m/%Y')} - {self.registration_end.strftime('%d/%m/%Y')}"
|
|
4912
|
+
else: context['share_url'] = request.build_absolute_uri(self.url)
|
|
4960
4913
|
return context
|
|
4961
4914
|
|
|
4962
4915
|
def get_template(self, request, *args, **kwargs):
|
|
@@ -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
|
|
@@ -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.165.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
|
|
900
|
+
wagtail_enap_designsystem-1.2.1.165.dist-info/METADATA,sha256=zO_opEdEer-YJZhdCf6nCPRqguaazwHfl9107jgLnyI,3651
|
|
901
|
+
wagtail_enap_designsystem-1.2.1.165.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
902
|
+
wagtail_enap_designsystem-1.2.1.165.dist-info/top_level.txt,sha256=RSFgMASxoA-hVftm5i4Qd0rArlX4Dq08lLv5G4sYD-g,18
|
|
903
|
+
wagtail_enap_designsystem-1.2.1.165.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|