wagtail-enap-designsystem 1.2.1.131__py3-none-any.whl → 1.2.1.132__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.
- enap_designsystem/blocks/form.py +81 -49
- enap_designsystem/migrations/0406_alter_areaaluno_body_alter_cursoeadpage_curso_and_more.py +55023 -0
- enap_designsystem/migrations/0407_alter_formulariopage_form_steps.py +1277 -0
- enap_designsystem/migrations/0408_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py +53961 -0
- enap_designsystem/migrations/0409_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py +54062 -0
- enap_designsystem/migrations/0410_alter_formulariopage_form_steps.py +1278 -0
- enap_designsystem/templates/enap_designsystem/form_templates/formulario_page.html +456 -109
- enap_designsystem/templates/enap_designsystem/includes/form_field.html +108 -443
- {wagtail_enap_designsystem-1.2.1.131.dist-info → wagtail_enap_designsystem-1.2.1.132.dist-info}/METADATA +1 -1
- {wagtail_enap_designsystem-1.2.1.131.dist-info → wagtail_enap_designsystem-1.2.1.132.dist-info}/RECORD +13 -8
- {wagtail_enap_designsystem-1.2.1.131.dist-info → wagtail_enap_designsystem-1.2.1.132.dist-info}/WHEEL +0 -0
- {wagtail_enap_designsystem-1.2.1.131.dist-info → wagtail_enap_designsystem-1.2.1.132.dist-info}/licenses/LICENSE +0 -0
- {wagtail_enap_designsystem-1.2.1.131.dist-info → wagtail_enap_designsystem-1.2.1.132.dist-info}/top_level.txt +0 -0
|
@@ -421,6 +421,14 @@
|
|
|
421
421
|
{% include 'enap_designsystem/includes/form_field.html' with block=field_block %}
|
|
422
422
|
{% endfor %}
|
|
423
423
|
</div>
|
|
424
|
+
{% elif option_block.value.action == 'end_form' %}
|
|
425
|
+
<div class="end-form-message"
|
|
426
|
+
data-parent-field="{{ block.block_type }}_{{ block.id }}"
|
|
427
|
+
data-trigger-value="{{ option_block.value.value }}"
|
|
428
|
+
style="display: none; margin-top: 1rem; padding: 1rem; border: 1px solid #f5c6cb; border-radius: 8px; background: #f8d7da; color: #721c24;">
|
|
429
|
+
<p>⛔ Para dar continuidade, é necessário aceitar os termos</p>
|
|
430
|
+
<button type="submit" class="btn btn-primary">Enviar agora</button>
|
|
431
|
+
</div>
|
|
424
432
|
{% endif %}
|
|
425
433
|
{% endfor %}
|
|
426
434
|
</div>
|
|
@@ -729,214 +737,118 @@
|
|
|
729
737
|
{% endfor %}
|
|
730
738
|
</div>
|
|
731
739
|
|
|
732
|
-
<script>
|
|
733
|
-
// JavaScript específico para conditional_field_condicional
|
|
734
|
-
(function() {
|
|
735
|
-
console.log('🔧 Inicializando conditional_field_condicional para {{ block.block_type }}_{{ block.id }}');
|
|
736
|
-
|
|
737
|
-
function initConditionalField() {
|
|
738
|
-
const fieldId = '{{ block.block_type }}_{{ block.id }}';
|
|
739
|
-
const triggers = document.querySelectorAll(`[data-field-id="${fieldId}"].conditional-condicional-trigger`);
|
|
740
|
-
|
|
741
|
-
console.log(`🎯 Encontrados ${triggers.length} triggers para ${fieldId}`);
|
|
742
|
-
|
|
743
|
-
if (triggers.length === 0) {
|
|
744
|
-
console.warn(`⚠️ Nenhum trigger encontrado para ${fieldId}`);
|
|
745
|
-
return;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
triggers.forEach((trigger, index) => {
|
|
749
|
-
console.log(`🔗 Configurando trigger ${index + 1}:`, trigger.type, trigger.name);
|
|
750
|
-
|
|
751
|
-
trigger.addEventListener('change', function() {
|
|
752
|
-
console.log(`📝 Trigger mudou: ${this.value}`);
|
|
753
|
-
handleConditionalChange(fieldId, this.value);
|
|
754
|
-
});
|
|
755
|
-
|
|
756
|
-
// Verificar estado inicial
|
|
757
|
-
if (trigger.checked || (trigger.type === 'select-one' && trigger.value)) {
|
|
758
|
-
console.log(`🚀 Estado inicial detectado: ${trigger.value}`);
|
|
759
|
-
handleConditionalChange(fieldId, trigger.value);
|
|
760
|
-
}
|
|
761
|
-
});
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
function handleConditionalChange(fieldId, selectedValue) {
|
|
765
|
-
console.log(`🔄 Campo ${fieldId} mudou para: "${selectedValue}"`);
|
|
766
|
-
|
|
767
|
-
// Ocultar todos os campos condicionais deste campo
|
|
768
|
-
const allFields = document.querySelectorAll(`[data-parent-field="${fieldId}"]`);
|
|
769
|
-
console.log(`📦 Encontrados ${allFields.length} campos condicionais`);
|
|
770
|
-
|
|
771
|
-
allFields.forEach((field, index) => {
|
|
772
|
-
field.style.display = 'none';
|
|
773
|
-
console.log(`👁️ Ocultando campo ${index + 1}`);
|
|
774
|
-
|
|
775
|
-
// Limpar valores dos campos ocultos
|
|
776
|
-
const inputs = field.querySelectorAll('input, select, textarea');
|
|
777
|
-
inputs.forEach(input => {
|
|
778
|
-
if (input.type === 'checkbox' || input.type === 'radio') {
|
|
779
|
-
input.checked = false;
|
|
780
|
-
} else {
|
|
781
|
-
input.value = '';
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
// Disparar evento change para outros condicionais aninhados
|
|
785
|
-
input.dispatchEvent(new Event('change', { bubbles: true }));
|
|
786
|
-
});
|
|
787
|
-
});
|
|
788
|
-
|
|
789
|
-
// Mostrar campos para o valor selecionado
|
|
790
|
-
if (selectedValue) {
|
|
791
|
-
const targetField = document.querySelector(`[data-parent-field="${fieldId}"][data-trigger-value="${selectedValue}"]`);
|
|
792
|
-
if (targetField) {
|
|
793
|
-
targetField.style.display = 'block';
|
|
794
|
-
|
|
795
|
-
// Animação suave
|
|
796
|
-
targetField.style.opacity = '0';
|
|
797
|
-
targetField.style.transform = 'translateY(-10px)';
|
|
798
|
-
|
|
799
|
-
setTimeout(() => {
|
|
800
|
-
targetField.style.transition = 'all 0.3s ease';
|
|
801
|
-
targetField.style.opacity = '1';
|
|
802
|
-
targetField.style.transform = 'translateY(0)';
|
|
803
|
-
}, 10);
|
|
804
|
-
|
|
805
|
-
console.log(`✅ Campos mostrados para: "${selectedValue}"`);
|
|
806
|
-
|
|
807
|
-
// Scroll suave para os campos que apareceram
|
|
808
|
-
setTimeout(() => {
|
|
809
|
-
targetField.scrollIntoView({
|
|
810
|
-
behavior: 'smooth',
|
|
811
|
-
block: 'nearest'
|
|
812
|
-
});
|
|
813
|
-
}, 300);
|
|
814
|
-
} else {
|
|
815
|
-
console.warn(`⚠️ Nenhum campo condicional encontrado para valor: "${selectedValue}"`);
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
// Inicializar quando DOM estiver pronto
|
|
821
|
-
if (document.readyState === 'loading') {
|
|
822
|
-
document.addEventListener('DOMContentLoaded', initConditionalField);
|
|
823
|
-
} else {
|
|
824
|
-
initConditionalField();
|
|
825
|
-
}
|
|
826
|
-
})();
|
|
827
|
-
</script>
|
|
828
740
|
|
|
829
741
|
<style>
|
|
830
|
-
/* Estilos específicos para conditional_field_condicional */
|
|
831
|
-
.conditional-field-condicional-group {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
.conditional-condicional-fields {
|
|
837
|
-
border-left: 4px solid var(--primary-color, #2A5E2C);
|
|
838
|
-
background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
|
|
839
|
-
transition: all 0.3s ease;
|
|
840
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
|
841
|
-
border-radius: 8px;
|
|
842
|
-
overflow: hidden;
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
.conditional-condicional-fields:hover {
|
|
846
|
-
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
.conditional-fields-header {
|
|
850
|
-
margin-bottom: 1rem;
|
|
851
|
-
padding-bottom: 0.5rem;
|
|
852
|
-
border-bottom: 1px solid #dee2e6;
|
|
853
|
-
background: rgba(42, 94, 44, 0.05);
|
|
854
|
-
margin: -1rem -1rem 1rem -1rem;
|
|
855
|
-
padding: 0.75rem 1rem;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
.conditional-fields-header .text-muted {
|
|
859
|
-
color: var(--primary-color, #2A5E2C) !important;
|
|
860
|
-
font-weight: 600;
|
|
861
|
-
font-size: 0.9rem;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
/* Melhorar a aparência dos campos aninhados */
|
|
865
|
-
.conditional-condicional-fields .form-group {
|
|
866
|
-
margin-bottom: 1.25rem;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
.conditional-condicional-fields .form-group:last-child {
|
|
870
|
-
margin-bottom: 0;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
.conditional-condicional-fields .form-control {
|
|
874
|
-
border-color: #d1d9e0;
|
|
875
|
-
background: white;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
.conditional-condicional-fields .form-control:focus {
|
|
879
|
-
border-color: var(--primary-color, #2A5E2C);
|
|
880
|
-
box-shadow: 0 0 0 2px rgba(42, 94, 44, 0.1);
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
/* Animações */
|
|
884
|
-
@keyframes slideInDown {
|
|
885
|
-
from {
|
|
886
|
-
opacity: 0;
|
|
887
|
-
transform: translateY(-15px);
|
|
888
|
-
}
|
|
889
|
-
to {
|
|
890
|
-
opacity: 1;
|
|
891
|
-
transform: translateY(0);
|
|
742
|
+
/* Estilos específicos para conditional_field_condicional */
|
|
743
|
+
.conditional-field-condicional-group {
|
|
744
|
+
position: relative;
|
|
745
|
+
margin-bottom: 1.5rem;
|
|
892
746
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
.conditional-condicional-fields.show {
|
|
896
|
-
animation: slideInDown 0.3s ease-out;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
/* Indicador visual para campos condicionais ativos */
|
|
900
|
-
.conditional-condicional-fields::before {
|
|
901
|
-
content: '';
|
|
902
|
-
position: absolute;
|
|
903
|
-
left: -4px;
|
|
904
|
-
top: 0;
|
|
905
|
-
bottom: 0;
|
|
906
|
-
width: 4px;
|
|
907
|
-
background: linear-gradient(to bottom, var(--primary-color, #2A5E2C), #4CAF50);
|
|
908
|
-
border-radius: 0 2px 2px 0;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
/* Responsivo */
|
|
912
|
-
@media (max-width: 768px) {
|
|
747
|
+
|
|
913
748
|
.conditional-condicional-fields {
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
749
|
+
border-left: 4px solid var(--primary-color, #2A5E2C);
|
|
750
|
+
background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
|
|
751
|
+
transition: all 0.3s ease;
|
|
752
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
|
753
|
+
border-radius: 8px;
|
|
754
|
+
overflow: hidden;
|
|
917
755
|
}
|
|
918
|
-
|
|
756
|
+
|
|
757
|
+
.conditional-condicional-fields:hover {
|
|
758
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
759
|
+
}
|
|
760
|
+
|
|
919
761
|
.conditional-fields-header {
|
|
920
|
-
margin:
|
|
921
|
-
padding: 0.
|
|
762
|
+
margin-bottom: 1rem;
|
|
763
|
+
padding-bottom: 0.5rem;
|
|
764
|
+
border-bottom: 1px solid #dee2e6;
|
|
765
|
+
background: rgba(42, 94, 44, 0.05);
|
|
766
|
+
margin: -1rem -1rem 1rem -1rem;
|
|
767
|
+
padding: 0.75rem 1rem;
|
|
922
768
|
}
|
|
923
|
-
|
|
769
|
+
|
|
924
770
|
.conditional-fields-header .text-muted {
|
|
925
|
-
|
|
771
|
+
color: var(--primary-color, #2A5E2C) !important;
|
|
772
|
+
font-weight: 600;
|
|
773
|
+
font-size: 0.9rem;
|
|
926
774
|
}
|
|
927
|
-
}
|
|
928
775
|
|
|
929
|
-
|
|
930
|
-
.conditional-condicional-fields {
|
|
931
|
-
|
|
932
|
-
border-left-width: 2px;
|
|
776
|
+
/* Melhorar a aparência dos campos aninhados */
|
|
777
|
+
.conditional-condicional-fields .form-group {
|
|
778
|
+
margin-bottom: 1.25rem;
|
|
933
779
|
}
|
|
934
|
-
|
|
935
|
-
.conditional-fields-
|
|
936
|
-
margin:
|
|
937
|
-
|
|
780
|
+
|
|
781
|
+
.conditional-condicional-fields .form-group:last-child {
|
|
782
|
+
margin-bottom: 0;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.conditional-condicional-fields .form-control {
|
|
786
|
+
border-color: #d1d9e0;
|
|
787
|
+
background: white;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
.conditional-condicional-fields .form-control:focus {
|
|
791
|
+
border-color: var(--primary-color, #2A5E2C);
|
|
792
|
+
box-shadow: 0 0 0 2px rgba(42, 94, 44, 0.1);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/* Animações */
|
|
796
|
+
@keyframes slideInDown {
|
|
797
|
+
from {
|
|
798
|
+
opacity: 0;
|
|
799
|
+
transform: translateY(-15px);
|
|
800
|
+
}
|
|
801
|
+
to {
|
|
802
|
+
opacity: 1;
|
|
803
|
+
transform: translateY(0);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.conditional-condicional-fields.show {
|
|
808
|
+
animation: slideInDown 0.3s ease-out;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/* Indicador visual para campos condicionais ativos */
|
|
812
|
+
.conditional-condicional-fields::before {
|
|
813
|
+
content: '';
|
|
814
|
+
position: absolute;
|
|
815
|
+
left: -4px;
|
|
816
|
+
top: 0;
|
|
817
|
+
bottom: 0;
|
|
818
|
+
width: 4px;
|
|
819
|
+
background: linear-gradient(to bottom, var(--primary-color, #2A5E2C), #4CAF50);
|
|
820
|
+
border-radius: 0 2px 2px 0;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/* Responsivo */
|
|
824
|
+
@media (max-width: 768px) {
|
|
825
|
+
.conditional-condicional-fields {
|
|
826
|
+
padding: 0.75rem;
|
|
827
|
+
margin-top: 0.75rem;
|
|
828
|
+
border-left-width: 3px;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.conditional-fields-header {
|
|
832
|
+
margin: -0.75rem -0.75rem 0.75rem -0.75rem;
|
|
833
|
+
padding: 0.6rem 0.75rem;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
.conditional-fields-header .text-muted {
|
|
837
|
+
font-size: 0.85rem;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
@media (max-width: 480px) {
|
|
842
|
+
.conditional-condicional-fields {
|
|
843
|
+
padding: 0.6rem;
|
|
844
|
+
border-left-width: 2px;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
.conditional-fields-header {
|
|
848
|
+
margin: -0.6rem -0.6rem 0.6rem -0.6rem;
|
|
849
|
+
padding: 0.5rem 0.6rem;
|
|
850
|
+
}
|
|
938
851
|
}
|
|
939
|
-
}
|
|
940
852
|
</style>
|
|
941
853
|
|
|
942
854
|
|
|
@@ -1639,253 +1551,6 @@
|
|
|
1639
1551
|
});
|
|
1640
1552
|
|
|
1641
1553
|
|
|
1642
|
-
// ADICIONE ESTE CÓDIGO AO FINAL DO SEU <script> NO form_field.html
|
|
1643
|
-
|
|
1644
|
-
// ========================================
|
|
1645
|
-
// SISTEMA MULTI-REDIRECIONAMENTO
|
|
1646
|
-
// ========================================
|
|
1647
|
-
|
|
1648
|
-
// Variáveis de controle
|
|
1649
|
-
let multiRedirectFields = new Map();
|
|
1650
|
-
let pendingActions = new Map();
|
|
1651
|
-
|
|
1652
|
-
// INICIALIZAÇÃO DOS CAMPOS MULTI-REDIRECT
|
|
1653
|
-
function initializeMultiRedirectFields() {
|
|
1654
|
-
console.log('🔀 Inicializando multi-redirecionamento...');
|
|
1655
|
-
|
|
1656
|
-
const groups = document.querySelectorAll('.checkbox-multi-redirect-group');
|
|
1657
|
-
console.log(`🔍 Encontrados ${groups.length} grupos multi-redirect`);
|
|
1658
|
-
|
|
1659
|
-
groups.forEach(group => {
|
|
1660
|
-
try {
|
|
1661
|
-
const configData = group.getAttribute('data-field-config');
|
|
1662
|
-
if (!configData) {
|
|
1663
|
-
console.log('⚠️ Configuração não encontrada para grupo:', group);
|
|
1664
|
-
return;
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
|
-
const config = JSON.parse(configData);
|
|
1668
|
-
multiRedirectFields.set(config.fieldId, config);
|
|
1669
|
-
|
|
1670
|
-
const inputs = group.querySelectorAll('.multi-redirect-input');
|
|
1671
|
-
inputs.forEach(input => {
|
|
1672
|
-
input.addEventListener('change', function() {
|
|
1673
|
-
handleMultiRedirectChange(config, this);
|
|
1674
|
-
});
|
|
1675
|
-
});
|
|
1676
|
-
|
|
1677
|
-
console.log(`✅ Campo configurado: ${config.fieldId} (${config.fieldType})`);
|
|
1678
|
-
|
|
1679
|
-
} catch (error) {
|
|
1680
|
-
console.error('❌ Erro configuração multi-redirect:', error, group);
|
|
1681
|
-
}
|
|
1682
|
-
});
|
|
1683
|
-
|
|
1684
|
-
console.log(`🔀 ${multiRedirectFields.size} campos multi-redirect ativos`);
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
// GERENCIAR MUDANÇA NO CAMPO
|
|
1688
|
-
function handleMultiRedirectChange(config, input) {
|
|
1689
|
-
const value = input.value;
|
|
1690
|
-
const isSelected = input.checked || (input.tagName === 'SELECT' && value);
|
|
1691
|
-
|
|
1692
|
-
console.log(`🎯 Campo ${config.fieldId}: valor="${value}", selecionado=${isSelected}`);
|
|
1693
|
-
|
|
1694
|
-
// Para radio e select, sempre processar se tem valor
|
|
1695
|
-
// Para checkbox, só processar se estiver marcado
|
|
1696
|
-
const shouldProcess = (config.fieldType === 'checkbox') ? input.checked : Boolean(value);
|
|
1697
|
-
|
|
1698
|
-
if (!shouldProcess) {
|
|
1699
|
-
hideAllMessages(config.fieldId);
|
|
1700
|
-
hideAllConditionalFields(config.fieldId);
|
|
1701
|
-
return;
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
const option = config.options.find(opt => opt.value === value);
|
|
1705
|
-
if (!option) {
|
|
1706
|
-
console.log(`⚠️ Opção não encontrada para valor: ${value}`);
|
|
1707
|
-
return;
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
console.log(`🚀 Executando ação: ${option.action} para "${option.value}"`);
|
|
1711
|
-
|
|
1712
|
-
// Limpar ações/mensagens anteriores
|
|
1713
|
-
clearPreviousActions(config.fieldId);
|
|
1714
|
-
|
|
1715
|
-
// Mostrar mensagem se configurada
|
|
1716
|
-
if (option.message) {
|
|
1717
|
-
showMultiRedirectMessage(config.fieldId, option);
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
// Processar ação
|
|
1721
|
-
const delay = (option.delay || 1) * 1000;
|
|
1722
|
-
|
|
1723
|
-
switch (option.action) {
|
|
1724
|
-
case 'continue':
|
|
1725
|
-
console.log('➡️ Continuando normalmente');
|
|
1726
|
-
break;
|
|
1727
|
-
|
|
1728
|
-
case 'next_step':
|
|
1729
|
-
console.log('⏩ Programando próxima etapa');
|
|
1730
|
-
setTimeout(() => {
|
|
1731
|
-
if (typeof nextStep === 'function') {
|
|
1732
|
-
nextStep();
|
|
1733
|
-
} else {
|
|
1734
|
-
console.log('⚠️ Função nextStep não encontrada');
|
|
1735
|
-
}
|
|
1736
|
-
}, delay);
|
|
1737
|
-
break;
|
|
1738
|
-
|
|
1739
|
-
case 'specific_section':
|
|
1740
|
-
if (option.targetSection) {
|
|
1741
|
-
console.log(`🎯 Programando redirecionamento para: ${option.targetSection}`);
|
|
1742
|
-
setTimeout(() => {
|
|
1743
|
-
if (typeof redirectToSpecificSection === 'function') {
|
|
1744
|
-
redirectToSpecificSection(option.targetSection);
|
|
1745
|
-
} else {
|
|
1746
|
-
console.log('⚠️ Função redirectToSpecificSection não encontrada');
|
|
1747
|
-
}
|
|
1748
|
-
}, delay);
|
|
1749
|
-
}
|
|
1750
|
-
break;
|
|
1751
|
-
|
|
1752
|
-
case 'skip_to_end':
|
|
1753
|
-
console.log('⏭️ Programando finalização');
|
|
1754
|
-
setTimeout(() => {
|
|
1755
|
-
skipToFinalStep();
|
|
1756
|
-
}, delay);
|
|
1757
|
-
break;
|
|
1758
|
-
|
|
1759
|
-
case 'show_fields':
|
|
1760
|
-
console.log(`👁️ Mostrando campos condicionais para: ${value}`);
|
|
1761
|
-
showConditionalFields(config.fieldId, value);
|
|
1762
|
-
break;
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
// MOSTRAR MENSAGEM DE REDIRECIONAMENTO
|
|
1767
|
-
function showMultiRedirectMessage(fieldId, option) {
|
|
1768
|
-
const blockId = fieldId.split('_').pop();
|
|
1769
|
-
const optionIndex = multiRedirectFields.get(fieldId).options.findIndex(opt => opt.value === option.value);
|
|
1770
|
-
const messageEl = document.getElementById(`redirect_message_${blockId}_${optionIndex}`);
|
|
1771
|
-
|
|
1772
|
-
if (messageEl) {
|
|
1773
|
-
messageEl.style.display = 'block';
|
|
1774
|
-
console.log(`💬 Mensagem mostrada para opção: ${option.value}`);
|
|
1775
|
-
|
|
1776
|
-
setTimeout(() => {
|
|
1777
|
-
messageEl.scrollIntoView({
|
|
1778
|
-
behavior: 'smooth',
|
|
1779
|
-
block: 'center'
|
|
1780
|
-
});
|
|
1781
|
-
}, 100);
|
|
1782
|
-
}
|
|
1783
|
-
}
|
|
1784
|
-
|
|
1785
|
-
// MOSTRAR CAMPOS CONDICIONAIS
|
|
1786
|
-
function showConditionalFields(fieldId, value) {
|
|
1787
|
-
// Primeiro esconder todos os campos condicionais deste campo
|
|
1788
|
-
hideAllConditionalFields(fieldId);
|
|
1789
|
-
|
|
1790
|
-
// Mostrar apenas o campo correspondente ao valor selecionado
|
|
1791
|
-
const conditionalField = document.querySelector(
|
|
1792
|
-
`[data-parent-field="${fieldId}"][data-option-value="${value}"]`
|
|
1793
|
-
);
|
|
1794
|
-
|
|
1795
|
-
if (conditionalField) {
|
|
1796
|
-
conditionalField.style.display = 'block';
|
|
1797
|
-
console.log(`👁️ Campos condicionais mostrados para: ${value}`);
|
|
1798
|
-
|
|
1799
|
-
setTimeout(() => {
|
|
1800
|
-
conditionalField.scrollIntoView({
|
|
1801
|
-
behavior: 'smooth',
|
|
1802
|
-
block: 'center'
|
|
1803
|
-
});
|
|
1804
|
-
}, 200);
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
// OCULTAR TODAS AS MENSAGENS
|
|
1809
|
-
function hideAllMessages(fieldId) {
|
|
1810
|
-
const blockId = fieldId.split('_').pop();
|
|
1811
|
-
const messages = document.querySelectorAll(`[id^="redirect_message_${blockId}_"]`);
|
|
1812
|
-
|
|
1813
|
-
messages.forEach(message => {
|
|
1814
|
-
message.style.display = 'none';
|
|
1815
|
-
});
|
|
1816
|
-
}
|
|
1817
|
-
|
|
1818
|
-
// OCULTAR TODOS OS CAMPOS CONDICIONAIS
|
|
1819
|
-
function hideAllConditionalFields(fieldId) {
|
|
1820
|
-
const conditionalFields = document.querySelectorAll(`[data-parent-field="${fieldId}"]`);
|
|
1821
|
-
|
|
1822
|
-
conditionalFields.forEach(field => {
|
|
1823
|
-
field.style.display = 'none';
|
|
1824
|
-
});
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
// LIMPAR AÇÕES ANTERIORES
|
|
1828
|
-
function clearPreviousActions(fieldId) {
|
|
1829
|
-
pendingActions.delete(fieldId);
|
|
1830
|
-
hideAllMessages(fieldId);
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
// PULAR PARA ETAPA FINAL
|
|
1834
|
-
function skipToFinalStep() {
|
|
1835
|
-
console.log(`⏭️ Executando pulo para final`);
|
|
1836
|
-
|
|
1837
|
-
// Adicionar campo hidden indicando redirecionamento
|
|
1838
|
-
const form = document.getElementById('wagtailForm');
|
|
1839
|
-
if (form) {
|
|
1840
|
-
let skipField = form.querySelector('input[name="form_redirected"]');
|
|
1841
|
-
if (!skipField) {
|
|
1842
|
-
skipField = document.createElement('input');
|
|
1843
|
-
skipField.type = 'hidden';
|
|
1844
|
-
skipField.name = 'form_redirected';
|
|
1845
|
-
form.appendChild(skipField);
|
|
1846
|
-
}
|
|
1847
|
-
skipField.value = 'true';
|
|
1848
|
-
|
|
1849
|
-
console.log('📨 Submetendo formulário...');
|
|
1850
|
-
form.submit();
|
|
1851
|
-
} else {
|
|
1852
|
-
console.log('⚠️ Formulário não encontrado');
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
|
|
1856
|
-
// FUNÇÃO PARA REDIRECIONAR PARA SEÇÃO ESPECÍFICA (caso não exista)
|
|
1857
|
-
if (typeof redirectToSpecificSection === 'undefined') {
|
|
1858
|
-
function redirectToSpecificSection(sectionTitle) {
|
|
1859
|
-
console.log(`🎯 Procurando seção: "${sectionTitle}"`);
|
|
1860
|
-
|
|
1861
|
-
// Procurar divisores com título correspondente
|
|
1862
|
-
const dividers = document.querySelectorAll('.divider-title');
|
|
1863
|
-
|
|
1864
|
-
for (const divider of dividers) {
|
|
1865
|
-
const dividerTitle = divider.textContent?.trim() || '';
|
|
1866
|
-
|
|
1867
|
-
if (dividerTitle.toLowerCase().includes(sectionTitle.toLowerCase()) ||
|
|
1868
|
-
sectionTitle.toLowerCase().includes(dividerTitle.toLowerCase())) {
|
|
1869
|
-
|
|
1870
|
-
console.log(`✅ Seção encontrada: "${dividerTitle}"`);
|
|
1871
|
-
|
|
1872
|
-
// Scroll para o divisor
|
|
1873
|
-
setTimeout(() => {
|
|
1874
|
-
divider.scrollIntoView({
|
|
1875
|
-
behavior: 'smooth',
|
|
1876
|
-
block: 'center'
|
|
1877
|
-
});
|
|
1878
|
-
}, 100);
|
|
1879
|
-
|
|
1880
|
-
return true;
|
|
1881
|
-
}
|
|
1882
|
-
}
|
|
1883
|
-
|
|
1884
|
-
console.log(`❌ Seção "${sectionTitle}" não encontrada`);
|
|
1885
|
-
return false;
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
1554
|
// INICIALIZAÇÃO QUANDO DOM CARREGAR
|
|
1890
1555
|
document.addEventListener('DOMContentLoaded', function() {
|
|
1891
1556
|
// Aguardar um pouco para garantir que tudo carregou
|
|
@@ -11,7 +11,7 @@ enap_designsystem/blocks/__init__.py,sha256=6JW1ybuSfTucg-xZnomIcuVJIIo_1wGWgsaB
|
|
|
11
11
|
enap_designsystem/blocks/base_blocks.py,sha256=ZuqVWn4PEAvD3pKM1ST7wjo4lwv98ooen_rs15rRJbg,10866
|
|
12
12
|
enap_designsystem/blocks/chatbot_blocks.py,sha256=YeCznrXMbFa9MP9vjdTYl53ZhKsywkGOXvFK2bwcqW0,1133
|
|
13
13
|
enap_designsystem/blocks/content_blocks.py,sha256=4oWDtY0zmvC6k7v_WduCTAyGapJuQTsfJ9ij_vJZXxY,16549
|
|
14
|
-
enap_designsystem/blocks/form.py,sha256=
|
|
14
|
+
enap_designsystem/blocks/form.py,sha256=8ilckMSE1qxbqted4ukHAw0y5vWQgsCP1gIkwOql1GQ,79078
|
|
15
15
|
enap_designsystem/blocks/html_blocks.py,sha256=yFx6QkivBuGadBPPKFDWRZegDY_xHs38mK8_jNxEi3s,244509
|
|
16
16
|
enap_designsystem/blocks/layout_blocks.py,sha256=WyVt3nwYxA4Eqr6-MqQY7W-xtjh07ZhstM8aiQaHmLw,23388
|
|
17
17
|
enap_designsystem/blocks/semana_blocks.py,sha256=tJ8bFvW6lTSnLp2Wf1CARNSM4UoGl95lvYmxik5g0GA,70251
|
|
@@ -441,6 +441,11 @@ enap_designsystem/migrations/0402_alter_areaaluno_body_alter_enapcomponentes_bod
|
|
|
441
441
|
enap_designsystem/migrations/0403_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py,sha256=2NbUuYbN9bWNUQxFg412sWdVcBNftK-xTvI1E7V9BHo,2371706
|
|
442
442
|
enap_designsystem/migrations/0404_sistemavotacaopage_conteudo_pagina.py,sha256=aJ5k6TvGifHJ6n91XOXXJHRv0Rn4KH7QTof8o20d63g,11760
|
|
443
443
|
enap_designsystem/migrations/0405_sistemavotacaopage_exigir_recaptcha_and_more.py,sha256=swN3J6coMFvtQpH_pWoFibTM248DA4HYWaRjUR2F9sA,1434
|
|
444
|
+
enap_designsystem/migrations/0406_alter_areaaluno_body_alter_cursoeadpage_curso_and_more.py,sha256=mmotdXGSgsLSrB64FAK2sSU9oly6bCawXXbt-22vv0g,2466659
|
|
445
|
+
enap_designsystem/migrations/0407_alter_formulariopage_form_steps.py,sha256=Q4ImPu0xy3Qt2xlmNWPw0aPYjXsVc4RzHw6_CgU24po,53778
|
|
446
|
+
enap_designsystem/migrations/0408_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py,sha256=GzutOLxStj6CeS6h1j525-OytmuTLvRV_Y4yjATPgjQ,2420951
|
|
447
|
+
enap_designsystem/migrations/0409_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py,sha256=kdD6gvDpWGClTnoIJAb2ELF0ktsL1EZf2OJMgxYTlhA,2425164
|
|
448
|
+
enap_designsystem/migrations/0410_alter_formulariopage_form_steps.py,sha256=VphZlDbOYAIaw9dLRi1_9mVhdLz2v7x-dZA2SvCNUhA,53854
|
|
444
449
|
enap_designsystem/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
445
450
|
enap_designsystem/search_backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
446
451
|
enap_designsystem/search_backends/custom_elasticsearch.py,sha256=LeQT0_dJmNMTY7l3jOJ_7mJ9-2X0oXVqvxRiXEA0qGY,988
|
|
@@ -752,7 +757,7 @@ enap_designsystem/templates/enap_designsystem/blocks/suap/apisuap_courses_block.
|
|
|
752
757
|
enap_designsystem/templates/enap_designsystem/blocks/suap/suap_courses_block.html,sha256=Jquna6TGWll4-XtRgHFE9tO_kPx8VBLvkXjeVgyJNwA,15838
|
|
753
758
|
enap_designsystem/templates/enap_designsystem/blocks/suap/suap_events_block.html,sha256=mL2DFQeAuDIx_GyCoEURKmME-Mmd-zQ_NZkO7YW9Z2k,20182
|
|
754
759
|
enap_designsystem/templates/enap_designsystem/form_templates/form_report.html,sha256=WXf4HgNQY0M6zZ-tERqf01mHbGflqWXT96RaJYjCxFA,16081
|
|
755
|
-
enap_designsystem/templates/enap_designsystem/form_templates/formulario_page.html,sha256=
|
|
760
|
+
enap_designsystem/templates/enap_designsystem/form_templates/formulario_page.html,sha256=_iPMlRiq4LvOgtqcpM8r0zPkIlcC-VlW6IdVlMBS8Rs,82915
|
|
756
761
|
enap_designsystem/templates/enap_designsystem/form_templates/formulario_page_landing.html,sha256=YsxUFe2U7aQHY8Xb_WeCjwQZWJOpLVlhS8Q3HpCMNug,7670
|
|
757
762
|
enap_designsystem/templates/enap_designsystem/form_templates/formulario_page_success.html,sha256=c4w6PvTR5_g8P5wCxs_Xu235JyHRgLNtM0eD33XcVTI,9435
|
|
758
763
|
enap_designsystem/templates/enap_designsystem/form_templates/home_page.html,sha256=BYV5TV6xp0uY3SWtNsAf8p-aDqPiHfM8j4pWbqTUV2M,42329
|
|
@@ -761,7 +766,7 @@ enap_designsystem/templates/enap_designsystem/form_templates/welcome_page.html,s
|
|
|
761
766
|
enap_designsystem/templates/enap_designsystem/includes/chatbot_global.html,sha256=CO7wXrGx1l_icY8vb9OdrILCUXEFBomJPPxQz_e9hq4,12308
|
|
762
767
|
enap_designsystem/templates/enap_designsystem/includes/cookie_banner.html,sha256=vyrvj1W_haSA4oKmQiyjFpjoTFqjPSZfz3u5nfr-P2g,10871
|
|
763
768
|
enap_designsystem/templates/enap_designsystem/includes/footer.html,sha256=qsDmN413A_NNOhRFZz1Uxym1j5UPVhEDuRRDLTgRMPA,4063
|
|
764
|
-
enap_designsystem/templates/enap_designsystem/includes/form_field.html,sha256=
|
|
769
|
+
enap_designsystem/templates/enap_designsystem/includes/form_field.html,sha256=EVXvu_Z6tQ-4BNaQ2wH4mysu0SR2XqLZdTi6xAr9Lrc,68717
|
|
765
770
|
enap_designsystem/templates/enap_designsystem/pages/404.html,sha256=yibkQlRTOZdyOVsDcNdqXjzmQwVq3QH5ztf0gNtbt58,2885
|
|
766
771
|
enap_designsystem/templates/enap_designsystem/pages/area_aluno.html,sha256=lpHBVsnuZ0kARnH10xfFBPldABAvLGNMnVuvPACP3FU,15783
|
|
767
772
|
enap_designsystem/templates/enap_designsystem/pages/article_index_page.html,sha256=6VjJ3_EroEPCidFCW5gBDzvbi81UcFX9lGpbc4j6r9U,11482
|
|
@@ -847,8 +852,8 @@ enap_designsystem/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
847
852
|
enap_designsystem/utils/decorators.py,sha256=aq6SbLn0LcH2rfE3ZFit8jkD7pSx9fLVBUUwVB747hg,335
|
|
848
853
|
enap_designsystem/utils/services.py,sha256=6dG5jLSbwH49jpZV9ZNpWlaZqI49gTlwlr1vaerxdiU,5824
|
|
849
854
|
enap_designsystem/utils/sso.py,sha256=vjAuoYgoLeQAa_dkkyQ6-LmHvKMaVCxizNFpe5y3iUA,1145
|
|
850
|
-
wagtail_enap_designsystem-1.2.1.
|
|
851
|
-
wagtail_enap_designsystem-1.2.1.
|
|
852
|
-
wagtail_enap_designsystem-1.2.1.
|
|
853
|
-
wagtail_enap_designsystem-1.2.1.
|
|
854
|
-
wagtail_enap_designsystem-1.2.1.
|
|
855
|
+
wagtail_enap_designsystem-1.2.1.132.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
|
|
856
|
+
wagtail_enap_designsystem-1.2.1.132.dist-info/METADATA,sha256=w11WnILANp_7vZLQbDAwGa5x84Lwz5_qugU5-OcmOgA,3651
|
|
857
|
+
wagtail_enap_designsystem-1.2.1.132.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
858
|
+
wagtail_enap_designsystem-1.2.1.132.dist-info/top_level.txt,sha256=RSFgMASxoA-hVftm5i4Qd0rArlX4Dq08lLv5G4sYD-g,18
|
|
859
|
+
wagtail_enap_designsystem-1.2.1.132.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|