From 42dc70d96546c37d09abbce1550f0707eb47316c Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 16 Oct 2015 11:11:04 -0300 Subject: [PATCH] Add vanilla views to project and refactor views --- protocoloadm/proposicoes_naorecebidas.html | 7 +++++++ protocoloadm/views.py | 10 ++++++---- requirements/requirements.txt | 1 + templates/protocoloadm/anular_protocoloadm.html | 1 + templates/sessao/materia_ordemdia_edit.html | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 protocoloadm/proposicoes_naorecebidas.html diff --git a/protocoloadm/proposicoes_naorecebidas.html b/protocoloadm/proposicoes_naorecebidas.html new file mode 100644 index 000000000..e3fb2fa99 --- /dev/null +++ b/protocoloadm/proposicoes_naorecebidas.html @@ -0,0 +1,7 @@ +{% extends "protocoloadm/protocoloadm_detail.html" %} +{% load i18n %} +{% load crispy_forms_tags %} + +{% block detail_content %} + Proposições Não Recebidas +{% endblock detail_content %} \ No newline at end of file diff --git a/protocoloadm/views.py b/protocoloadm/views.py index 39c049a8d..8b54c8def 100644 --- a/protocoloadm/views.py +++ b/protocoloadm/views.py @@ -13,6 +13,8 @@ from django.views.generic import ListView from django.views.generic.base import TemplateView from django.views.generic.edit import FormMixin +from vanilla import GenericView + from materia.models import TipoMateriaLegislativa from sapl.crud import build_crud @@ -176,7 +178,7 @@ class ProtocoloForm(forms.Form): assunto = forms.CharField(label='Assunto', required=False) -class ProtocoloPesquisaView(TemplateView, FormMixin): +class ProtocoloPesquisaView(FormMixin, GenericView): template_name = 'protocoloadm/protocolo_pesquisa.html' form_class = ProtocoloForm() context_object_name = 'protocolos' @@ -277,7 +279,7 @@ def get_client_ip(request): return ip -class AnularProtocoloAdmView(FormMixin, TemplateView): +class AnularProtocoloAdmView(FormMixin, GenericView): template_name = 'protocoloadm/anular_protocoloadm.html' def get_success_url(self): @@ -368,7 +370,7 @@ class ProtocoloDocumentForm(forms.Form): widget=forms.Textarea, label='Observação') -class ProtocoloDocumentoView(FormMixin, TemplateView): +class ProtocoloDocumentoView(FormMixin, GenericView): template_name = "protocoloadm/protocolar_documento.html" model = Protocolo @@ -451,7 +453,7 @@ class ProtocoloMateriaForm(forms.Form): widget=forms.Textarea, label='Observação') -class ProtocoloMateriaView(FormMixin, TemplateView): +class ProtocoloMateriaView(FormMixin, GenericView): template_name = "protocoloadm/protocolar_materia.html" model = Protocolo diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 6132a663b..80547dc4c 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -7,6 +7,7 @@ django-braces django-compressor django-crispy-forms django-extra-views +django-vanilla-views git+git://github.com/interlegis/django-sass-processor.git libsass psycopg2 diff --git a/templates/protocoloadm/anular_protocoloadm.html b/templates/protocoloadm/anular_protocoloadm.html index 4cd744f45..ca7055dc1 100644 --- a/templates/protocoloadm/anular_protocoloadm.html +++ b/templates/protocoloadm/anular_protocoloadm.html @@ -1,5 +1,6 @@ {% extends "protocoloadm/protocoloadm_detail.html" %} {% load i18n %} +{% load crispy_forms_tags %} {% block detail_content %}
{{ message }}
diff --git a/templates/sessao/materia_ordemdia_edit.html b/templates/sessao/materia_ordemdia_edit.html index 8466d9760..660a58291 100644 --- a/templates/sessao/materia_ordemdia_edit.html +++ b/templates/sessao/materia_ordemdia_edit.html @@ -1,6 +1,6 @@ {% extends "sessao/sessaoplenaria_detail.html" %} {% load i18n %} - +{% load crispy_forms_tags %} {% block detail_content %}
{{ error_message }}