wagtail-enap-designsystem 1.2.1.138__py3-none-any.whl → 1.2.1.140__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.
@@ -1003,6 +1003,7 @@
1003
1003
  /* Descrição mobile - escondida no desktop */
1004
1004
  .step-descricao-mobile {
1005
1005
  display: none;
1006
+ white-space: pre-line;
1006
1007
  }
1007
1008
 
1008
1009
  /* Container das descrições - Desktop */
@@ -1028,6 +1029,7 @@
1028
1029
  text-align: center;
1029
1030
  max-width: 200px;
1030
1031
  color: #333;
1032
+ white-space: pre-line;
1031
1033
  }
1032
1034
 
1033
1035
  /* ===== TABLET ===== */
@@ -6,7 +6,7 @@
6
6
  {% if value.background_image_fundo_bg %}
7
7
  style="background-image: url('{{ value.background_image_fundo_bg.url }}'); background-size: cover; background-position: center; background-repeat: no-repeat;"
8
8
  {% else %}
9
- style="background: linear-gradient(135deg, #6A1B9A 0%, #4A148C 50%, #2E1065 100%);"
9
+ style="background: {{ value.cor_fundo }};"
10
10
  {% endif %}>
11
11
 
12
12
  <!-- Overlay para garantir legibilidade -->
@@ -1930,6 +1930,158 @@ function getFileIcon(filename) {
1930
1930
  };
1931
1931
  return icons[ext] || '📎';
1932
1932
  }
