Browse Source

Tela votacao em bloco.

pull/2416/head
AndreSouto 7 years ago
parent
commit
43cb2400e9
  1. 11
      sapl/sessao/views.py
  2. 54
      sapl/templates/sessao/votacao/votacao_nominal_bloco.html

11
sapl/sessao/views.py

@ -3427,7 +3427,6 @@ class VotacaoEmBlocoNominalView(TemplateView):
sessao_plenaria_id=kwargs['pk'])
context.update({'expedientes':expedientes})
total = presentes.count()
import ipdb; ipdb.set_trace()
context.update({'parlamentares':self.get_parlamentares(request)})
return self.render_to_response(context)
@ -3438,14 +3437,16 @@ class VotacaoEmBlocoNominalView(TemplateView):
presencas = PresencaOrdemDia.objects.filter(
sessao_plenaria_id=self.kwargs['pk'])
ordens_id = request.POST.getlist('marcadas_id_2')
voto_parlamentar = VotoParlamentar.objects.filter(
ordem=self.kwargs['oid']) #TODO
for oid in ordens_id:
voto_parlamentar = VotoParlamentar.objects.filter(
ordem=oid) #TODO
else:
presencas = PresencaOrdemDia.objects.filter(
sessao_plenaria_id=self.kwargs['pk'])
expedientes_id = request.POST.getlist('marcadas_id_2')
voto_parlamentar = VotoParlamentar.objects.filter(
expediente=self.kwargs['oid']) #TODO
for eid in expedientes_id:
voto_parlamentar = VotoParlamentar.objects.filter(
expediente=eid) #TODO
presentes = [p.parlamentar for p in presencas]

54
sapl/templates/sessao/votacao/votacao_nominal_bloco.html

@ -26,42 +26,42 @@
<br />
{% endfor %}
{% endif %}
{% comment %} {% if total == 0 %}
{% if total == 0 %}
<div class="alert alert-info alert-dismissible fade in" role="alert">
<div>Não existe nenhum parlamentar presente para que a votação ocorra.</div>
</div>
<a href="{% url 'sapl.sessao:sessaoplenaria_detail' object.pk %}" class="btn btn-warning">Voltar</a>
{% else %} {% endcomment %}
<fieldset class="form-group">
<legend>Votos</legend>
<div class="row">
{% for parlamentar in parlamentares %}
<div class="col-md-4" id="styleparlamentar">{{parlamentar.0.parlamentar.nome_parlamentar}}</div>
<div class="col-md-5">
{% if parlamentar.1 %} <input type="hidden" name="voto_parlamentar" value="{{parlamentar.1}}:{{parlamentar.0.parlamentar.id}}" /> {% endif %}
<select id="voto_parlamentar" name="voto_parlamentar" class="form-control" {% if parlamentar.1 %} disabled {% endif %}>
<option value="Não Votou:{{parlamentar.0.parlamentar.id}}">Não Votou</option>
<option value="Sim:{{parlamentar.0.parlamentar.id}}" {% if parlamentar.1 == 'Sim' %} selected {% endif %}>Sim</option>
<option value="Não:{{parlamentar.0.parlamentar.id}}" {% if parlamentar.1 == 'Não' %} selected {% endif %}>Não</option>
<option value="Abstenção:{{parlamentar.0.parlamentar.id}}" {% if parlamentar.1 == 'Abstenção' %} selected {% endif %}>Abstenção</option>
</select>
</div>
{% endfor %}
</div>
<legend>Situação da Votação:</legend>
<div id="soma_votos"></div>
{% else %}
<fieldset class="form-group">
<legend>Votos</legend>
<div class="row">
{% for parlamentar in parlamentares %}
<div class="col-md-4" id="styleparlamentar">{{parlamentar.0.nome_parlamentar}}</div>
<div class="col-md-5">
{% if parlamentar.1 %} <input type="hidden" name="voto_parlamentar" value="{{parlamentar.1}}:{{parlamentar.0.id}}" /> {% endif %}
<select id="voto_parlamentar" name="voto_parlamentar" class="form-control" {% if parlamentar.1 %} disabled {% endif %}>
<option value="Não Votou:{{parlamentar.0.id}}">Não Votou</option>
<option value="Sim:{{parlamentar.0.id}}" {% if parlamentar.1 == 'Sim' %} selected {% endif %}>Sim</option>
<option value="Não:{{parlamentar.0.id}}" {% if parlamentar.1 == 'Não' %} selected {% endif %}>Não</option>
<option value="Abstenção:{{parlamentar.0.id}}" {% if parlamentar.1 == 'Abstenção' %} selected {% endif %}>Abstenção</option>
</select>
</div>
{% endfor %}
</div>
<legend>Situação da Votação:</legend>
<div id="soma_votos"></div>
</fieldset>
{% comment %} <div class="row">
<div class="row">
<div class="col-md-12">
{{ form.resultado_votacao|as_crispy_field }}
</div>
</div> {% endcomment %}
</div>
<br />
<div class="row">
@ -76,7 +76,7 @@
<input type="submit" id="cancelar-votacao" name="cancelar-votacao" value="Cancelar Votação" class="btn btn-warning" />
</fieldset>
</form>
{% comment %} {% endif %} {% endcomment %}
{% endif %}
{% endblock detail_content %}
{% block extra_js %}

Loading…
Cancel
Save