wagtail-enap-designsystem 1.2.1.125__py3-none-any.whl → 1.2.1.126__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/__init__.py +2 -0
- enap_designsystem/blocks/html_blocks.py +63 -1
- enap_designsystem/migrations/0387_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py +51190 -0
- enap_designsystem/templates/enap_designsystem/blocks/page/pagenoticias_block.html +2 -1
- enap_designsystem/templates/enap_designsystem/blocks/recaptcha.html +338 -0
- {wagtail_enap_designsystem-1.2.1.125.dist-info → wagtail_enap_designsystem-1.2.1.126.dist-info}/METADATA +1 -1
- {wagtail_enap_designsystem-1.2.1.125.dist-info → wagtail_enap_designsystem-1.2.1.126.dist-info}/RECORD +10 -8
- {wagtail_enap_designsystem-1.2.1.125.dist-info → wagtail_enap_designsystem-1.2.1.126.dist-info}/WHEEL +0 -0
- {wagtail_enap_designsystem-1.2.1.125.dist-info → wagtail_enap_designsystem-1.2.1.126.dist-info}/licenses/LICENSE +0 -0
- {wagtail_enap_designsystem-1.2.1.125.dist-info → wagtail_enap_designsystem-1.2.1.126.dist-info}/top_level.txt +0 -0
|
@@ -28,6 +28,7 @@ from .html_blocks import (
|
|
|
28
28
|
FormularioDinamicoBlock,
|
|
29
29
|
ApresentacaoBlock,
|
|
30
30
|
ApresentacaoSimpleBlock,
|
|
31
|
+
RecaptchaBlock,
|
|
31
32
|
)
|
|
32
33
|
|
|
33
34
|
from .semana_blocks import (
|
|
@@ -474,6 +475,7 @@ LAYOUT_STREAMBLOCKS = [
|
|
|
474
475
|
("patrocinadores", SecaoPatrocinadoresBlock()),
|
|
475
476
|
|
|
476
477
|
# ===== SEÇÃO COMPLEXA (MANTIDA PARA COMPATIBILIDADE) =====
|
|
478
|
+
('recaptcha', RecaptchaBlock()),
|
|
477
479
|
("enap_section", EnapSectionBlock([
|
|
478
480
|
("button", ButtonBlock()),
|
|
479
481
|
("image", ImageBlock()),
|
|
@@ -3,6 +3,7 @@ from django.utils.translation import gettext_lazy as _
|
|
|
3
3
|
from wagtail.documents.blocks import DocumentChooserBlock
|
|
4
4
|
from wagtail import blocks
|
|
5
5
|
import uuid
|
|
6
|
+
from django.conf import settings
|
|
6
7
|
from types import SimpleNamespace
|
|
7
8
|
from wagtail import blocks
|
|
8
9
|
from wagtail.fields import StreamField
|
|
@@ -7594,4 +7595,65 @@ class ApresentacaoSimpleBlock(blocks.StructBlock):
|
|
|
7594
7595
|
template = 'enap_designsystem/blocks/apresentacao_simple_block.html'
|
|
7595
7596
|
icon = 'doc-full'
|
|
7596
7597
|
label = 'Apresentação com Cards'
|
|
7597
|
-
help_text = 'Componente com título, texto e grid flexível de cards'
|
|
7598
|
+
help_text = 'Componente com título, texto e grid flexível de cards'
|
|
7599
|
+
|
|
7600
|
+
|
|
7601
|
+
|
|
7602
|
+
|
|
7603
|
+
|
|
7604
|
+
|
|
7605
|
+
class RecaptchaBlock(StructBlock):
|
|
7606
|
+
"""Componente reCAPTCHA isolado para usar em qualquer formulário"""
|
|
7607
|
+
|
|
7608
|
+
tipo = ChoiceBlock(
|
|
7609
|
+
choices=[
|
|
7610
|
+
('v2', 'reCAPTCHA v2 (checkbox visível)'),
|
|
7611
|
+
('v3', 'reCAPTCHA v3 (invisível)'),
|
|
7612
|
+
('v2_invisible', 'reCAPTCHA v2 invisível'),
|
|
7613
|
+
],
|
|
7614
|
+
default='v2',
|
|
7615
|
+
help_text="Tipo de reCAPTCHA"
|
|
7616
|
+
)
|
|
7617
|
+
|
|
7618
|
+
tema = ChoiceBlock(
|
|
7619
|
+
choices=[
|
|
7620
|
+
('light', 'Claro'),
|
|
7621
|
+
('dark', 'Escuro'),
|
|
7622
|
+
],
|
|
7623
|
+
default='light',
|
|
7624
|
+
help_text="Tema visual (apenas v2)"
|
|
7625
|
+
)
|
|
7626
|
+
|
|
7627
|
+
tamanho = ChoiceBlock(
|
|
7628
|
+
choices=[
|
|
7629
|
+
('normal', 'Normal'),
|
|
7630
|
+
('compact', 'Compacto'),
|
|
7631
|
+
],
|
|
7632
|
+
default='normal',
|
|
7633
|
+
help_text="Tamanho do widget (apenas v2)"
|
|
7634
|
+
)
|
|
7635
|
+
|
|
7636
|
+
css_classes = CharBlock(
|
|
7637
|
+
required=False,
|
|
7638
|
+
help_text="Classes CSS adicionais"
|
|
7639
|
+
)
|
|
7640
|
+
|
|
7641
|
+
acao_v3 = CharBlock(
|
|
7642
|
+
default='submit',
|
|
7643
|
+
required=False,
|
|
7644
|
+
help_text="Ação para reCAPTCHA v3 (ex: login, submit, homepage)"
|
|
7645
|
+
)
|
|
7646
|
+
|
|
7647
|
+
def get_context(self, value, parent_context=None):
|
|
7648
|
+
context = super().get_context(value, parent_context)
|
|
7649
|
+
context.update({
|
|
7650
|
+
'recaptcha_public_key': getattr(settings, 'RECAPTCHA_PUBLIC_KEY', ''),
|
|
7651
|
+
'has_recaptcha_keys': bool(getattr(settings, 'RECAPTCHA_PUBLIC_KEY', '')),
|
|
7652
|
+
})
|
|
7653
|
+
return context
|
|
7654
|
+
|
|
7655
|
+
class Meta:
|
|
7656
|
+
template = 'enap_designsystem/blocks/recaptcha.html'
|
|
7657
|
+
icon = 'lock'
|
|
7658
|
+
label = 'reCAPTCHA'
|
|
7659
|
+
help_text = 'Componente de verificação reCAPTCHA'
|