diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index 73d71faa8..3d906e446 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -63,6 +63,16 @@ def sort_by_keys(value, key): return transformed +@register.filter +def paginacao_limite_inferior(pagina): + return (int(pagina) - 1) * 10 + + +@register.filter +def paginacao_limite_superior(pagina): + return int(pagina) * 10 + + @register.filter def lookup(d, key): return d[key] if key in d else [] diff --git a/sapl/materia/views.py b/sapl/materia/views.py index f2e3e76db..fcfa15677 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -426,6 +426,10 @@ class ProposicaoPendente(PermissionRequiredMixin, ListView): def get_context_data(self, **kwargs): context = super(ProposicaoPendente, self).get_context_data(**kwargs) + context['object_list'] = Proposicao.objects.filter( + data_envio__isnull=False, + data_recebimento__isnull=True, + data_devolucao__isnull=True) paginator = context['paginator'] page_obj = context['page_obj'] context['AppConfig'] = sapl.base.models.AppConfig.objects.all().last() @@ -434,6 +438,8 @@ class ProposicaoPendente(PermissionRequiredMixin, ListView): context['NO_ENTRIES_MSG'] = 'Nenhuma proposição pendente.' context['subnav_template_name'] = 'materia/subnav_prop.yaml' + qr = self.request.GET.copy() + context['filter_url'] = ('&o=' + qr['o']) if 'o' in qr.keys() else '' return context diff --git a/sapl/templates/materia/prop_pendentes_list.html b/sapl/templates/materia/prop_pendentes_list.html index 518ba7601..251c4ed22 100644 --- a/sapl/templates/materia/prop_pendentes_list.html +++ b/sapl/templates/materia/prop_pendentes_list.html @@ -39,24 +39,33 @@ {% define object_list as list %} {% endif %} + {% if 'page' in request.GET %} + {% define request.GET.page as pagina %} + {% else %} + {% define '1' as pagina %} + {% endif %} + {% for prop in list %} -