Browse Source

Fix #2845 (#2846)

pull/2761/head
João Rodrigues 6 years ago
committed by Cesar Carvalho
parent
commit
3a6945dd7c
  1. 2
      sapl/materia/views.py
  2. 36
      sapl/templates/materia/materia_detail.html
  3. 30
      sapl/templates/materia/materialegislativa_detail.html

2
sapl/materia/views.py

@ -1681,7 +1681,7 @@ class MateriaLegislativaCrud(Crud):
class DetailView(Crud.DetailView):
layout_key = 'MateriaLegislativaDetail'
template_name = "materia/materia_detail.html"
template_name = "materia/materialegislativa_detail.html"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)

36
sapl/templates/materia/materia_detail.html

@ -1,36 +0,0 @@
{% extends "crud/detail.html" %}
{% load i18n %}
{% block detail_content %}
{{ block.super }}
{% if user.is_superuser %}
<div class="row">
{% if materia.user %}
<div class="col-sm-6">
<div id="div_id_user" class="form-group">
<p class="control-label">Usuário</p>
<div class="controls">
<div class="form-control-static">
<div class="dont-break-out">
<a href="{% url 'sapl.base:user_edit' materia.user.pk %}">{{materia.user}}</a>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% if materia.ip %}
<div class="col-sm-6">
<div id="div_ip_user" class="form-group">
<p class="control-label">IP</p>
<div class="controls">
<div class="form-control-static">
<div class="dont-break-out">{{materia.ip}}</div>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endif %}
{% endblock detail_content %}

30
sapl/templates/materia/materialegislativa_detail.html

@ -43,4 +43,34 @@
{% endfor %}
</div>
{% endif %}
{% if user.is_superuser %}
<div class="row">
{% if materia.user %}
<div class="col-sm-6">
<div id="div_id_user" class="form-group">
<p class="control-label">Usuário</p>
<div class="controls">
<div class="form-control-static">
<div class="dont-break-out">
<a href="{% url 'sapl.base:user_edit' materia.user.pk %}">{{materia.user}}</a>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% if materia.ip %}
<div class="col-sm-6">
<div id="div_ip_user" class="form-group">
<p class="control-label">IP</p>
<div class="controls">
<div class="form-control-static">
<div class="dont-break-out">{{materia.ip}}</div>
</div>
</div>
</div>
</div>
{% endif %}
</div>
{% endif %}
{% endblock detail_content %}

Loading…
Cancel
Save