Browse Source

Add template to Painel in Sessao

pull/6/head
Eduardo Edson Batista Cordeiro Alves 9 years ago
parent
commit
6c40a38126
  1. 9
      sessao/urls.py
  2. 4
      sessao/views.py
  3. BIN
      static/audio/ring.mp3
  4. 150
      templates/sessao/painel.html
  5. 1
      templates/sessao/sessaoplenaria_detail.html

9
sessao/urls.py

@ -1,15 +1,16 @@
from django.conf.urls import include, url
from sessao.views import (ExpedienteView, PresencaView, sessao_crud,
tipo_expediente_crud, tipo_resultado_votacao_crud,
tipo_sessao_crud)
from sessao.views import (ExpedienteView, PainelView, PresencaView,
sessao_crud, tipo_expediente_crud,
tipo_resultado_votacao_crud, tipo_sessao_crud)
urlpatterns_sessao = sessao_crud.urlpatterns + [
url(r'^(?P<pk>\d+)/expediente$',
ExpedienteView.as_view(), name='expediente'),
url(r'^(?P<pk>\d+)/presenca$',
PresencaView.as_view(), name='presenca'),
url(r'^(?P<pk>\d+)/painel$',
PainelView.as_view(), name='painel'),
]
sessao_urls = urlpatterns_sessao, sessao_crud.namespace, sessao_crud.namespace

4
sessao/views.py

@ -150,3 +150,7 @@ class PresencaView(FormMixin, sessao_crud.CrudDetailView):
yield (parlamentar, False)
else:
yield (parlamentar, True)
class PainelView(sessao_crud.CrudDetailView):
template_name = 'sessao/painel.html'

BIN
static/audio/ring.mp3

Binary file not shown.

150
templates/sessao/painel.html

@ -0,0 +1,150 @@
{% extends "sessao/sessaoplenaria_detail.html" %}
{% load i18n %}
{% load staticfiles %}
{% block detail_content %}
<audio type="hidden" id="audio" src="{% static 'audio/ring.mp3' %}"> </audio>
<ul class="small-block-grid-1 medium-block-grid-2 large-block-grid-2">
<li><a href="#">Iniciar painel presidente</a></li>
<li><a href="#">Iniciar painel completo</a></li>
<li><a href="#">Iniciar painel mensagem</a></li>
<li><a href="#">Iniciar painel parlamentares</a></li>
<li><a href="#">Iniciar painel votação</a></li>
</ul>
<ul class="small-block-grid-1 medium-block-grid-1 large-block-grid-1">
<li><h3>Cronômetro do Discurso</h3></li>
</ul>
<ul class="small-block-grid-1 medium-block-grid-1 large-block-grid-1">
<li><input size="2" id="discurso" name="discurso" value="" readyonly="true"></li>
</ul>
<ul class="small-block-grid-2 medium-block-grid-2 large-block-grid-2">
<li><div class="button" id="discursoStart" style="display: inline;" >Iniciar</div></li>
<li><div class="button" id="discursoReset" style="display: inline;" >Reiniciar</div></li>
</ul>
<ul class="small-block-grid-1 medium-block-grid-1 large-block-grid-1">
<li><h3>Cronômetro do Aparte</h3></li>
</ul>
<ul class="small-block-grid-1 medium-block-grid-1 large-block-grid-1">
<li><input size="2" id="aparte" name="aparte" value="" readyonly="true"></li>
</ul>
<ul class="small-block-grid-2 medium-block-grid-2 large-block-grid-2">
<li><div class="button" id="aparteStart" style="display: inline;" >Iniciar</div></li>
<li><div class="button" id="aparteReset" style="display: inline;" >Reiniciar</div></li>
</ul>
<ul class="small-block-grid-1 medium-block-grid-1 large-block-grid-1">
<li><h3>Cronômetro da Questão de Ordem </h3></li>
</ul>
<ul class="small-block-grid-1 medium-block-grid-1 large-block-grid-1">
<li><input size="2" id="ordem" name="ordem" value="" readyonly="true"></li>
</ul>
<ul class="small-block-grid-2 medium-block-grid-2 large-block-grid-2">
<li><div class="button" id="ordemStart" style="display: inline;" >Iniciar</div></li>
<li><div class="button" id="ordemReset" style="display: inline;" >Reiniciar</div></li>
</ul>
{% endblock detail_content %}
{% block foot_js %}
<script language="JavaScript">
$(function() {
var audioAlertFinish = document.getElementById("audio");
$('#discurso').prop('disabled', true);
$('#aparte').prop('disabled', true);
$('#ordem').prop('disabled', true);
$('#discurso').runner({
autostart: false,
countdown: true,
startAt: 60 * 5 * 1000,
stopAt: 0,
milliseconds: false
}).on('runnerFinish', function(eventObject, info){
audioAlertFinish.play();
});
$('#discursoStart').click(function() {
if($('#discursoStart').text() == 'Iniciar'){
$('#discursoReset').hide();
$('#discurso').runner('start');
$('#discursoStart').text('Parar');
}else{
$('#discursoReset').show();
$('#discurso').runner('stop');
$('#discursoStart').text('Iniciar');
}
});
$('#discursoReset').click(function() {
$('#discurso').runner('stop');
$('#discurso').runner('reset');
});
$('#aparte').runner({
autostart: false,
countdown: true,
startAt: 60 * 3 * 1000,
stopAt: 0,
milliseconds: false
}).on('runnerFinish', function(eventObject, info){
audioAlertFinish.play();
});
$('#aparteStart').click(function(){
if($('#aparteStart').text() == 'Iniciar'){
$('#aparteReset').hide();
$('#aparte').runner('start');
$('#aparteStart').text('Parar');
}else{
$('#aparteReset').show();
$('#aparte').runner('stop');
$('#aparteStart').text('Iniciar');
}
});
$('#aparteReset').click(function() {
$('#aparte').runner('stop');
$('#aparte').runner('reset');
});
$('#ordem').runner({
autostart: false,
countdown: true,
startAt: 60 * 2 * 1000,
stopAt: 0,
milliseconds: false
}).on('runnerFinish', function(eventObject, info){
audioAlertFinish.play();
});
$('#ordemStart').click(function() {
if($('#ordemStart').text() == 'Iniciar'){
$('#ordemReset').hide();
$('#ordem').runner('start');
$('#ordemStart').text('Parar');
}else{
$('#ordemReset').show();
$('#ordem').runner('stop');
$('#ordemStart').text('Iniciar');
}
});
$('#ordemReset').click(function() {
$('#ordem').runner('stop');
$('#ordem').runner('reset');
});
});
</script>
{% endblock %}

1
templates/sessao/sessaoplenaria_detail.html

@ -6,5 +6,6 @@
<dd><a href="{% url 'sessaoplenaria:detail' object.pk %}" class="button secondary">{% trans 'Início' %}</a></dd>
<dd><a href="{% url 'sessaoplenaria:expediente' object.pk %}" class="button secondary">{% trans 'Expediente' %}</a></dd>
<dd><a href="{% url 'sessaoplenaria:presenca' object.pk %}" class="button secondary">{% trans 'Presença' %}</a></dd>
<dd><a href="{% url 'sessaoplenaria:painel' object.pk %}" class="button secondary">{% trans 'Painel Eletrônico' %}</a></dd>
</dl>
{% endblock sections_nav %}

Loading…
Cancel
Save