From 71309a9280649d55df0a7216132a260596d50f2b Mon Sep 17 00:00:00 2001 From: RogerKoala Date: Tue, 2 Dec 2025 11:11:19 -0300 Subject: [PATCH] =?UTF-8?q?Novo=20layout=20painel=20de=20vota=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/__apps/painel/scss/painel.scss | 198 +++- sapl/painel/views.py | 18 +- sapl/templates/painel/index.html | 1005 ++++++++++--------- 3 files changed, 684 insertions(+), 537 deletions(-) diff --git a/frontend/src/__apps/painel/scss/painel.scss b/frontend/src/__apps/painel/scss/painel.scss index aa3c060a1..56a32197b 100644 --- a/frontend/src/__apps/painel/scss/painel.scss +++ b/frontend/src/__apps/painel/scss/painel.scss @@ -1,43 +1,159 @@ +:root { + --bg-dark: #121212; + --bg-panel: #1e1e1e; + --text-main: #e0e0e0; + --text-highlight: #4fa64d; +} -.painel-principal { - background: #1c1b1b; - font-family: Verdana; - font-size: x-large; - .text-title { - color: #4fa64d; - margin: 0.5rem; - font-weight: bold; - } - .text-subtitle { - color: #459170; - font-weight: bold; - } - .data-hora { - font-size: 180%; - } - - .text-value { - color: white; - } - - .logo-painel { - max-width: 100%; - } - .painels { - flex-wrap: wrap; - } - .painel{ - margin-top: 1rem; - table { - width: 100%; - } - h2 { - margin-bottom: 0.5rem; - } - #votacao, #oradores_list { - text-align: left; - display: inline-block; - margin-bottom: 1rem; - } - } +body { + background-color: var(--bg-dark); + color: var(--text-main); + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + margin-bottom: 0; +} + +.separador-vertical { + border-right: 1px solid #333; + min-height: 100vh; + margin: 0; +} + +.text-title { + color: var(--text-highlight); + letter-spacing: 1px; +} + +.text-subtitle { + color: #81c784; + font-weight: 600; +} + +.parlamentares-grid { + display: grid; + grid-template-columns: repeat(auto-fill, 190px); + width: 100%; +} + +.parlamentar-card { + width: 150px; + border-radius: 3px; + overflow: hidden; + position: relative; +} + +.foto-container { + border-radius: 3px; + overflow: hidden; + height: 150px; +} + +.parlamentar-card img { + width: 100%; + height: 150px; + display: block; + object-fit: fill; +} + +.parlamentar-card .nome { + font-weight: bold; + font-size: 0.95rem; + color: #fff; + line-height: 1.1; + text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); + margin-bottom: 2px; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; +} + +.parlamentar-card .partido { + font-size: 0.8rem; + color: #ddd; + font-weight: 600; + text-transform: uppercase; + text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); +} + +.voto-faixa { + position: absolute; + width: 90px; + height: 90px; + top: -45px; + right: -45px; + transform: rotate(45deg); + display: flex; + align-items: flex-end; + justify-content: center; + color: #fff; + font-weight: 700; + box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.2); + z-index: 10; + line-height: 1; +} + +.voto-faixa p { + transform: rotate(-45deg); + font-size: 2rem; + text-transform: uppercase; +} + +.voto-sim .voto-faixa { + background-color: #27ae60; +} + +.voto-nao .voto-faixa { + background-color: #c0392b; +} + +.voto-abstencao .voto-faixa { + background-color: #f39c12; +} + +.voto-informado .voto-faixa { + background-color: #d35400; +} + +.voto-ausente .voto-faixa { + background-color: #7f8c8d; +} + +.table-custom { + color: #ddd; +} + +.table-custom tbody td { + padding: 8px; + font-size: 1.1rem; +} + +.table-sim { + color: #27ae60; +} + +.table-nao { + color: #c0392b; +} + +.table-abstencao { + color: #f39c12; +} + +.table-total { + color: #194BFA; +} + +.logo-painel { + max-height: 150px; + width: auto; +} + +#oradores_list tr td { + font-size: 1.2rem; + padding: 5px; + text-align: start; +} + +.hora-brasao { + border-top: 1px solid #333; } \ No newline at end of file diff --git a/sapl/painel/views.py b/sapl/painel/views.py index a4c9e2da3..28bb459e4 100644 --- a/sapl/painel/views.py +++ b/sapl/painel/views.py @@ -23,6 +23,7 @@ from sapl.sessao.models import (ExpedienteMateria, OradorExpediente, OrdemDia, SessaoPlenaria, SessaoPlenariaPresenca, VotoParlamentar, RegistroLeitura) from sapl.utils import filiacao_data, get_client_ip, sort_lista_chave +from image_cropping.utils import get_backend from .models import Cronometro @@ -382,6 +383,7 @@ def get_presentes(pk, response, materia): }) presentes_list = [] + for p in presentes: legislatura = sessao.legislatura # Recupera os mandatos daquele parlamentar @@ -394,10 +396,24 @@ def get_presentes(pk, response, materia): else: partido = filiacao + if p.parlamentar.fotografia: + thumbnail_url = get_backend().get_thumbnail_url( + p.parlamentar.fotografia, + { + 'size': (128, 128), + 'box': p.parlamentar.cropping, + 'crop': True, + 'detail': True, + } + ) + else: + thumbnail_url = False + presentes_list.append( {'id': p.id, 'parlamentar_id': p.parlamentar.id, 'nome': p.parlamentar.nome_parlamentar, + 'fotografia':thumbnail_url, 'partido': partido, 'voto': '' }) @@ -476,7 +492,7 @@ def get_votos(response, materia, mostrar_voto): 'numero_abstencoes': 0, 'registro': None, 'total_votos': 0, - 'tipo_resultado': 'Ainda não foi votada.', + 'tipo_resultado': 'Em votação.', }) if materia.tipo_votacao == 2: diff --git a/sapl/templates/painel/index.html b/sapl/templates/painel/index.html index 523fa2423..e5080dda5 100644 --- a/sapl/templates/painel/index.html +++ b/sapl/templates/painel/index.html @@ -1,522 +1,537 @@ {% load i18n %} {% load common_tags %} - {% load render_bundle from webpack_loader %} {% load webpack_static from webpack_loader %} - - - - - - - - {% block head_title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %} - - {% block webpack_loader_css %} - {% render_chunk_vendors 'css' %} - {% render_bundle 'global' 'css' %} - {% render_bundle 'painel' 'css' %} - {% endblock webpack_loader_css %} - - - - - - - -
-

-
-
-
- -
-
- -
-
-
-
- + + + + {% block head_title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %} + + + + {% block webpack_loader_css %} + {% render_chunk_vendors 'css' %} + {% render_bundle 'global' 'css' %} + {% render_bundle 'painel' 'css' %} + {% endblock webpack_loader_css %} + + + + + + + +
+
+ +
+
+

+
+
-
-

-
+
-
-
-
-
+
+
+

Matéria em Votação

+ + +
+ +
-
-
-
-
-

Parlamentares

- -
-
-
-
-

Oradores

- -
- -
-
-

Cronômetros

- - -
-
- Discurso:
- Aparte:
- Questão de Ordem:
- Considerações Finais: -
-
- -
-
-

Resultado

- - -
-
- - -
-
- -
-

Matéria em Votação

- -
- -
- -
- - -
+
+
+ +
+

Oradores

+
+
+ +
+
+

Cronômetro

+
+ + + + + + + + + + + + + + + + + + + +
Discurso00:00:00
+
+
+
+ +
+
+ + +
+
+
+ +
+
+
+ Brasão +
+
+ +
+
+
+
-
- - - {% block webpack_loader_js %} - {% render_chunk_vendors 'js' %} - {% render_bundle 'global' 'js' %} - {% render_bundle 'painel' 'js' %} - {% endblock webpack_loader_js %} - - {% block webpack_loader_chunks_js %} - {% endblock webpack_loader_chunks_js %} - - - + else { + $("#resultado_votacao_div").hide(); + $("#mat_em_votacao").text("Matéria em Leitura"); + } + $("#resultado_votacao").text(data["tipo_resultado"]); + + var resultado_votacao_upper = $("#resultado_votacao").text().toUpperCase(); + if (resultado_votacao_upper.search("APROV") != -1) { + $("#resultado_votacao").css("color", "#7CFC00"); + $("#mat_em_votacao").text("Matéria Votada"); + } + else if (resultado_votacao_upper.search("REJEIT") != -1) { + $("#resultado_votacao").css("color", "red"); + $("#mat_em_votacao").text("Matéria Votada"); + } + else if (resultado_votacao_upper.search("LIDA") != -1) { + $("#mat_em_votacao").text("Matéria Lida"); + } + } + else { + $("#resultado_votacao").text(''); + if (data['tipo_votacao'] != 'Leitura') + $("#mat_em_votacao").text("Matéria em Votação"); + else { + $("#mat_em_votacao").text("Matéria em Leitura"); + } + } + + }, + error: function (xhr, status, error) { + console.error("Erro no polling:", error); + }, + complete: function () { + isPolling = false; + setTimeout(poll, 500); + }, + timeout: 20000 + }); + } + + // Iniciar polling + poll(); + + }); + + + \ No newline at end of file