Browse Source

Add linsting for Proposicoes Incorporadas, Não Incorporadas e Recebidas

pull/11/merge
Edward Ribeiro 9 years ago
parent
commit
eb4f98620f
  1. 30
      protocoloadm/views.py
  2. 51
      templates/protocoloadm/proposicoes_incorporadas.html
  3. 51
      templates/protocoloadm/proposicoes_naoincorporadas.html
  4. 51
      templates/protocoloadm/proposicoes_naorecebidas.html

30
protocoloadm/views.py

@ -14,7 +14,7 @@ from django.views.generic.base import TemplateView
from django.views.generic.edit import FormMixin from django.views.generic.edit import FormMixin
from vanilla import GenericView from vanilla import GenericView
from materia.models import TipoMateriaLegislativa from materia.models import Proposicao, TipoMateriaLegislativa
from sapl.crud import build_crud from sapl.crud import build_crud
from .models import (Autor, DocumentoAcessorioAdministrativo, from .models import (Autor, DocumentoAcessorioAdministrativo,
@ -449,7 +449,8 @@ class ProtocoloMateriaForm(forms.Form):
widget=forms.Textarea, label='Ementa', required=True) widget=forms.Textarea, label='Ementa', required=True)
autor = forms.CharField(label='Autor', required=True) autor = forms.CharField(label='Autor', required=True)
observacao = forms.CharField(required=True, observacao = forms.CharField(required=True,
widget=forms.Textarea, label='Observação') widget=forms.Textarea,
label='Observação')
class ProtocoloMateriaView(FormMixin, GenericView): class ProtocoloMateriaView(FormMixin, GenericView):
@ -506,13 +507,32 @@ class ProposicaoReceberView(TemplateView):
template_name = "protocoloadm/proposicao_receber.html" template_name = "protocoloadm/proposicao_receber.html"
class ProposicoesNaoRecebidasView(TemplateView): class ProposicoesNaoRecebidasView(ListView):
template_name = "protocoloadm/proposicoes_naorecebidas.html" template_name = "protocoloadm/proposicoes_naorecebidas.html"
model = Proposicao
paginate_by = 10
def get_queryset(self):
return Proposicao.objects.filter(data_envio__isnull=False, status='E')
class ProposicoesNaoIncorporadasView(TemplateView):
class ProposicoesNaoIncorporadasView(ListView):
template_name = "protocoloadm/proposicoes_naoincorporadas.html" template_name = "protocoloadm/proposicoes_naoincorporadas.html"
model = Proposicao
paginate_by = 10
def get_queryset(self):
return Proposicao.objects.filter(data_envio__isnull=False,
data_devolucao__isnull=False,
status='D')
class ProposicoesIncorporadasView(TemplateView):
class ProposicoesIncorporadasView(ListView):
template_name = "protocoloadm/proposicoes_incorporadas.html" template_name = "protocoloadm/proposicoes_incorporadas.html"
model = Proposicao
paginate_by = 10
def get_queryset(self):
return Proposicao.objects.filter(data_envio__isnull=False,
data_recebimento__isnull=False,
status='I')

51
templates/protocoloadm/proposicoes_incorporadas.html

@ -3,5 +3,54 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block detail_content %} {% block detail_content %}
Proposições Incorporadas <h2>Proposições Incorporadas</h2>
<table>
{% for p in object_list %}
<tr>
<td>
{{ p.data_envio|date:"d/m/Y" }}
</td>
<td>
{{ p.tipo.descricao }}
</td>
<td>
{{ p.descricao }}
</td>
<td>
{{ p.autor }}
</td>
</tr>
{% endfor %}
</table>
{% if is_paginated %}
<nav class="pagination-centered">
<ul class="pagination">
{% if page_obj.has_previous %}
<li>
<a href="?page={{ page_obj.previous_page_number }}">
<span class="arrow">&laquo;</span>
</a>
</li>
{% else %}
<li class="arrow unavailable"><a href="">&laquo;</a></li>
{% endif %}
{% for page in paginator.page_range %}
<li {% if page == page_obj.number %}class="active current"{% endif %}>
<a href="?page={{ page }}">{{ page }}</a>
</li>
{% endfor %}
{% if page_obj.has_next %}
<li>
<a href="?page={{ page_obj.next_page_number }}">
<span class="arrow">&raquo;</span>
</a>
</li>
{% else %}
<li class="arrow unavailable"><a href="">&raquo;</a></li>
{% endif %}
</ul>
</nav>
{% endif %}
{% endblock detail_content %} {% endblock detail_content %}

51
templates/protocoloadm/proposicoes_naoincorporadas.html

@ -3,5 +3,54 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block detail_content %} {% block detail_content %}
Receber Não Incorporadas <h2>Proposições Não Incorporadas</h2>
<table>
{% for p in object_list %}
<tr>
<td>
{{ p.data_envio|date:"d/m/Y" }}
</td>
<td>
{{ p.tipo.descricao }}
</td>
<td>
{{ p.descricao }}
</td>
<td>
{{ p.autor }}
</td>
</tr>
{% endfor %}
</table>
{% if is_paginated %}
<nav class="pagination-centered">
<ul class="pagination">
{% if page_obj.has_previous %}
<li>
<a href="?page={{ page_obj.previous_page_number }}">
<span class="arrow">&laquo;</span>
</a>
</li>
{% else %}
<li class="arrow unavailable"><a href="">&laquo;</a></li>
{% endif %}
{% for page in paginator.page_range %}
<li {% if page == page_obj.number %}class="active current"{% endif %}>
<a href="?page={{ page }}">{{ page }}</a>
</li>
{% endfor %}
{% if page_obj.has_next %}
<li>
<a href="?page={{ page_obj.next_page_number }}">
<span class="arrow">&raquo;</span>
</a>
</li>
{% else %}
<li class="arrow unavailable"><a href="">&raquo;</a></li>
{% endif %}
</ul>
</nav>
{% endif %}
{% endblock detail_content %} {% endblock detail_content %}

51
templates/protocoloadm/proposicoes_naorecebidas.html

@ -3,5 +3,54 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block detail_content %} {% block detail_content %}
Proposições Não Recebidas <h2>Proposições Não Recebidas</h2>
<table>
{% for p in object_list %}
<tr>
<td>
{{ p.data_envio|date:"d/m/Y" }}
</td>
<td>
{{ p.tipo.descricao }}
</td>
<td>
{{ p.descricao }}
</td>
<td>
{{ p.autor }}
</td>
</tr>
{% endfor %}
</table>
{% if is_paginated %}
<nav class="pagination-centered">
<ul class="pagination">
{% if page_obj.has_previous %}
<li>
<a href="?page={{ page_obj.previous_page_number }}">
<span class="arrow">&laquo;</span>
</a>
</li>
{% else %}
<li class="arrow unavailable"><a href="">&laquo;</a></li>
{% endif %}
{% for page in paginator.page_range %}
<li {% if page == page_obj.number %}class="active current"{% endif %}>
<a href="?page={{ page }}">{{ page }}</a>
</li>
{% endfor %}
{% if page_obj.has_next %}
<li>
<a href="?page={{ page_obj.next_page_number }}">
<span class="arrow">&raquo;</span>
</a>
</li>
{% else %}
<li class="arrow unavailable"><a href="">&raquo;</a></li>
{% endif %}
</ul>
</nav>
{% endif %}
{% endblock detail_content %} {% endblock detail_content %}
Loading…
Cancel
Save