mirror of https://github.com/interlegis/sapl.git
Browse Source
* Adicionar user e ip em MatériaLegislativa * Refatorar Matéria Detail * Refatorar cód. que verifica alteraçõespull/2824/head
João Rodrigues
6 years ago
committed by
Cesar Carvalho
5 changed files with 121 additions and 2 deletions
@ -0,0 +1,28 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.11.20 on 2019-05-21 14:48 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.conf import settings |
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
||||
|
('materia', '0049_pautareuniao'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AddField( |
||||
|
model_name='materialegislativa', |
||||
|
name='ip', |
||||
|
field=models.CharField(blank=True, default='', max_length=30, verbose_name='IP'), |
||||
|
), |
||||
|
migrations.AddField( |
||||
|
model_name='materialegislativa', |
||||
|
name='user', |
||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Usuário'), |
||||
|
), |
||||
|
] |
@ -0,0 +1,36 @@ |
|||||
|
{% 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 %} |
Loading…
Reference in new issue