Browse Source

Documento Acessório Restrito em Documento Administrativo e em Matéria Legislativa

pull/3613/head
cristian-longhi 2 years ago
parent
commit
8b4cc63775
  1. 23
      sapl/materia/migrations/0082_auto_20220929_1450.py
  2. 23
      sapl/protocoloadm/migrations/0044_auto_20220923_0946.py
  3. 84
      sapl/templates/materia/documentoacessorio_detail.html
  4. 6
      sapl/templates/materia/documentoacessorio_list.html
  5. 95
      sapl/templates/protocoloadm/documentoacessorioadministrativo_detail.html
  6. 63
      sapl/templates/protocoloadm/documentoacessorioadministrativo_list.html

23
sapl/materia/migrations/0082_auto_20220929_1450.py

@ -0,0 +1,23 @@
# Generated by Django 2.2.28 on 2022-09-29 17:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('materia', '0081_auto_20220321_0934'),
]
operations = [
migrations.AddField(
model_name='documentoacessorio',
name='justificativa_restricao',
field=models.TextField(blank=True, verbose_name='Justificativa de Restrição'),
),
migrations.AddField(
model_name='documentoacessorio',
name='restrito',
field=models.BooleanField(blank=True, default=False, verbose_name='Restrito'),
),
]

23
sapl/protocoloadm/migrations/0044_auto_20220923_0946.py

@ -0,0 +1,23 @@
# Generated by Django 2.2.28 on 2022-09-23 12:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('protocoloadm', '0043_auto_20220919_1705'),
]
operations = [
migrations.AddField(
model_name='documentoacessorioadministrativo',
name='justificativa_restricao',
field=models.TextField(blank=True, verbose_name='Justificativa de Restrição'),
),
migrations.AddField(
model_name='documentoacessorioadministrativo',
name='restrito',
field=models.BooleanField(blank=True, default=False, verbose_name='Restrito'),
),
]

84
sapl/templates/materia/documentoacessorio_detail.html

@ -0,0 +1,84 @@
{% extends "crud/detail_detail.html" %}
{% load i18n common_tags %}
{% load tz %}
{% block detail_content %}
{% if not object.restrito or 'materia.change_documentoacessorio' in user.get_all_permissions %}
<div class="row">
<div class="col-sm-6">
<div id="div_id_tipo" class="form-group">
<p class="control-label">{%field_verbose_name object 'tipo'%}</p>
<div class="controls">
<div class="form-control-static">{{object.tipo}}</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div id="div_id_autor" class="form-group">
<p class="control-label">{%field_verbose_name object 'autor'%}</p>
<div class="controls">
<div class="form-control-static">{{object.autor}}</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div id="div_id_nome" class="form-group">
<p class="control-label">{%field_verbose_name object 'nome'%}</p>
<div class="controls">
<div class="form-control-static">{{object.nome}}</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div id="div_id_data" class="form-group">
<p class="control-label">{%field_verbose_name object 'data'%}</p>
<div class="controls">
<div class="form-control-static">{{object.data}}</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div id="div_id_arquivo" class="form-group">
<p class="control-label">{%field_verbose_name object 'arquivo'%}</p>
<div class="controls">
<div class="form-control-static">
{% if object.arquivo %}
<a href="{{object.arquivo.url}}">{{object.arquivo.name}}</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2">
<div id="div_id_restrito" class="form-group">
<p class="control-label">{%field_verbose_name object 'restrito'%}</p>
<div class="controls">
<div class="form-control-static">{% if object.restrito %}Sim{% else %}Não{% endif %}</div>
</div>
</div>
</div>
<div class="col-sm-10">
<div id="div_id_justificativa_restricao" class="form-group">
<p class="control-label">{%field_verbose_name object 'justificativa_restricao'%}</p>
<div class="controls">
<div class="form-control-static">{{object.justificativa_restricao}}</div>
</div>
</div>
</div>
</div>
{% else %}
<br><br>
<div class="alert alert-danger alert-dismissible" role="alert">
<h3>Documento restrito</h3>
{{ object.justificativa_restricao }}
</div>
{% endif %}
{% endblock detail_content %}

6
sapl/templates/materia/documentoacessorio_list.html

@ -11,9 +11,6 @@
<thead>
<tr>
{% for name in headers %}
{% comment %}
{% if name != 'Restrito' and name != 'Justificativa de Restrição' %}
{% endcomment %}
<th>
{% if view.ordered_list %}
<a title="{% trans 'Clique para alterar a ordem a listagem'%}" href="?o={% if 'o' not in request.GET and forloop.counter == 1 or 'o' in request.GET and forloop.counter|safe == request.GET.o %}-{%endif%}{{forloop.counter}}{{ordering_url}}">
@ -30,9 +27,6 @@
{{ name }}
{% endif %}
</th>
{% comment %}
{% endif %}
{% endcomment %}
{% endfor %}
</tr>
</thead>

95
sapl/templates/protocoloadm/documentoacessorioadministrativo_detail.html

