From c9f05e6a742d1e7144bde7f7020b66cf3558f25b Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Tue, 21 Nov 2017 11:09:38 -0200 Subject: [PATCH] Fix #1447 --- sapl/compilacao/views.py | 14 ++++++++- .../compilacao/publicacao_detail.html | 30 +++++++++---------- .../templates/compilacao/publicacao_list.html | 6 ++++ sapl/templates/crud/confirm_delete.html | 5 ++-- 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/sapl/compilacao/views.py b/sapl/compilacao/views.py index e6c402a77..878c21b06 100644 --- a/sapl/compilacao/views.py +++ b/sapl/compilacao/views.py @@ -830,7 +830,7 @@ class PublicacaoListView(PublicacaoMixin, ListView): @property def title(self): - return _('%s de %s' % ( + return _('%s (%s)' % ( self.model._meta.verbose_name_plural, self.ta)) @@ -846,6 +846,8 @@ class PublicacaoListView(PublicacaoMixin, ListView): def get_context_data(self, **kwargs): context = super(PublicacaoListView, self).get_context_data(**kwargs) + context['title'] = self.title + context['object'] = self.ta context['NO_ENTRIES_MSG'] = CrudListView.no_entries_msg return context @@ -879,6 +881,16 @@ class PublicacaoDetailView(PublicacaoMixin, DetailView): model = Publicacao permission_required = [] + @property + def list_url(self): + return reverse_lazy('sapl.compilacao:ta_pub_list', + kwargs={ + 'ta_id': self.kwargs['ta_id']}) + + @property + def verbose_name_plural(self): + return self.model._meta.verbose_name_plural + class PublicacaoUpdateView(PublicacaoMixin, UpdateView): model = Publicacao diff --git a/sapl/templates/compilacao/publicacao_detail.html b/sapl/templates/compilacao/publicacao_detail.html index 985ceed05..949eb668b 100644 --- a/sapl/templates/compilacao/publicacao_detail.html +++ b/sapl/templates/compilacao/publicacao_detail.html @@ -1,22 +1,23 @@ -{% extends "base.html" %} +{% extends "crud/detail.html" %} {% load i18n %} {% load compilacao_filters %} {% load common_tags %} -{% block base_content %} -
- {% block actions %} - - {% endblock actions %} -
-
- {% block sections_nav %} - {% endblock %} -
+{% block sections_nav %} + +{% endblock %} +{% block editions %} +
+ {% trans 'Editar' %} + {% trans 'Excluir' %} +
+{% endblock editions %} + + {% block detail_content %} {# TODO replace fieldset for something semantically correct, but with similar visual grouping style #}
{%trans 'Identificação Básica'%} @@ -89,4 +90,3 @@
{% endblock detail_content %} -{% endblock base_content %} diff --git a/sapl/templates/compilacao/publicacao_list.html b/sapl/templates/compilacao/publicacao_list.html index 975fbf1f4..11c5e452a 100644 --- a/sapl/templates/compilacao/publicacao_list.html +++ b/sapl/templates/compilacao/publicacao_list.html @@ -3,6 +3,12 @@ {% load compilacao_filters %} {% load common_tags %} +{% block sections_nav %} + +{% endblock %} + {% block base_content %} {% if perms.compilacao.add_publicacao %} diff --git a/sapl/templates/crud/confirm_delete.html b/sapl/templates/crud/confirm_delete.html index af680112b..f41a4c76a 100644 --- a/sapl/templates/crud/confirm_delete.html +++ b/sapl/templates/crud/confirm_delete.html @@ -7,8 +7,9 @@
{% blocktrans %} - Confirma exclusão de "{{ object }}"? - {% endblocktrans %} + Confirma exclusão de + {% endblocktrans %}
+ "{{ object|safe }}"?