Browse Source

Fix #1447

pull/1607/head
LeandroRoberto 7 years ago
parent
commit
c9f05e6a74
  1. 14
      sapl/compilacao/views.py
  2. 30
      sapl/templates/compilacao/publicacao_detail.html
  3. 6
      sapl/templates/compilacao/publicacao_list.html
  4. 5
      sapl/templates/crud/confirm_delete.html

14
sapl/compilacao/views.py

@ -830,7 +830,7 @@ class PublicacaoListView(PublicacaoMixin, ListView):
@property
def title(self):
return _('%s de %s' % (
return _('%s <small>(%s)</small>' % (
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

30
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 %}
<div class="clearfix">
{% block actions %}
<div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.compilacao:ta_pub_edit' object.ta.pk object.pk %}" class="btn btn-default">{% trans 'Editar' %}</a>
<a href="{% url 'sapl.compilacao:ta_pub_delete' object.ta.pk object.pk %}" class="btn btn-default btn-excluir">{% trans 'Excluir' %}</a>
</div>
{% endblock actions %}
</div>
<div class="actions btn-group pull-right" role="group">
{% block sections_nav %}
{% endblock %}
</div>
{% block sections_nav %}
<ul class="nav nav-pills navbar-right">
<li><a href="{% url 'sapl.compilacao:ta_text' object.ta.pk %}">{% trans 'Voltar para Texto' %}</a></li>
</ul>
{% endblock %}
{% block editions %}
<div class="actions btn-group pull-right" role="group">
<a href="{% url 'sapl.compilacao:ta_pub_edit' object.ta.pk object.pk %}" class="btn btn-default">{% trans 'Editar' %}</a>
<a href="{% url 'sapl.compilacao:ta_pub_delete' object.ta.pk object.pk %}" class="btn btn-default btn-excluir">{% trans 'Excluir' %}</a>
</div>
{% endblock editions %}
</div>
{% block detail_content %} {# TODO replace fieldset for something semantically correct, but with similar visual grouping style #}
<fieldset>
<legend>{%trans 'Identificação Básica'%}</legend>
@ -89,4 +90,3 @@
</div>
</fieldset>
{% endblock detail_content %}
{% endblock base_content %}

6
sapl/templates/compilacao/publicacao_list.html

@ -3,6 +3,12 @@
{% load compilacao_filters %}
{% load common_tags %}
{% block sections_nav %}
<ul class="nav nav-pills navbar-right">
<li><a href="{% url 'sapl.compilacao:ta_text' object.pk %}">{% trans 'Voltar para Texto' %}</a></li>
</ul>
{% endblock %}
{% block base_content %}
{% if perms.compilacao.add_publicacao %}

5
sapl/templates/crud/confirm_delete.html

@ -7,8 +7,9 @@
<div class="panel panel-danger">
<div class="panel-heading text-center">
{% blocktrans %}
Confirma exclusão de "{{ object }}"?
{% endblocktrans %}
Confirma exclusão de
{% endblocktrans %}<br>
"{{ object|safe }}"?
</div>
<div class="panel-body text-center">
<a href="{{ view.cancel_url }}" class="btn btn-inverse">{% trans 'Cancelar' %}</a>

Loading…
Cancel
Save