Browse Source

Remove controlador painel

pull/1276/head
Edward Ribeiro 8 years ago
parent
commit
49c3c8428c
  1. 6
      sapl/painel/urls.py
  2. 21
      sapl/painel/views.py
  3. 28
      sapl/templates/painel/controlador.html

6
sapl/painel/urls.py

@ -1,8 +1,8 @@
from django.conf.urls import url
from .apps import AppConfig
from .views import (controlador_painel, cronometro_painel, get_dados_painel,
painel_mensagem_view, painel_parlamentar_view, painel_view,
from .views import (cronometro_painel, get_dados_painel, painel_mensagem_view,
painel_parlamentar_view, painel_view,
painel_votacao_view, votante_view)
app_name = AppConfig.name
@ -11,8 +11,6 @@ urlpatterns = [
url(r'^painel-principal/(?P<pk>\d+)$', painel_view,
name="painel_principal"),
url(r'^painel/(?P<pk>\d+)/dados$', get_dados_painel, name='dados_painel'),
url(r'^painel/controlador$',
controlador_painel, name='painel_controlador'),
url(r'^painel/mensagem$', painel_mensagem_view, name="painel_mensagem"),
url(r'^painel/parlamentar$', painel_parlamentar_view,
name='painel_parlamentar'),

21
sapl/painel/views.py

@ -219,27 +219,6 @@ def votante_view(request):
return render(request, 'painel/voto_nominal.html', context)
@user_passes_test(check_permission)
def controlador_painel(request):
painel_created = Painel.objects.get_or_create(data_painel=date.today())
painel = painel_created[0]
if request.method == 'POST':
if 'start-painel' in request.POST:
painel.aberto = True
painel.save()
elif 'stop-painel' in request.POST:
painel.aberto = False
painel.save()
elif 'save-painel' in request.POST:
painel.mostrar = request.POST['tipo_painel']
painel.save()
context = {'painel': painel, 'PAINEL_TYPES': Painel.PAINEL_TYPES}
return render(request, 'painel/controlador.html', context)
@user_passes_test(check_permission)
def painel_view(request, pk):
context = {'head_title': str(_('Painel Plenário')), 'sessao_id': pk}

28
sapl/templates/painel/controlador.html

@ -1,28 +0,0 @@
{% extends 'base.html' %}
{% load i18n %}
{% block base_content %}
STATUS:
{% if painel.aberto %}
ABERTO
{% else %}
FECHADO
{% endif %}
<br/>
<form method="post">
{% csrf_token %}
Tipo de painel: {{ painel.get_mostrar_display }}</br>
{% for id, value in PAINEL_TYPES %}
<input type="radio" name="tipo_painel" id="tipo_painel{{ forloop.counter }}" value="{{ id }}" {% if id == painel.mostrar %}checked="checked" {% endif %}>
<label for="tipo_painel{{ forloop.counter }}">{{ value }}</label><br />
{% endfor %}
</br>
<input type="submit" name="start-painel" value="Abrir Painel" class="button primary">
<input type="submit" name="stop-painel" value="Fechar Painel" class="button primary">
<input type="submit" name="save-painel" value="Salvar" class="button primary">
</form>
</br>
</br>
<a class="btn btn-primary" href="{{request.META.HTTP_REFERER}}">Voltar</a>
{% endblock %}
Loading…
Cancel
Save