|
|
@ -8,111 +8,116 @@ |
|
|
<html lang="en"> |
|
|
<html lang="en"> |
|
|
<!--<![endif]--> |
|
|
<!--<![endif]--> |
|
|
|
|
|
|
|
|
<head> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta charset="UTF-8"> |
|
|
<!-- TODO: does it need this head_title here? --> |
|
|
<!-- TODO: does it need this head_title here? --> |
|
|
<title>{% block head_title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %}</title> |
|
|
<title>{% block head_title %}{% trans 'SAPL - Sistema de Apoio ao Processo Legislativo' %}{% endblock %}</title> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
|
|
|
|
|
|
{% render_bundle 'global'%} |
|
|
{% render_chunk_vendors 'css' %} |
|
|
|
|
|
{% render_bundle 'global' 'css' %} |
|
|
|
|
|
{% render_bundle 'painel' 'css' %} |
|
|
<STYLE type="text/css"> |
|
|
|
|
|
@media screen { |
|
|
<STYLE type="text/css"> |
|
|
body {font-size: medium; color: white; line-height: 1em; background: black;} |
|
|
@media screen { |
|
|
} |
|
|
body {font-size: medium; color: white; line-height: 1em; background: black;} |
|
|
</STYLE> |
|
|
} |
|
|
|
|
|
</STYLE> |
|
|
<script type="text/javascript"> |
|
|
</head> |
|
|
$(document).ready(function() { |
|
|
<body> |
|
|
|
|
|
<h1>{{ context.title }}</h1> |
|
|
//TODO: replace by a fancy jQuery clock |
|
|
<input id="json_url" type="hidden" value="{% url 'sapl.painel:dados_painel' %}"> |
|
|
function checkTime(i) { |
|
|
<h3> |
|
|
if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 |
|
|
<span id="sessao_plenaria"></span><br/><br/> |
|
|
return i; |
|
|
<span id="sessao_plenaria_data"></span><br/><br/> |
|
|
} |
|
|
<span id="sessao_plenaria_hora_inicio"></span></br><br/> |
|
|
function startTime() { |
|
|
<h2><span id="relogio"></span></h2> |
|
|
var today=new Date(); |
|
|
<table> |
|
|
var h=today.getHours(); |
|
|
<tr> |
|
|
var m=today.getMinutes(); |
|
|
<td> |
|
|
var s=today.getSeconds(); |
|
|
<ul id="votacao"> |
|
|
m = checkTime(m); |
|
|
</ul> |
|
|
s = checkTime(s); |
|
|
</td> |
|
|
$("#relogio").text(h+":"+m+":"+s) |
|
|
</tr> |
|
|
var t = setTimeout(function(){ |
|
|
</table> |
|
|
startTime() |
|
|
<span id="resultado_votacao"></span><br/> |
|
|
},500); |
|
|
</h3> |
|
|
} |
|
|
</body> |
|
|
|
|
|
|
|
|
startTime(); |
|
|
{% render_chunk_vendors 'js' %} |
|
|
|
|
|
{% render_bundle 'global' 'js' %} |
|
|
var counter = 1; |
|
|
{% render_bundle 'painel' 'js' %} |
|
|
(function poll() { |
|
|
|
|
|
$.ajax({ |
|
|
<script type="text/javascript"> |
|
|
url: $("#json_url").val(), |
|
|
$(document).ready(function() { |
|
|
type: "GET", |
|
|
|
|
|
success: function(data) { |
|
|
//TODO: replace by a fancy jQuery clock |
|
|
|
|
|
function checkTime(i) { |
|
|
//TODO: json spitted out is very complex, have to simplify/flat it |
|
|
if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 |
|
|
//TODO: probably building it by hand on REST side |
|
|
return i; |
|
|
|
|
|
} |
|
|
console.debug(data) |
|
|
function startTime() { |
|
|
|
|
|
var today=new Date(); |
|
|
var presentes = $("#parlamentares"); |
|
|
var h=today.getHours(); |
|
|
presentes.children().remove(); |
|
|
var m=today.getMinutes(); |
|
|
|
|
|
var s=today.getSeconds(); |
|
|
presentes_ordem_dia = data.presentes_ordem_dia |
|
|
m = checkTime(m); |
|
|
$.each(presentes_ordem_dia, function(index, parlamentar) { |
|
|
s = checkTime(s); |
|
|
$('<li />', {text: parlamentar.nome + '/' + parlamentar.partido + ' ' + parlamentar.voto }).appendTo(presentes); |
|
|
$("#relogio").text(h+":"+m+":"+s) |
|
|
}); |
|
|
var t = setTimeout(function(){ |
|
|
|
|
|
startTime() |
|
|
var votacao = $("#votacao") |
|
|
},500); |
|
|
votacao.children().remove() |
|
|
} |
|
|
votacao.append("<li>Sim: " + data["numero_votos_sim"] + "</li>") |
|
|
|
|
|
votacao.append("<li>Não: " + data["numero_votos_nao"] + "</li>") |
|
|
startTime(); |
|
|
votacao.append("<li>Abstenções: " + data["numero_abstencoes"] + "</li>") |
|
|
|
|
|
votacao.append("<li>Presentes: " + data["presentes"] + "</li>") |
|
|
var counter = 1; |
|
|
votacao.append("<li>Total votos: " + data["total_votos"] + "</li>") |
|
|
(function poll() { |
|
|
|
|
|
$.ajax({ |
|
|
$("#sessao_plenaria").text(data["sessao_plenaria"]) |
|
|
url: $("#json_url").val(), |
|
|
$("#sessao_plenaria_data").text("Data Início: " + data["sessao_plenaria_data"]) |
|
|
type: "GET", |
|
|
$("#sessao_plenaria_hora_inicio").text("Hora Início: " + data["sessao_plenaria_hora_inicio"]) |
|
|
success: function(data) { |
|
|
|
|
|
|
|
|
$("#materia_legislativa_texto").text(data["materia_legislativa_texto"]) |
|
|
//TODO: json spitted out is very complex, have to simplify/flat it |
|
|
$("#observacao_materia").text(data["observacao_materia"]) |
|
|
//TODO: probably building it by hand on REST side |
|
|
$("#resultado_votacao").text(data["tipo_resultado"]) |
|
|
|
|
|
|
|
|
console.debug(data) |
|
|
$("#counter").text(counter); |
|
|
|
|
|
counter++; |
|
|
var presentes = $("#parlamentares"); |
|
|
}, |
|
|
presentes.children().remove(); |
|
|
error: function(err) { |
|
|
|
|
|
console.error(err); |
|
|
presentes_ordem_dia = data.presentes_ordem_dia |
|
|
}, |
|
|
$.each(presentes_ordem_dia, function(index, parlamentar) { |
|
|
dataType: "json", |
|
|
$('<li />', {text: parlamentar.nome + '/' + parlamentar.partido + ' ' + parlamentar.voto }).appendTo(presentes); |
|
|
//complete: setTimeout(function() {poll()}, 5000), |
|
|
}); |
|
|
timeout: 20000 // TODO: decrease |
|
|
|
|
|
}) |
|
|
var votacao = $("#votacao") |
|
|
})(); |
|
|
votacao.children().remove() |
|
|
}); |
|
|
votacao.append("<li>Sim: " + data["numero_votos_sim"] + "</li>") |
|
|
</script> |
|
|
votacao.append("<li>Não: " + data["numero_votos_nao"] + "</li>") |
|
|
</head> |
|
|
votacao.append("<li>Abstenções: " + data["numero_abstencoes"] + "</li>") |
|
|
<body> |
|
|
votacao.append("<li>Presentes: " + data["presentes"] + "</li>") |
|
|
<h1>{{ context.title }}</h1> |
|
|
votacao.append("<li>Total votos: " + data["total_votos"] + "</li>") |
|
|
<input id="json_url" type="hidden" value="{% url 'sapl.painel:dados_painel' %}"> |
|
|
|
|
|
<h3> |
|
|
$("#sessao_plenaria").text(data["sessao_plenaria"]) |
|
|
<span id="sessao_plenaria"></span><br/><br/> |
|
|
$("#sessao_plenaria_data").text("Data Início: " + data["sessao_plenaria_data"]) |
|
|
<span id="sessao_plenaria_data"></span><br/><br/> |
|
|
$("#sessao_plenaria_hora_inicio").text("Hora Início: " + data["sessao_plenaria_hora_inicio"]) |
|
|
<span id="sessao_plenaria_hora_inicio"></span></br><br/> |
|
|
|
|
|
<h2><span id="relogio"></span></h2> |
|
|
$("#materia_legislativa_texto").text(data["materia_legislativa_texto"]) |
|
|
<table> |
|
|
$("#observacao_materia").text(data["observacao_materia"]) |
|
|
<tr> |
|
|
$("#resultado_votacao").text(data["tipo_resultado"]) |
|
|
<td> |
|
|
|
|
|
<ul id="votacao"> |
|
|
$("#counter").text(counter); |
|
|
</ul> |
|
|
counter++; |
|
|
</td> |
|
|
}, |
|
|
</tr> |
|
|
error: function(err) { |
|
|
</table> |
|
|
console.error(err); |
|
|
<span id="resultado_votacao"></span><br/> |
|
|
}, |
|
|
</h3> |
|
|
dataType: "json", |
|
|
</body> |
|
|
//complete: setTimeout(function() {poll()}, 5000), |
|
|
|
|
|
timeout: 20000 // TODO: decrease |
|
|
|
|
|
}) |
|
|
|
|
|
})(); |
|
|
|
|
|
}); |
|
|
|
|
|
</script> |
|
|
</html> |
|
|
</html> |
|
|
|