@ -0,0 +1,95 @@
{% extends "crud/detail_detail.html" %}
{% load i18n common_tags %}
{% load tz %}
{% block detail_content %}
{% if not object.restrito and not doc_adm_restrito or 'protocoloadm.change_documentoacessorioadministrativo' in user.get_all_permissions %}
<div class="row">
<div class="col-sm-6">
<div id="div_id_tipo" class="form-group">
<p class="control-label">{%field_verbose_name object 'tipo'%}</p>
<div class="controls">
<div class="form-control-static">{{object.tipo}} </div>
</div>
</div>
</div>
<div class="col-sm-6">
<div id="div_id_autor" class="form-group">
<p class="control-label">{%field_verbose_name object 'autor'%}</p>
<div class="controls">
<div class="form-control-static">{{object.autor}}</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div id="div_id_nome" class="form-group">
<p class="control-label">{%field_verbose_name object 'nome'%}</p>
<div class="controls">
<div class="form-control-static">{{object.nome}}</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div id="div_id_data" class="form-group">
<p class="control-label">{%field_verbose_name object 'data'%}</p>
<div class="controls">
<div class="form-control-static">{{object.data}}</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div id="div_id_arquivo" class="form-group">
<p class="control-label">{%field_verbose_name object 'arquivo'%}</p>
<div class="controls">
<div class="form-control-static">
{% if object.arquivo %}
<a href="{{object.arquivo.url}}">{{object.arquivo.name}}</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div id="div_id_assunto" class="form-group">
<p class="control-label">{%field_verbose_name object 'assunto'%}</p>
<div class="controls">
<div class="form-control-static">{{object.assunto}}</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2">
<div id="div_id_restrito" class="form-group">
<p class="control-label">{%field_verbose_name object 'restrito'%}</p>
<div class="controls">
<div class="form-control-static">{% if object.restrito %}Sim{% else %}Não{% endif %}</div>
</div>
</div>
</div>
<div class="col-sm-10">
<div id="div_id_justificativa_restricao" class="form-group">
<p class="control-label">{%field_verbose_name object 'justificativa_restricao'%}</p>
<div class="controls">
<div class="form-control-static">{{object.justificativa_restricao}}</div>
</div>
</div>
</div>
</div>
{% else %}
<br><br>
<div class="alert alert-danger alert-dismissible" role="alert">
<h3>Documento restrito</h3>
{% if object.restrito %}
{{ object.justificativa_restricao }}
{% endif %}
</div>
{% endif %}
{% endblock detail_content %}

63
sapl/templates/protocoloadm/documentoacessorioadministrativo_list.html

@ -0,0 +1,63 @@
{% extends "crud/list.html" %}
{% load i18n common_tags crispy_forms_tags%}
{% block container_table_list %}
{% if not rows %}
<p>{{ NO_ENTRIES_MSG }}</p>
{% else %}
<div class="container-table">
<div class="result-count">{% blocktrans with verbose_name_plural=view.verbose_name_plural %}Total de {{ verbose_name_plural }}: <strong>{{count}}</strong>{% endblocktrans %}</div>
<table class="table table-striped table-hover table-link-ordering">
<thead>
<tr>
{% for name in headers %}
<th>
{% if view.ordered_list %}
<a title="{% trans 'Clique para alterar a ordem a listagem'%}" href="?o={% if 'o' not in request.GET and forloop.counter == 1 or 'o' in request.GET and forloop.counter|safe == request.GET.o %}-{%endif%}{{forloop.counter}}{{ordering_url}}">
{{ name }}
{% if 'o' in request.GET or not view.ordering %}
{% if 'o' not in request.GET and forloop.counter == 1 or 'o' in request.GET and forloop.counter|safe == request.GET.o %}
<span class="caret top" title="{% trans 'Listado na Ordem Ascendente'%}"></span>
{% elif 'o' in request.GET and forloop.counter == request.GET.o|str2intabs %}
<span class="caret" title="{% trans 'Listado na Ordem Descendente'%}"></span>
{% endif %}
{% endif %}
</a>
{% else %}
{{ name }}
{% endif %}
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for doc in object_list %}
<tr>
{% if not doc.restrito or 'protocoloadm.change_documentoacessorioadministrativo' in request.user.get_all_permissions %}
<td>
<a href="{% url 'sapl.protocoloadm:documentoacessorioadministrativo_detail' doc.id %}">{{ doc.nome }}</a>
</td>
<td>
{{ doc.tipo }}
</td>
<td>
{% if doc.data %}{{ doc.data }}{% endif %}
</td>
<td>
{% if doc.autor %}{{ doc.autor }}{% endif %}
</td>
<td>
{% if doc.assunto %}{{ doc.assunto }}{% endif %}
</td>
{% else %}
<td colspan=5>
<strong style="color: red">Documento Restrito</strong></br>{{ doc.justificativa_restricao|safe }}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% endblock container_table_list %}
Loading…
Cancel
Save