Browse Source

Add vanilla views to project and refactor views

pull/11/merge
Edward Ribeiro 9 years ago
parent
commit
42dc70d965
  1. 7
      protocoloadm/proposicoes_naorecebidas.html
  2. 10
      protocoloadm/views.py
  3. 1
      requirements/requirements.txt
  4. 1
      templates/protocoloadm/anular_protocoloadm.html
  5. 2
      templates/sessao/materia_ordemdia_edit.html

7
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 %}

10
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

1
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

1
templates/protocoloadm/anular_protocoloadm.html

@ -1,5 +1,6 @@
{% extends "protocoloadm/protocoloadm_detail.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block detail_content %}
<div>{{ message }} </div>
<form method="POST">

2
templates/sessao/materia_ordemdia_edit.html

@ -1,6 +1,6 @@
{% extends "sessao/sessaoplenaria_detail.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block detail_content %}
<div>
{{ error_message }}

Loading…
Cancel
Save