1933
+
1934
+
1935
+
1936
+
1937
+ // PROTEÇÃO CONTRA CARACTERES ESPECIAIS E COMANDOS SQL
1938
+ (function initEnhancedSecurity() {
1939
+ console.log('🛡️ Inicializando proteção avançada...');
1940
+
1941
+ // Comandos SQL que devem ser bloqueados
1942
+ const sqlCommands = ['SELECT', 'INSERT', 'UPDATE', 'DELETE', 'DROP', 'CREATE'];
1943
+
1944
+ function containsSqlCommands(text) {
1945
+ if (!text || typeof text !== 'string') return false;
1946
+
1947
+ const upperText = text.toUpperCase();
1948
+
1949
+ for (let command of sqlCommands) {
1950
+ // Verificar comando como palavra completa
1951
+ const regex = new RegExp('\\b' + command + '\\b');
1952
+ if (regex.test(upperText)) {
1953
+ return { found: true, command: command };
1954
+ }
1955
+ }
1956
+
1957
+ return { found: false };
1958
+ }
1959
+
1960
+ function cleanInput(input, originalValue) {
1961
+ let cleanValue = originalValue;
1962
+
1963
+ // 1. Primeiro remover caracteres especiais
1964
+ const fieldName = (input.name || input.id || '').toLowerCase();
1965
+ const isEmailField = fieldName.includes('email') || input.type === 'email';
1966
+
1967
+ if (isEmailField) {
1968
+ cleanValue = originalValue.replace(/[^a-zA-Z0-9@.\-_]/g, '');
1969
+ } else {
1970
+ cleanValue = originalValue.replace(/[^a-zA-Z0-9À-ÿ\s.\-]/g, '');
1971
+ }
1972
+
1973
+ // 2. Depois verificar comandos SQL
1974
+ const sqlCheck = containsSqlCommands(cleanValue);
1975
+ if (sqlCheck.found) {
1976
+ // Remover a palavra SQL encontrada
1977
+ const regex = new RegExp('\\b' + sqlCheck.command + '\\b', 'gi');
1978
+ cleanValue = cleanValue.replace(regex, '');
1979
+
1980
+ console.warn(`🚨 Comando SQL removido: ${sqlCheck.command}`);
1981
+ }
1982
+
1983
+ return cleanValue;
1984
+ }
1985
+
1986
+ function showSecurityFeedback(input, type = 'chars') {
1987
+ if (type === 'sql') {
1988
+ input.style.backgroundColor = '#ffe6e6';
1989
+ input.style.borderColor = '#dc3545';
1990
+ input.title = 'Comando SQL detectado e removido';
1991
+ } else {
1992
+ input.style.backgroundColor = '#fff3cd';
1993
+ input.style.borderColor = '#ffc107';
1994
+ input.title = 'Caracteres especiais removidos';
1995
+ }
1996
+
1997
+ setTimeout(() => {
1998
+ input.style.backgroundColor = '';
1999
+ input.style.borderColor = '';
2000
+ input.title = '';
2001
+ }, 3000);
2002
+ }
2003
+
2004
+ // Event listener principal
2005
+ document.addEventListener('input', function(e) {
2006
+ const input = e.target;
2007
+
2008
+ const isProtectedField = (
2009
+ input.matches('input[type="text"], input[type="email"], textarea') &&
2010
+ !input.matches('input[type="hidden"], input[readonly]')
2011
+ );
2012
+
2013
+ if (!isProtectedField) return;
2014
+
2015
+ const originalValue = input.value;
2016
+
2017
+ // Verificar comandos SQL antes da limpeza
2018
+ const hadSqlCommand = containsSqlCommands(originalValue).found;
2019
+
2020
+ const cleanValue = cleanInput(input, originalValue);
2021
+
2022
+ if (originalValue !== cleanValue) {
2023
+ input.value = cleanValue;
2024
+
2025
+ // Feedback baseado no tipo de problema
2026
+ const feedbackType = hadSqlCommand ? 'sql' : 'chars';
2027
+ showSecurityFeedback(input, feedbackType);
2028
+
2029
+ console.log('🔒 Conteúdo limpo:', {
2030
+ campo: input.name || input.id,
2031
+ original: originalValue,
2032
+ limpo: cleanValue,
2033
+ tipo: feedbackType
2034
+ });
2035
+ }
2036
+ }, true);
2037
+
2038
+ // Proteção no submit
2039
+ document.addEventListener('submit', function(e) {
2040
+ const form = e.target;
2041
+ if (form.id !== 'wagtailForm') return;
2042
+
2043
+ console.log('🔍 Verificação final de segurança...');
2044
+
2045
+ const textInputs = form.querySelectorAll('input[type="text"], input[type="email"], textarea');
2046
+ let hasProhibited = false;
2047
+
2048
+ textInputs.forEach(input => {
2049
+ const value = input.value.trim();
2050
+ if (!value) return;
2051
+
2052
+ // Verificar caracteres proibidos
2053
+ const prohibitedChars = /['";\\<>]/;
2054
+ const sqlCheck = containsSqlCommands(value);
2055
+
2056
+ if (prohibitedChars.test(value) || sqlCheck.found) {
2057
+ console.warn('⚠️ Conteúdo proibido:', {
2058
+ campo: input.name,
2059
+ valor: value,
2060
+ sql: sqlCheck.found ? sqlCheck.command : 'não',
2061
+ caracteres: prohibitedChars.test(value)
2062
+ });
2063
+
2064
+ hasProhibited = true;
2065
+ input.style.borderColor = 'red';
2066
+ input.style.backgroundColor = '#ffe6e6';
2067
+
2068
+ if (!hasProhibited) {
2069
+ input.focus();
2070
+ input.scrollIntoView({ behavior: 'smooth', block: 'center' });
2071
+ }
2072
+ }
2073
+ });
2074
+
2075
+ if (hasProhibited) {
2076
+ e.preventDefault();
2077
+ alert('Formulário contém dados não permitidos. Verifique os campos destacados.');
2078
+ return false;
2079
+ }
2080
+ });
2081
+
2082
+ console.log('✅ Proteção avançada ativada');
2083
+ })();
2084
+
1933
2085
  </script>
1934
2086
 
1935
2087
 
@@ -263,19 +263,19 @@
263
263
  </div>
264
264
 
265
265
  <!-- Botões de ação no final da sidebar -->
266
- <div style="margin-top: 20px; padding: 0 20px; display: flex; flex-direction: column; gap: 10px;">
267
- <!-- Botão Aplicar -->
268
- <button type="submit" class="filtro-aplicar" onclick="submitForm()">
269
- <span class="material-icons">filter_alt</span>
270
- Aplicar Filtros <span id="contador-filtros"></span>
271
- </button>
272
-
273
- <!-- Botão Limpar -->
274
- <button type="button" class="filtro-limpar" id="limpar-filtros" onclick="limparFiltros()" style="display: none;">
275
- <span class="material-icons">filter_alt_off</span>
276
- Limpar Filtros
277
- </button>
278
- </div>
266
+ <div style="margin-top: 20px; padding: 0 20px; display: flex; flex-direction: column; gap: 10px;">
267
+ <!-- Botão Aplicar -->
268
+ <button type="submit" class="filtro-aplicar" onclick="submitForm()">
269
+ <span class="material-icons">filter_alt</span>
270
+ Aplicar Filtros <span id="contador-filtros"></span>
271
+ </button>
272
+
273
+ <!-- Botão Limpar -->
274
+ <button type="button" class="filtro-limpar" id="limpar-filtros" onclick="limparFiltros()" style="display: none;">
275
+ <span class="material-icons">filter_alt_off</span>
276
+ Limpar Filtros
277
+ </button>
278
+ </div>
279
279
  </div>
280
280
 
281
281
  <!-- Cards -->
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wagtail-enap-designsystem
3
- Version: 1.2.1.138
3
+ Version: 1.2.1.140
4
4
  Summary: Módulo de componentes utilizado nos portais ENAP, desenvolvido com Wagtail + CodeRedCMS
5
5
  Author: Renan Campos
6
6
  Author-email: renan.oliveira@enap.gov.br
@@ -11,13 +11,15 @@ enap_designsystem/blocks/__init__.py,sha256=uqscsM_LrnSs_WEJqzwAThHQb4SSp2ncm__Y
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=PmbeQQ76IlaGdz-jngepy4ubC9sSaHKwDmPqoaHltWw,85744
15
- enap_designsystem/blocks/html_blocks.py,sha256=5LE5TFRuQvEf2xcl60D0WJeVq8fnuLT0F2hMWzMDUTI,245293
14
+ enap_designsystem/blocks/form.py,sha256=TnoRExEukCBRqSug_NmA-b4oKBdRQsWOsbuzKANCqTc,88947
15
+ enap_designsystem/blocks/html_blocks.py,sha256=1iJ80P13eEDpQwUVNTCXQevL5Xim7PZ1Xkqe44u5MvI,245503
16
16
  enap_designsystem/blocks/layout_blocks.py,sha256=WyVt3nwYxA4Eqr6-MqQY7W-xtjh07ZhstM8aiQaHmLw,23388
17
+ enap_designsystem/blocks/security.py,sha256=QA7lmQ_eQ6iopunatl_DrHkEegAwMZJGwXunRulbCjk,2099
17
18
  enap_designsystem/blocks/semana_blocks.py,sha256=j5JDdC1eKb91gU7y-hLvcx5feI1OvcbVh3Imbs5R6jM,70445
18
19
  enap_designsystem/blocks/semana_inovacao.py,sha256=ZKjXzvs_RbLzv3nxsnmVxcAWORlpFIr9C7_aMb8rZRs,47037
19
20
  enap_designsystem/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
21
  enap_designsystem/middleware/aluno_sso.py,sha256=baitPngI34eKwHKaku-5JIbDAnXpEHPvRFTs9AY1K6o,542
22
+ enap_designsystem/middleware/filtro_inputs.py,sha256=EE7dKKmqUzjiy79Vni54ntjC2JeN61j_vaZvKbWYoBs,4286
21
23
  enap_designsystem/middleware/wagtail_userbar_safe.py,sha256=5A_bmUqL7DtVb2LNs9yyo9BZ4lasQTVVY8fOYnwU8ZI,633
22
24
  enap_designsystem/migrations/0001_initial.py,sha256=GmnE8N8hBKLlCNabhOjpzhNMSoHsPqy-ZUsojyCvKO0,154972
23
25
  enap_designsystem/migrations/0002_alter_enapformacao_accordion_cursos.py,sha256=3oOLLXyNNRTdM6SJ46W6s8mhCftkd0v1fOJiXeyiTdI,7137
@@ -447,6 +449,7 @@ enap_designsystem/migrations/0408_alter_areaaluno_body_alter_enapcomponentes_bod
447
449
  enap_designsystem/migrations/0409_alter_areaaluno_body_alter_enapcomponentes_body_and_more.py,sha256=kdD6gvDpWGClTnoIJAb2ELF0ktsL1EZf2OJMgxYTlhA,2425164
448
450
  enap_designsystem/migrations/0410_alter_formulariopage_form_steps.py,sha256=VphZlDbOYAIaw9dLRi1_9mVhdLz2v7x-dZA2SvCNUhA,53854
449
451
  enap_designsystem/migrations/0411_alter_formulariopage_form_steps.py,sha256=Z00KTXqEJEAxG12vK7zo4h7iXYsW8YpmF_-rTzCY2n8,53880
452
+ enap_designsystem/migrations/0412_alter_areaaluno_body_alter_concursoinovacao_banner_and_more.py,sha256=oI9MV5r2CKy80j_kfEbRUfpNZVuBbkV_I27hpiPn66A,3075001
450
453
  enap_designsystem/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
451
454
  enap_designsystem/search_backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
452
455
  enap_designsystem/search_backends/custom_elasticsearch.py,sha256=LeQT0_dJmNMTY7l3jOJ_7mJ9-2X0oXVqvxRiXEA0qGY,988
@@ -513,7 +516,7 @@ enap_designsystem/static/enap_designsystem/blocks/preview_courses.css,sha256=wht
513
516
  enap_designsystem/static/enap_designsystem/blocks/quote_modern.css,sha256=mQ_Ezbz6Z5EWCs3OKq4ywJrsCA30Kjge452JN6RpZzU,2268
514
517
  enap_designsystem/static/enap_designsystem/blocks/section_card_title_center.css,sha256=t6MUmk84ETgZFZ3Rpv-CdQZ9biwaTleEKlX2Ba6T1bc,2249
515
518
  enap_designsystem/static/enap_designsystem/blocks/section_tabs_cards.css,sha256=_kCXNR97OXEOW8KvFet827RgT1aePphgYtdddphymn8,4787
516
- enap_designsystem/static/enap_designsystem/blocks/semana.css,sha256=S7gGVvoimZK_Sr5M_FNDJeiYHAhAHP_s55_LWjcrIsA,34996
519
+ enap_designsystem/static/enap_designsystem/blocks/semana.css,sha256=W-eLX9Foe-WRq_upFF5Ew6nso-XHOLsr37zGwYAL8q4,35050
517
520
  enap_designsystem/static/enap_designsystem/blocks/service_cards.css,sha256=pn-F2E0B3cOhmWklokyIZXRloPNdXIc_UwmqrGAHi2o,1918
518
521
  enap_designsystem/static/enap_designsystem/blocks/sobre_linhas.css,sha256=0-fn_VgyPfbGd3tm3nQKNEBGhMBCZ1gq-Zcv_T8XI4c,2874
519
522
  enap_designsystem/static/enap_designsystem/blocks/tags.css,sha256=7Fh6zJEvtdIHBGaKGUKU85oc39XNKaLGEy4plLx6iCI,552
@@ -645,7 +648,7 @@ enap_designsystem/templates/enap_designsystem/blocks/card_flex_block.html,sha256
645
648
  enap_designsystem/templates/enap_designsystem/blocks/card_item.html,sha256=i8P0HyYQNIYknIw7RQf81QxdnAaJgPoLi4y0Hr4mAdg,1628
646
649
  enap_designsystem/templates/enap_designsystem/blocks/cardgrid_block.html,sha256=nxD_ZgzSRtZIo3AtHPj1R6pWVgJY3AUHJTRYUcf5dTw,207
647
650
  enap_designsystem/templates/enap_designsystem/blocks/cards_section.html,sha256=nEN4HNbT8eb_Vs8XG0uB4IyxVFfd3uLPt2SWJzP30h0,3967
648
- enap_designsystem/templates/enap_designsystem/blocks/cards_titles.html,sha256=drwdeXWQCUqfLZ_ekFOGr5dPcYHrj8pAtcCJDvwE3Xs,9156
651
+ enap_designsystem/templates/enap_designsystem/blocks/cards_titles.html,sha256=61YQ10HFhpHTj9EiZOkGZTclyKmgLM4FSYcTKet4jok,9115
649
652
  enap_designsystem/templates/enap_designsystem/blocks/carousel.html,sha256=WJq2NzkpANYkQwHizH7w85SKhmuVxx2goz_BHNTOKNo,16285
650
653
  enap_designsystem/templates/enap_designsystem/blocks/carousel_bggreen.html,sha256=fpwz8WrgGQ5bOsk66TktliBSA5HPz35OcqTlsXV0aLI,28030
651
654
  enap_designsystem/templates/enap_designsystem/blocks/carousel_images.html,sha256=G4nZTKCSPfhu4Qdq-1u-QzG6exw6iOPKd2QWAkaH3Vw,15142
@@ -758,7 +761,7 @@ enap_designsystem/templates/enap_designsystem/blocks/suap/apisuap_courses_block.
758
761
  enap_designsystem/templates/enap_designsystem/blocks/suap/suap_courses_block.html,sha256=Jquna6TGWll4-XtRgHFE9tO_kPx8VBLvkXjeVgyJNwA,15838
759
762
  enap_designsystem/templates/enap_designsystem/blocks/suap/suap_events_block.html,sha256=mL2DFQeAuDIx_GyCoEURKmME-Mmd-zQ_NZkO7YW9Z2k,20182
760
763
  enap_designsystem/templates/enap_designsystem/form_templates/form_report.html,sha256=WXf4HgNQY0M6zZ-tERqf01mHbGflqWXT96RaJYjCxFA,16081
761
- enap_designsystem/templates/enap_designsystem/form_templates/formulario_page.html,sha256=J37sTegXHzkl4GLs66kPDL7ODe1Os1L5dlVceGSGDJU,54407
764
+ enap_designsystem/templates/enap_designsystem/form_templates/formulario_page.html,sha256=0OkarSj7Mr-_TrmhpfebIvrbbc6TCc9fX_VK2lC25h4,59682
762
765
  enap_designsystem/templates/enap_designsystem/form_templates/formulario_page_landing.html,sha256=YsxUFe2U7aQHY8Xb_WeCjwQZWJOpLVlhS8Q3HpCMNug,7670
763
766
  enap_designsystem/templates/enap_designsystem/form_templates/formulario_page_success.html,sha256=c4w6PvTR5_g8P5wCxs_Xu235JyHRgLNtM0eD33XcVTI,9435
764
767
  enap_designsystem/templates/enap_designsystem/form_templates/home_page.html,sha256=BYV5TV6xp0uY3SWtNsAf8p-aDqPiHfM8j4pWbqTUV2M,42329
@@ -777,7 +780,7 @@ enap_designsystem/templates/enap_designsystem/pages/durante_evento.html,sha256=c
777
780
  enap_designsystem/templates/enap_designsystem/pages/enap_layout.html,sha256=nZV71dI5MiM2CC6vbcKAX2H0fuqBsz2jvSOwtODEluU,1969
778
781
  enap_designsystem/templates/enap_designsystem/pages/enap_layout_semana.html,sha256=nZV71dI5MiM2CC6vbcKAX2H0fuqBsz2jvSOwtODEluU,1969
779
782
  enap_designsystem/templates/enap_designsystem/pages/mba_especializacao.html,sha256=RvVB5sdS6EJa5WUvvGgcSnr_Ax_DUw4ALEjlXefFQz0,6339
780
- enap_designsystem/templates/enap_designsystem/pages/page_search.html,sha256=UXdIjKfcRVuf5B1MlJAOUSoUOMZlUdO1Xs5YnhUfRxE,49824
783
+ enap_designsystem/templates/enap_designsystem/pages/page_search.html,sha256=-zdZV5hWtsbE-aIa1m_RCniMZ2EhK3GLGJ61PeNd4Z8,50136
781
784
  enap_designsystem/templates/enap_designsystem/pages/pagepreview_block.html,sha256=RBqtL0rphuSh5Bi4XPPtXlGUf_zyWFPZY3xwJb8hhZM,235
782
785
  enap_designsystem/templates/enap_designsystem/pages/pos_evento.html,sha256=Y5dgwbLLbE4SmXdt493RcQQpsMqjP3zF5xXxjFXTfrs,3281
783
786
  enap_designsystem/templates/enap_designsystem/pages/pre_evento.html,sha256=XG3PPbp6FP984kB9RubHlgssgJJ3t2CO0C95iPvRLcw,3814
@@ -853,8 +856,8 @@ enap_designsystem/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
853
856
  enap_designsystem/utils/decorators.py,sha256=aq6SbLn0LcH2rfE3ZFit8jkD7pSx9fLVBUUwVB747hg,335
854
857
  enap_designsystem/utils/services.py,sha256=6dG5jLSbwH49jpZV9ZNpWlaZqI49gTlwlr1vaerxdiU,5824
855
858
  enap_designsystem/utils/sso.py,sha256=vjAuoYgoLeQAa_dkkyQ6-LmHvKMaVCxizNFpe5y3iUA,1145
856
- wagtail_enap_designsystem-1.2.1.138.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
857
- wagtail_enap_designsystem-1.2.1.138.dist-info/METADATA,sha256=yHsN_UlpqwUMwIpyJPM9RDvomYYWa2Jjk0QJxJxZOSs,3651
858
- wagtail_enap_designsystem-1.2.1.138.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
859
- wagtail_enap_designsystem-1.2.1.138.dist-info/top_level.txt,sha256=RSFgMASxoA-hVftm5i4Qd0rArlX4Dq08lLv5G4sYD-g,18
860
- wagtail_enap_designsystem-1.2.1.138.dist-info/RECORD,,
859
+ wagtail_enap_designsystem-1.2.1.140.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
860
+ wagtail_enap_designsystem-1.2.1.140.dist-info/METADATA,sha256=qcfzZ_BXeXe4yZbmzAFtZ0osC-Y3hK-XQhFyczlDrY8,3651
861
+ wagtail_enap_designsystem-1.2.1.140.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
862
+ wagtail_enap_designsystem-1.2.1.140.dist-info/top_level.txt,sha256=RSFgMASxoA-hVftm5i4Qd0rArlX4Dq08lLv5G4sYD-g,18
863
+ wagtail_enap_designsystem-1.2.1.140.dist-info/RECORD,,