mirror of https://github.com/interlegis/sapl.git
22 changed files with 633 additions and 92 deletions
@ -0,0 +1,38 @@ |
|||
import './scss/painel.scss' |
|||
import Vue from 'vue' |
|||
import { FormSelectPlugin } from 'bootstrap-vue' |
|||
import axios from 'axios' |
|||
|
|||
//TODO: incluir painel-controle dentro da app de painel, colocando rotas diferentes
|
|||
|
|||
axios.defaults.xsrfCookieName = 'csrftoken' |
|||
axios.defaults.xsrfHeaderName = 'X-CSRFToken' |
|||
|
|||
Vue.use(FormSelectPlugin) |
|||
|
|||
console.log('painel controle main.js carregado') |
|||
|
|||
const v = new Vue({ // eslint-disable-line
|
|||
delimiters: ['[[', ']]'], |
|||
el: '#painel-controle', |
|||
data () { |
|||
return { |
|||
sessao_plenaria: "74ª Sessão Ordinária da 1ª Sessão Legislativa da 18ª Legislatura", |
|||
message: "", |
|||
} |
|||
}, |
|||
|
|||
watch: {}, |
|||
|
|||
computed: { |
|||
|
|||
}, |
|||
|
|||
created () {}, |
|||
|
|||
methods: {}, |
|||
|
|||
mounted () { |
|||
console.log("Painel controle app mounted!") |
|||
} |
|||
}) |
|||
@ -0,0 +1,43 @@ |
|||
|
|||
.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; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,237 @@ |
|||
import './scss/votacao.scss' |
|||
import Vue from 'vue' |
|||
import { FormSelectPlugin } from 'bootstrap-vue' |
|||
import axios from 'axios' |
|||
|
|||
axios.defaults.xsrfCookieName = 'csrftoken' |
|||
axios.defaults.xsrfHeaderName = 'X-CSRFToken' |
|||
|
|||
Vue.use(FormSelectPlugin) |
|||
|
|||
console.log('votacao main.js carregado') |
|||
|
|||
const v = new Vue({ // eslint-disable-line
|
|||
delimiters: ['[[', ']]'], |
|||
el: '#votacao', |
|||
data () { |
|||
return { |
|||
votacao_aberta: true, |
|||
edit_votes: true, |
|||
disable_resultado: false, |
|||
resultado_selected: "", |
|||
observacoes: "", |
|||
error_message: "", |
|||
tipo_votacao: "Votação Nominal", |
|||
materia: "Projeto de Lei Ordinária nº 3 de 2025", |
|||
ementa: "Institui no Município de Pato Branco o Projeto Chá de Fralda Social. ", |
|||
parlamentares: [ |
|||
{ |
|||
"parlamentar_id": 197, |
|||
"nome_parlamentar": "Alexandre Zoche", |
|||
"filiacao": "PRD" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 196, |
|||
"nome_parlamentar": "Anne Cristine Gomes da Silva Cavali", |
|||
"filiacao": "PSD" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 194, |
|||
"nome_parlamentar": "Diogo Domingos Grando", |
|||
"filiacao": "PRD" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 186, |
|||
"nome_parlamentar": "Eduardo Albani Dala Costa", |
|||
"filiacao": "Republicanos" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 3, |
|||
"nome_parlamentar": "Fabricio Preis de Mello", |
|||
"filiacao": "PL" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 6, |
|||
"nome_parlamentar": "Joecir Bernardi", |
|||
"filiacao": "PSD" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 187, |
|||
"nome_parlamentar": "Lindomar Rodrigo Brandão", |
|||
"filiacao": "PP" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 195, |
|||
"nome_parlamentar": "Rafael Foss", |
|||
"filiacao": "União" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 11, |
|||
"nome_parlamentar": "Rodrigo José Correia", |
|||
"filiacao": "União" |
|||
}, |
|||
{ |
|||
"parlamentar_id": 192, |
|||
"nome_parlamentar": "Thania Maria Caminski Gehlen", |
|||
"filiacao": "PP" |
|||
} |
|||
], |
|||
//TODO: check if votos_parlamentares is null
|
|||
votos_parlamentares: { |
|||
186: { |
|||
"voto": "Não", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 186, |
|||
"parlamentar_nome": "Eduardo Albani Dala Costa" |
|||
}, |
|||
195: { |
|||
"voto": "Não", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 195, |
|||
"parlamentar_nome": "Rafael Foss" |
|||
}, |
|||
196: { |
|||
"voto": "Não", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 196, |
|||
"parlamentar_nome": "Anne Cristine Gomes da Silva Cavali" |
|||
}, |
|||
3: { |
|||
"voto": "Sim", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 3, |
|||
"parlamentar_nome": "Fabricio Preis de Mello" |
|||
}, |
|||
11: { |
|||
"voto": "Não", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 11, |
|||
"parlamentar_nome": "Rodrigo José Correia" |
|||
}, |
|||
194: { |
|||
"voto": "Não", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 194, |
|||
"parlamentar_nome": "Diogo Domingos Grando" |
|||
}, |
|||
197: { |
|||
"voto": "Não", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 197, |
|||
"parlamentar_nome": "Alexandre Zoche" |
|||
}, |
|||
6: { |
|||
"voto": "Não", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 6, |
|||
"parlamentar_nome": "Joecir Bernardi" |
|||
}, |
|||
187: { |
|||
"voto": "Abstenção", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 187, |
|||
"parlamentar_nome": "Lindomar Rodrigo Brandão" |
|||
}, |
|||
192: { |
|||
"voto": "Sim", |
|||
"materia_id": 31919, |
|||
"parlamentar_id": 192, |
|||
"parlamentar_nome": "Thania Maria Caminski Gehlen" |
|||
} |
|||
}, |
|||
options: [ |
|||
{ text: 'Sim', value: 'voto_sim' }, |
|||
{ text: 'Não', value: 'voto_nao' }, |
|||
{ text: 'Abstenção', value: 'abstencao' }, |
|||
{ text: 'Não Votou', value: 'nao_votou' }, |
|||
], |
|||
tipos_resultados: [ |
|||
{ |
|||
"id": 13, |
|||
"nome": "Aprovada a retirada de pauta" |
|||
}, |
|||
{ |
|||
"id": 10, |
|||
"nome": "Aprovada por dois terços" |
|||
}, |
|||
{ |
|||
"id": 2, |
|||
"nome": "Aprovada por maioria absoluta" |
|||
}, |
|||
{ |
|||
"id": 1, |
|||
"nome": "Aprovada por maioria simples - conforme o art. 37 do RI o presidente não vota" |
|||
}, |
|||
{ |
|||
"id": 8, |
|||
"nome": "Aprovada por maioria simples - conforme o art. 37 do RI o presidente votou pelo desempate" |
|||
}, |
|||
{ |
|||
"id": 15, |
|||
"nome": "Aprovada." |
|||
}, |
|||
{ |
|||
"id": 7, |
|||
"nome": "Empate - conforme o art. 37 do RI o presidente vota para desempate" |
|||
}, |
|||
{ |
|||
"id": 16, |
|||
"nome": "IMPROCEDENTE" |
|||
}, |
|||
{ |
|||
"id": 12, |
|||
"nome": "Leitura em Plenário" |
|||
}, |
|||
{ |
|||
"id": 17, |
|||
"nome": "PROCEDENTE" |
|||
}, |
|||
{ |
|||
"id": 11, |
|||
"nome": "Prejudicada" |
|||
}, |
|||
{ |
|||
"id": 5, |
|||
"nome": "Rejeitada" |
|||
}, |
|||
{ |
|||
"id": 14, |
|||
"nome": "Rejeitada a retirada de pauta" |
|||
}, |
|||
{ |
|||
"id": 9, |
|||
"nome": "Rejeitada por maioria simples - conforme o art. 37 do RI o presidente votou pelo desempate" |
|||
} |
|||
], |
|||
} |
|||
}, |
|||
|
|||
watch: {}, |
|||
|
|||
computed: { |
|||
total_votos() { |
|||
// TODO: use number index instead of string ("sim", "não") as keys.
|
|||
var groupedVotes = Map.groupBy(Object.values(this.votos_parlamentares), ({ voto }) => voto ) |
|||
// initialize total_votos
|
|||
total_votos = [ |
|||
{"tipo": "Sim", "total": 0}, |
|||
{"tipo": "Não", "total": 0}, |
|||
{"tipo": "Abstenção", "total": 0}, |
|||
{"tipo": "Não Votou", total: 0} |
|||
] |
|||
for (const [key, value] of groupedVotes.entries()) { |
|||
const index = total_votos.findIndex(item => item.tipo === key); |
|||
total_votos[index].total = value.length |
|||
} |
|||
return total_votos |
|||
} |
|||
}, |
|||
|
|||
created () {}, |
|||
|
|||
methods: {}, |
|||
|
|||
mounted () { |
|||
console.log("Votacao app mounted!") |
|||
} |
|||
}) |
|||
@ -0,0 +1,11 @@ |
|||
<template> |
|||
<div class="VotacaoNominal"> |
|||
<pre v-text="$attrs"/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'Votacaonominal' |
|||
}; |
|||
</script> |
|||
@ -0,0 +1,106 @@ |
|||
{% extends "crud/detail.html" %} |
|||
{% load i18n %} |
|||
{% load staticfiles %} |
|||
{% load common_tags %} |
|||
{% load render_bundle from webpack_loader %} |
|||
{% load webpack_static from webpack_loader %} |
|||
|
|||
{% block actions %} {% endblock %} |
|||
|
|||
{% block title %} |
|||
{% endblock %} |
|||
|
|||
{% block vue_content %} |
|||
<div id="painel-controle"> |
|||
<h1 class="page-header"> |
|||
Painel Eletrônico <small>([[ sessao_plenaria ]])</small> |
|||
</h1> |
|||
[[ message ]] |
|||
<div class="row"> |
|||
<div class="col-md-6"><a href="" onclick="window.open('{% url 'sapl.painel:painel_principal' pk %}','Comprovante','width=800, height=800, scrollbars=yes'); return false;" class="btn btn-primary btn-sm active">Iniciar painel completo</a></div> |
|||
<div class="col-md-3"><button onclick="switch_painel(true)" id="id_abrir_painel" class="btn btn-primary btn-sm active" style="display: none">Abrir Painel</button></div> |
|||
<div class="col-md-3"><button onclick="switch_painel(false)" id="id_fechar_painel" class="btn btn-danger btn-sm active" style="display: none;">Fechar Painel</button></div> |
|||
</div> |
|||
<br /> |
|||
|
|||
<h1>Operação do Painel Eletrônico</h1> |
|||
<h2><span id="relogio"></span></h2> |
|||
<br /> |
|||
<div class="row"> |
|||
<div class="col-md-12 mb-2"><h3>Cronômetro do Discurso</h3></div> |
|||
</div> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-2"><input size="2" id="discurso" name="discurso" value="" readyonly="true" class="form-control"></div> |
|||
</div> |
|||
<br /> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-6"><button type="button" id="discursoStart" class="btn btn-success">Iniciar</button></div> |
|||
<div class="col-md-6"><button type="button" id="discursoReset" class="btn btn-success">Reiniciar</button></div> |
|||
</div> |
|||
|
|||
<br /><br > |
|||
<div class="row"> |
|||
<div class="col-md-12 mb-2"><h3>Cronômetro do Aparte</h3></div> |
|||
</div> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-2"><input size="2" id="aparte" name="aparte" value="" readyonly="true" class="form-control"></div> |
|||
</div> |
|||
<br /> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-6"><button type="button" id="aparteStart" class="btn btn-success">Iniciar</button></div> |
|||
<div class="col-md-6"><button type="button" id="aparteReset" class="btn btn-success" class="btn btn-success">Reiniciar</button></div> |
|||
</div> |
|||
|
|||
<br /><br > |
|||
<div class="row"> |
|||
<div class="col-md-12 mb-2"><h3>Cronômetro da Questão de Ordem </h3></div> |
|||
</div> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-2"><input size="2" id="ordem" name="ordem" value="" readyonly="true" class="form-control"></div> |
|||
</div> |
|||
<br /> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-6"><button type="button" id="ordemStart" class="btn btn-success">Iniciar</button></div> |
|||
<div class="col-md-6"><button type="button" id="ordemReset" class="btn btn-success">Reiniciar</button></div> |
|||
</div> |
|||
|
|||
<br/> |
|||
<br/> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-12 mb-2"><h3>Cronômetro de Considerações Finais</h3></div> |
|||
</div> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-4"><input size="2" id="consideracoes" name="consideracoes" value="" readyonly="true" class="form-control"></div> |
|||
</div> |
|||
<br /> |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-6"><button type="button" id="consideracoesStart" class="btn btn-success">Iniciar</button></div> |
|||
<div class="col-md-6"><button type="button" id="consideracoesReset" class="btn btn-success">Reiniciar</button></div> |
|||
</div> |
|||
<br /><br > |
|||
|
|||
<div class="row"> |
|||
<div class="col-md-6"><button type="button" id="sinalSonoro" class="btn btn-success" onclick="document.getElementById('audio').play();">Sinal Sonoro</button></div> |
|||
</div> |
|||
</div> |
|||
{% endblock vue_content %} |
|||
|
|||
{% block webpack_loader_css %} |
|||
{{ block.super }} |
|||
{% render_bundle 'votacao' 'css' %} |
|||
{% endblock %} |
|||
|
|||
{% block webpack_loader_js %} |
|||
{% render_chunk_vendors 'js' %} |
|||
{% render_bundle 'global' 'js' %} |
|||
{% render_bundle 'painel-controle' 'js' %} |
|||
{% endblock %} |
|||
@ -0,0 +1,78 @@ |
|||
{% extends "crud/detail.html" %} |
|||
{% load i18n %} |
|||
{% load crispy_forms_tags cropping%} |
|||
{% load common_tags %} |
|||
{% load render_bundle from webpack_loader %} |
|||
{% load webpack_static from webpack_loader %} |
|||
|
|||
{% block vue_content %} |
|||
<style>[v-cloak]{display:none}</style> |
|||
<div id="votacao"> |
|||
<fieldset class="form-group"> |
|||
<legend>[[ tipo_votacao ]]</legend> |
|||
[[ error_message ]] |
|||
|
|||
<!-- Component 1 --> |
|||
<div> |
|||
<b>Matéria:</b> [[ materia ]] |
|||
<br/> |
|||
<b>Ementa:</b> [[ ementa ]] |
|||
<br/> |
|||
</div> |
|||
<br/> |
|||
<!-- Component 2 --> |
|||
<fieldset class="form-group" v-if="parlamentares.length > 0"> |
|||
<legend><strong>Votos</strong></legend> |
|||
<div class="row" v-for="p in parlamentares"> |
|||
<div class="col-md-4" id="nome_parlamentar">[[ p.nome_parlamentar ]]</div> |
|||
<div class="col-md-2" id="filiacao">[[ p.filiacao ]]</div> |
|||
<div class="col-md-4" v-if="edit_votes"> |
|||
<span v-for="o in options" :key="o.value"> |
|||
<input type="radio" :id="o.value" :value="o.text" :name="p.parlamentar_id" v-model="votos_parlamentares[p.parlamentar_id].voto"/> |
|||
<label :for="o.value"> [[ o.text ]]</label> |
|||
|
|||
</span> |
|||
</div> |
|||
<div v-else> |
|||
[[ votos_parlamentares[p.parlamentar_id].voto ]] |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<br/> |
|||
<legend><strong>Situação da Votação:</strong></legend> |
|||
<div id="total_votos" v-for="voto in total_votos"> |
|||
<div class='row'><div class='col-md-12'>[[ voto.tipo ]]: [[ voto.total ]]</div></div> |
|||
</div> |
|||
<br/> |
|||
<!-- component --> |
|||
<div class="col-md-6"> |
|||
<b>Resultado da Votação: </b> |
|||
<select v-model="resultado_selected" class="select form-control" :disabled="disable_resultado" > |
|||
<option :key="t.id" :value="t.id" v-for="t in tipos_resultados">[[ t.nome ]]</option> |
|||
</select> |
|||
</div> |
|||
<!-- component --> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
Observações: |
|||
<textarea v-model="observacoes" cols="10" rows="10" class="form-control"></textarea> |
|||
</div> |
|||
</div> |
|||
</fieldset> |
|||
<div class="alert alert-info alert-dismissible " role="alert" v-else> |
|||
<div>Não existe nenhum parlamentar presente para que a votação ocorra.</div> |
|||
</div> |
|||
</fieldset> |
|||
</div> |
|||
{% endblock vue_content %} |
|||
|
|||
{% block webpack_loader_css %} |
|||
{{ block.super }} |
|||
{% render_bundle 'votacao' 'css' %} |
|||
{% endblock %} |
|||
|
|||
{% block webpack_loader_js %} |
|||
{% render_chunk_vendors 'js' %} |
|||
{% render_bundle 'global' 'js' %} |
|||
{% render_bundle 'votacao' 'js' %} |
|||
{% endblock %} |
|||
Loading…
Reference in new issue