Browse Source

Merge branch '194-Documento_Protocolo'

pull/222/head
Marcio Mazza 9 years ago
parent
commit
edeef5dd4b
  1. 1
      materia/views.py
  2. 99
      protocoloadm/forms.py
  3. 19
      protocoloadm/migrations/0007_auto_20160218_1429.py
  4. 13
      protocoloadm/models.py
  5. 8
      protocoloadm/urls.py
  6. 170
      protocoloadm/views.py
  7. 74
      templates/protocoloadm/detail_doc_adm.html
  8. 12
      templates/protocoloadm/detail_doc_detail.html
  9. 51
      templates/protocoloadm/documento_acessorio_administrativo.html
  10. 7
      templates/protocoloadm/documento_acessorio_administrativo_edit.html
  11. 6
      templates/protocoloadm/protocolo_mostrar.html

1
materia/views.py

@ -775,7 +775,6 @@ class DocumentoAcessorioEditView(FormMixin, GenericView):
form = DocumentoAcessorioForm(request.POST) form = DocumentoAcessorioForm(request.POST)
materia = MateriaLegislativa.objects.get(id=kwargs['pk']) materia = MateriaLegislativa.objects.get(id=kwargs['pk'])
documento = DocumentoAcessorio.objects.get(id=kwargs['id']) documento = DocumentoAcessorio.objects.get(id=kwargs['id'])
if form.is_valid(): if form.is_valid():
if 'excluir' in request.POST: if 'excluir' in request.POST:
documento.delete() documento.delete()

99
protocoloadm/forms.py

@ -1,7 +1,7 @@
from datetime import date from datetime import date
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Field, Fieldset, Layout from crispy_forms.layout import HTML, Field, Fieldset, Layout, Submit
from django import forms from django import forms
from django.forms import ModelForm from django.forms import ModelForm
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
@ -11,7 +11,8 @@ from materia.models import TipoMateriaLegislativa
from sapl.layout import form_actions from sapl.layout import form_actions
from .models import (Autor, DocumentoAcessorioAdministrativo, from .models import (Autor, DocumentoAcessorioAdministrativo,
TipoDocumentoAdministrativo, TramitacaoAdministrativo) DocumentoAdministrativo, TipoDocumentoAdministrativo,
TramitacaoAdministrativo)
def get_range_anos(): def get_range_anos():
@ -19,6 +20,12 @@ def get_range_anos():
+ [(year, year) for year in range(date.today().year, 1960, -1)] + [(year, year) for year in range(date.today().year, 1960, -1)]
def tramitacao():
return [('', '--------'),
(True, 'Sim'),
(False, 'Não')]
TIPOS_PROTOCOLO = [('', 'Selecione'), TIPOS_PROTOCOLO = [('', 'Selecione'),
('0', 'Enviado'), ('0', 'Enviado'),
('1', 'Recebido')] ('1', 'Recebido')]
@ -82,14 +89,14 @@ class ProtocoloForm(forms.Form):
required=False, required=False,
queryset=TipoMateriaLegislativa.objects.all(), queryset=TipoMateriaLegislativa.objects.all(),
empty_label='Selecione', empty_label='Selecione',
) )
autor = forms.ModelChoiceField( autor = forms.ModelChoiceField(
label='Autor', label='Autor',
required=False, required=False,
queryset=Autor.objects.all().order_by('tipo'), queryset=Autor.objects.all().order_by('tipo'),
empty_label='Selecione', empty_label='Selecione',
) )
assunto = forms.CharField(label='Assunto', required=False) assunto = forms.CharField(label='Assunto', required=False)
@ -248,7 +255,7 @@ class ProtocoloMateriaForm(forms.Form):
required=False, required=False,
queryset=TipoMateriaLegislativa.objects.all(), queryset=TipoMateriaLegislativa.objects.all(),
empty_label='Selecione', empty_label='Selecione',
) )
num_paginas = forms.CharField(label='Núm. Páginas', required=True) num_paginas = forms.CharField(label='Núm. Páginas', required=True)
ementa = forms.CharField( ementa = forms.CharField(
@ -259,7 +266,7 @@ class ProtocoloMateriaForm(forms.Form):
required=False, required=False,
queryset=Autor.objects.all().order_by('tipo'), queryset=Autor.objects.all().order_by('tipo'),
empty_label='Selecione', empty_label='Selecione',
) )
observacao = forms.CharField(required=True, observacao = forms.CharField(required=True,
widget=forms.Textarea, widget=forms.Textarea,
@ -339,18 +346,29 @@ class DocumentoAcessorioAdministrativoForm(ModelForm):
'arquivo', 'arquivo',
'assunto'] 'assunto']
def __init__(self, *args, **kwargs): def __init__(self, excluir=False, *args, **kwargs):
row1 = sapl.layout.to_row(
[('tipo', 4),
('nome', 4),
('data', 4)])
row2 = sapl.layout.to_row(
[('autor', 12)])
row3 = sapl.layout.to_row(
[('arquivo', 12)])
row4 = sapl.layout.to_row(
[('assunto', 12)])
more = []
if excluir:
more = [Submit('Excluir', 'Excluir')]
self.helper = FormHelper() self.helper = FormHelper()
self.helper.layout = Layout( self.helper.layout = Layout(
Fieldset( Fieldset(
'Incluir Documento Acessório', 'Incluir Documento Acessório',
'tipo', row1, row2, row3, row4,
'nome', form_actions(more=more)
'data',
'autor',
'arquivo',
'assunto',
form_actions()
) )
) )
super(DocumentoAcessorioAdministrativoForm, self).__init__( super(DocumentoAcessorioAdministrativoForm, self).__init__(
@ -408,3 +426,56 @@ class TramitacaoAdmForm(ModelForm):
) )
super(TramitacaoAdmForm, self).__init__( super(TramitacaoAdmForm, self).__init__(
*args, **kwargs) *args, **kwargs)
class DocumentoAdministrativoForm(ModelForm):
class Meta:
model = DocumentoAdministrativo
fields = ['tipo',
'numero',
'ano',
'data',
'numero_protocolo',
'assunto',
'interessado',
'tramitacao',
'dias_prazo',
'data_fim_prazo',
'observacao',
'texto_integral',
]
def __init__(self, *args, **kwargs):
row1 = sapl.layout.to_row(
[('tipo', 4), ('numero', 4), ('ano', 4)])
row2 = sapl.layout.to_row(
[('data', 6), ('numero_protocolo', 6)])
row3 = sapl.layout.to_row(
[('assunto', 12)])
row4 = sapl.layout.to_row(
[('interessado', 9), ('tramitacao', 3)])
row5 = sapl.layout.to_row(
[('texto_integral', 12)])
row6 = sapl.layout.to_row(
[('dias_prazo', 6), ('data_fim_prazo', 6)])
row7 = sapl.layout.to_row(
[('observacao', 12)])
self.helper = FormHelper()
self.helper.layout = Layout(
Fieldset('Identificação Básica',
row1, row2, row3, row4, row5),
Fieldset('Outras Informações',
row6, row7),
form_actions(more=[Submit('Excluir', 'Excluir')]),
)
super(DocumentoAdministrativoForm, self).__init__(
*args, **kwargs)

19
protocoloadm/migrations/0007_auto_20160218_1429.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('protocoloadm', '0006_auto_20160216_1015'),
]
operations = [
migrations.AlterField(
model_name='documentoadministrativo',
name='tramitacao',
field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Em Tramitação?'),
),
]

13
protocoloadm/models.py

@ -2,7 +2,8 @@ from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from materia.models import Autor, TipoMateriaLegislativa, UnidadeTramitacao from materia.models import Autor, TipoMateriaLegislativa, UnidadeTramitacao
from sapl.utils import make_choices from sapl.utils import YES_NO_CHOICES, make_choices
from uuid import uuid4
class TipoDocumentoAdministrativo(models.Model): class TipoDocumentoAdministrativo(models.Model):
@ -17,12 +18,8 @@ class TipoDocumentoAdministrativo(models.Model):
return self.descricao return self.descricao
def get_docadm_media_path(instance, subpath, filename):
return './docadm/%s/%s/%s' % (instance, subpath, filename)
def texto_upload_path(instance, filename): def texto_upload_path(instance, filename):
return get_docadm_media_path(instance, 'DocAdm', filename) return '/'.join([instance._meta.model_name, str(uuid4()), filename])
class DocumentoAdministrativo(models.Model): class DocumentoAdministrativo(models.Model):
@ -40,7 +37,9 @@ class DocumentoAdministrativo(models.Model):
blank=True, null=True, verbose_name=_('Dias Prazo')) blank=True, null=True, verbose_name=_('Dias Prazo'))
data_fim_prazo = models.DateField( data_fim_prazo = models.DateField(
blank=True, null=True, verbose_name=_('Data Fim Prazo')) blank=True, null=True, verbose_name=_('Data Fim Prazo'))
tramitacao = models.BooleanField(verbose_name=_('Em Tramitação?')) tramitacao = models.BooleanField(
verbose_name=_('Em Tramitação?'),
choices=YES_NO_CHOICES)
assunto = models.TextField(verbose_name=_('Assunto')) assunto = models.TextField(verbose_name=_('Assunto'))
observacao = models.TextField( observacao = models.TextField(
blank=True, verbose_name=_('Observação')) blank=True, verbose_name=_('Observação'))

8
protocoloadm/urls.py

@ -1,8 +1,9 @@
from django.conf.urls import include, url from django.conf.urls import include, url
from protocoloadm.views import (AnularProtocoloAdmView, from protocoloadm.views import (AnularProtocoloAdmView,
ComprovanteProtocoloView, ComprovanteProtocoloView,
CriarDocumentoProtocolo,
DetailDocumentoAdministrativo, DetailDocumentoAdministrativo,
DocumentoAcessorioAdministrativoEditView,
DocumentoAcessorioAdministrativoView, DocumentoAcessorioAdministrativoView,
PesquisarDocumentoAdministrativo, PesquisarDocumentoAdministrativo,
ProposicaoDetailView, ProposicaoReceberView, ProposicaoDetailView, ProposicaoReceberView,
@ -54,6 +55,9 @@ urlpatterns = [
DetailDocumentoAdministrativo.as_view(), name='detail_doc_adm'), DetailDocumentoAdministrativo.as_view(), name='detail_doc_adm'),
url(r'^protocoloadm/doc-ace-adm/(?P<pk>\d+)', url(r'^protocoloadm/doc-ace-adm/(?P<pk>\d+)',
DocumentoAcessorioAdministrativoView.as_view(), name='doc_ace_adm'), DocumentoAcessorioAdministrativoView.as_view(), name='doc_ace_adm'),
url(r'^protocoloadm/doc-ace-adm/edit/(?P<pk>\d+)/(?P<ano>\d+)',
DocumentoAcessorioAdministrativoEditView.as_view(),
name='doc_ace_adm_edit'),
url(r'^protocoloadm/(?P<pk>\d+)/tramitacao$', url(r'^protocoloadm/(?P<pk>\d+)/tramitacao$',
TramitacaoAdmView.as_view(), name='tramitacao_adm'), TramitacaoAdmView.as_view(), name='tramitacao_adm'),
@ -66,6 +70,8 @@ urlpatterns = [
url(r'^protocoloadm/(?P<pk>\d+)/(?P<ano>\d+)/comprovante$', url(r'^protocoloadm/(?P<pk>\d+)/(?P<ano>\d+)/comprovante$',
ComprovanteProtocoloView.as_view(), name='comprovante_protocolo'), ComprovanteProtocoloView.as_view(), name='comprovante_protocolo'),
url(r'^protocoloadm/(?P<pk>\d+)/(?P<ano>\d+)/criar_documento$',
CriarDocumentoProtocolo.as_view(), name='criar_documento'),
# TODO: move to Proposicoes app # TODO: move to Proposicoes app

170
protocoloadm/views.py

@ -9,7 +9,7 @@ from django.http import HttpResponseRedirect
from django.shortcuts import redirect from django.shortcuts import redirect
from django.utils.html import strip_tags from django.utils.html import strip_tags
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.generic import DetailView, ListView from django.views.generic import CreateView, DetailView, ListView
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django.views.generic.edit import FormMixin from django.views.generic.edit import FormMixin
from vanilla import GenericView from vanilla import GenericView
@ -19,8 +19,9 @@ from materia.models import Proposicao, TipoMateriaLegislativa
from sapl.utils import create_barcode from sapl.utils import create_barcode
from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm, from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm,
ProposicaoSimpleForm, ProtocoloDocumentForm, ProtocoloForm, DocumentoAdministrativoForm, ProposicaoSimpleForm,
ProtocoloMateriaForm, TramitacaoAdmForm) ProtocoloDocumentForm, ProtocoloForm, ProtocoloMateriaForm,
TramitacaoAdmForm)
from .models import (Autor, DocumentoAcessorioAdministrativo, from .models import (Autor, DocumentoAcessorioAdministrativo,
DocumentoAdministrativo, Protocolo, DocumentoAdministrativo, Protocolo,
StatusTramitacaoAdministrativo, StatusTramitacaoAdministrativo,
@ -302,6 +303,41 @@ class ProtocoloDocumentoView(FormMixin, GenericView):
return self.form_invalid(form) return self.form_invalid(form)
def criar_documento(protocolo):
doc = {}
numero = Protocolo.objects.filter(
tipo_documento=protocolo.tipo_documento,
ano=protocolo.ano,
anulado=False).aggregate(Max('numero'))
doc['tipo'] = protocolo.tipo_documento
doc['ano'] = protocolo.ano
doc['data'] = protocolo.data
doc['numero_protocolo'] = protocolo.numero
doc['assunto'] = protocolo.assunto_ementa
doc['interessado'] = protocolo.interessado
doc['numero'] = numero['numero__max']
if doc['numero'] is None:
doc['numero'] = 1
return doc
class CriarDocumentoProtocolo(CreateView):
template_name = "protocoloadm/criar_documento.html"
form_class = DocumentoAdministrativoForm
def get_initial(self):
numero = self.kwargs['pk']
ano = self.kwargs['ano']
protocolo = Protocolo.objects.get(ano=ano, numero=numero)
return criar_documento(protocolo)
def get_success_url(self):
return reverse('detail_doc_adm', kwargs={'pk': self.object.pk})
class ProtocoloMostrarView(TemplateView): class ProtocoloMostrarView(TemplateView):
template_name = "protocoloadm/protocolo_mostrar.html" template_name = "protocoloadm/protocolo_mostrar.html"
@ -516,63 +552,88 @@ class PesquisarDocumentoAdministrativo(TemplateView):
class DetailDocumentoAdministrativo(DetailView): class DetailDocumentoAdministrativo(DetailView):
template_name = "protocoloadm/detail_doc_adm.html" template_name = "protocoloadm/detail_doc_adm.html"
def get_tipos_doc(self):
return TipoDocumentoAdministrativo.objects.all()
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
doc = DocumentoAdministrativo.objects.get(id=kwargs['pk']) documento = DocumentoAdministrativo.objects.get(
id=self.kwargs['pk'])
form = DocumentoAdministrativoForm(
instance=documento)
return self.render_to_response({ return self.render_to_response({
'pk': kwargs['pk'], 'form': form,
'doc': doc, 'pk': kwargs['pk']})
'tipos_doc': TipoDocumentoAdministrativo.objects.all()
})
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
if 'Salvar' in request.POST: if 'Salvar' in request.POST:
documento = DocumentoAdministrativo.objects.get(id=kwargs['pk']) form = DocumentoAdministrativoForm(request.POST)
if request.POST['numero']:
documento.numero = request.POST['numero']
if request.POST['ano']: if form.is_valid():
documento.ano = request.POST['ano'] doc = form.save(commit=False)
if 'texto_integral' in request.FILES:
if request.POST['data']: doc.texto_integral = request.FILES['texto_integral']
documento.data = datetime.strptime( doc.save()
request.POST['data'], "%d/%m/%Y") return self.form_valid(form)
else:
return self.render_to_response({'form': form})
elif 'Excluir' in request.POST:
DocumentoAdministrativo.objects.get(
id=kwargs['pk']).delete()
return HttpResponseRedirect(self.get_success_delete())
if request.POST['numero_protocolo']: return HttpResponseRedirect(self.get_success_url())
documento.numero_protocolo = request.POST['numero_protocolo']
if request.POST['assunto']: def get_success_delete(self):
documento.assunto = request.POST['assunto'] return reverse('pesq_doc_adm')
if request.POST['interessado']: def get_success_url(self):
documento.interessado = request.POST['interessado'] return reverse('detail_doc_adm', kwargs={
'pk': self.kwargs['pk']})
if request.POST['tramitacao']:
documento.tramitacao = request.POST['tramitacao']
if request.POST['dias_prazo']: class DocumentoAcessorioAdministrativoEditView(FormMixin, GenericView):
documento.dias_prazo = request.POST['dias_prazo'] template_name = "protocoloadm/documento_acessorio_administrativo_edit.html"
if request.POST['data_fim_prazo']: def get(self, request, *args, **kwargs):
documento.data_fim_prazo = datetime.strptime( doc = DocumentoAdministrativo.objects.get(
request.POST['data_fim_prazo'], "%d/%m/%Y") id=kwargs['pk'])
doc_ace = DocumentoAcessorioAdministrativo.objects.get(
id=kwargs['ano'])
form = DocumentoAcessorioAdministrativoForm(instance=doc_ace,
excluir=True)
if request.POST['observacao']: return self.render_to_response({'pk': self.kwargs['pk'],
documento.observacao = request.POST['observacao'] 'doc': doc,
'doc_ace': doc_ace,
'form': form})
documento.save() def post(self, request, *args, **kwargs):
elif 'Excluir' in request.POST: form = DocumentoAcessorioAdministrativoForm(request.POST, excluir=True)
DocumentoAdministrativo.objects.get( doc_ace = DocumentoAcessorioAdministrativo.objects.get(
id=kwargs['pk']).delete() id=kwargs['ano'])
return HttpResponseRedirect(self.get_success_url()) if form.is_valid():
if 'Salvar' in request.POST:
if 'arquivo' in request.FILES:
doc_ace.arquivo = request.FILES['arquivo']
doc_ace.documento = DocumentoAdministrativo.objects.get(
id=kwargs['pk'])
doc_ace.tipo = TipoDocumentoAdministrativo.objects.get(
id=form.data['tipo'])
doc_ace.nome = form.data['nome']
doc_ace.autor = form.data['autor']
doc_ace.data = datetime.strptime(
form.data['data'], '%d/%m/%Y')
doc_ace.assunto = form.data['assunto']
doc_ace.save()
elif 'Excluir' in request.POST:
doc_ace.delete()
return self.form_valid(form)
else:
return self.form_invalid(form)
def get_success_url(self): def get_success_url(self):
return reverse('pesq_doc_adm') pk = self.kwargs['pk']
return reverse('doc_ace_adm', kwargs={'pk': pk})
class DocumentoAcessorioAdministrativoView(FormMixin, GenericView): class DocumentoAcessorioAdministrativoView(FormMixin, GenericView):
@ -583,10 +644,9 @@ class DocumentoAcessorioAdministrativoView(FormMixin, GenericView):
doc = DocumentoAdministrativo.objects.get( doc = DocumentoAdministrativo.objects.get(
id=kwargs['pk']) id=kwargs['pk'])
doc_ace_null = '' doc_ace_null = ''
try: doc_acessorio = DocumentoAcessorioAdministrativo.objects.filter(
doc_acessorio = DocumentoAcessorioAdministrativo.objects.filter( documento_id=kwargs['pk'])
documento_id=kwargs['pk']) if not doc_acessorio:
except ObjectDoesNotExist:
doc_ace_null = 'Nenhum documento acessório \ doc_ace_null = 'Nenhum documento acessório \
cadastrado para este processo.' cadastrado para este processo.'
@ -599,17 +659,13 @@ class DocumentoAcessorioAdministrativoView(FormMixin, GenericView):
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
form = DocumentoAcessorioAdministrativoForm(request.POST) form = DocumentoAcessorioAdministrativoForm(request.POST)
if form.is_valid(): if form.is_valid():
doc_acessorio = DocumentoAcessorioAdministrativo() doc_ace = form.save(commit=False)
doc_acessorio.tipo = form.cleaned_data['tipo'] if 'arquivo' in request.FILES:
doc_acessorio.nome = form.cleaned_data['nome'] doc_ace.arquivo = request.FILES['arquivo']
doc_acessorio.data = form.cleaned_data['data'] doc = DocumentoAdministrativo.objects.get(
doc_acessorio.autor = form.cleaned_data['autor']
doc_acessorio.assunto = form.cleaned_data['assunto']
doc_acessorio.arquivo = request.FILES['arquivo']
doc_acessorio.documento = DocumentoAdministrativo.objects.get(
id=kwargs['pk']) id=kwargs['pk'])
doc_acessorio.save() doc_ace.documento = doc
doc_ace.save()
return self.form_valid(form) return self.form_valid(form)
else: else:
return self.form_invalid(form) return self.form_invalid(form)

74
templates/protocoloadm/detail_doc_adm.html

@ -3,77 +3,5 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block detail_content %} {% block detail_content %}
<fieldset> {% crispy form %}
<legend>Formulário de Cadastro</legend>
<form method="POST">
{% csrf_token %}
<fieldset>
<legend>Identificação Básica</legend>
<div class="row">
<div class="col-md-4"><b>Tipo Documento</b></div>
<div class="col-md-4"><b>Número</b></div>
<div class="col-md-4"><b>Ano</b></div>
</div>
<div class="row">
<div class="col-md-4">
<select name="tipo_documento" disabled>
{% for tipo in tipos_doc %}
{% if doc.tipo.id == tipo.id %}
<option value="{{ tipo }}" selected> {{ tipo.sigla }} - {{ tipo.descricao }} </option>
{% endif %}
{% endfor %}
</select>
</div>
<div class="col-md-4"><input type="text" name="numero" value="{{ doc.numero }}"/></div>
<div class="col-md-4"><input type="text" name="ano" value="{{ doc.ano }}"/></div>
</div>
<div class="row">
<div class="col-md-6"><b>Data</b></div>
<div class="col-md-6"><b>Núm. Protocolo</b></div>
</div>
<div class="row">
<div class="col-md-6"><input type="text" name="data" class="dateinput" value="{{ doc.data|date:"d/m/Y" }}"/></div>
<div class="col-md-6"><input type="text" name="numero_protocolo" value="{{ doc.numero_protocolo }}"/></div>
</div>
<div class="row">
<div class="col-md-12"><b>Assunto</b></div>
</div>
<div class="row">
<div class="col-md-12"><textarea rows="4" cols="50" name="assunto">{{ d.assunto }}</textarea></div>
</div>
<div class="row">
<div class="col-md-6"><b>Interessado</b></div>
<div class="col-md-6"><b>Em Tramitação?</b></div>
</div>
<div class="row">
<div class="col-md-6"><input type="text" name="interessado" value="{{ doc.interessado }}"/></div>
<div class="col-md-6">
<select name="tramitacao">
<option value="True" {% if doc.tramitacao == True %} selected {% endif %} > Sim </option>
<option value="False" {% if doc.tramitacao == False %} selected {% endif %}> Não </option>
</select>
</div>
</div>
</fieldset>
<fieldset>
<legend>Outras Informações</legend>
<div class="row">
<div class="col-md-6"><b>Dias Prazo</b></div>
<div class="col-md-6"><b>Data Fim Prazo</b></div>
</div>
<div class="row">
<div class="col-md-6"><input type="text" name="dias_prazo" {% if doc.diasprazo != None %} value="{{ doc.dias_prazo }}" {% endif %} /></div>
<div class="col-md-6"><input type="text" name="data_fim_prazo" class="dateinput" {% if doc.data_fim_prazo != None %} value="{{ doc.data_fim_prazo }}" {% endif %} /></div>
</div>
<div class="row">
<div class="col-md-12"><b>Obervação</b></div>
</div>
<div class="row">
<div class="col-md-12"><textarea rows="4" cols="50" name="observacao">{{ documento.observacao }}</textarea></div>
</div>
</fieldset>
<input type="submit" value="Salvar" name="Salvar" class="primary button"/>
<input type="submit" value="Excluir" name="Excluir" class="primary button"/>
</form>
</fieldset>
{% endblock %} {% endblock %}

12
templates/protocoloadm/detail_doc_detail.html

@ -1,10 +1,10 @@
{% extends "crud/detail.html" %} {% extends "crud/detail.html" %}
{% load i18n %} {% load i18n %}
{% block actions %} {% endblock %}
{% block sections_nav %} {% block sections_nav %}
<div class="actions btn-group pull-right" role="group"> <div class="actions btn-group pull-right" role="group">
<a href="#" class="btn btn-default">{% trans 'Inicio' %}</a> <a href="{% url 'detail_doc_adm' pk %}" class="btn btn-default">{% trans 'Inicio' %}</a>
<a href="#" class="btn btn-default">{% trans 'Documento Acessório' %}</a> <a href="{% url 'doc_ace_adm' pk %}" class="btn btn-default">{% trans 'Documento Acessório' %}</a>
<a href="{% url 'tramitacao_adm' pk %}" class="btn btn-default">{% trans 'Tramitação' %}</a> <a href="{% url 'tramitacao_adm' pk %}" class="btn btn-default">{% trans 'Tramitação' %}</a>
</div> </div>
{% endblock sections_nav %} {% endblock sections_nav %}

51
templates/protocoloadm/documento_acessorio_administrativo.html

@ -5,36 +5,39 @@
{% block detail_content %} {% block detail_content %}
<fieldset> <fieldset>
<legend>Documento Administrativo</legend> <legend>Documento Administrativo</legend>
<div class="row"> <div class="row">
<div class="col-md-4">Tipo: <b>{{doc.tipo.sigla}}</b></div> <div class="col-md-4">Tipo: <b>{{doc.tipo.sigla}}</b></div>
<div class="col-md-4">Número: <b>{{doc.numero}}</b></div> <div class="col-md-4">Número: <b>{{doc.numero}}</b></div>
<div class="col-md-4">Ano: <b>{{doc.ano}}</b></div> <div class="col-md-4">Ano: <b>{{doc.ano}}</b></div>
</div> </div>
Assunto: <b>{{doc.assunto}}</b> Assunto: <b>{{doc.assunto}}</b>
<br/><br/>
<fieldset> <fieldset>
<legend>Documentos Acessórios</legend> <legend>Documentos Acessórios</legend>
{{ doc_ace_null }} {% if not doc_ace_null %}
<table> <table style="width:100%">
<tr>
<th>Documento</th>
<th>Nome</th>
<th>Tipo</th>
<th>Data</th>
<th>Autor</th>
</tr>
{% for d in doc_ace %}
<tr> <tr>
<td>{{d.arquivo}}</td> <th>Documento</th>
<td>{{d.nome}}</td> <th>Nome</th>
<td>{{d.tipo.descricao}}</td> <th>Tipo</th>
<td>{{d.data|date:"d/m/Y"}}</td> <th>Data</th>
<td>{{d.autor}}</td> <th>Autor</th>
</tr> </tr>
{% endfor %} {% for d in doc_ace %}
</table> <tr>
<td>{{d.arquivo}}</td>
<td><a href="{% url 'doc_ace_adm_edit' doc.id d.id %}">{{d.nome}}</a></td>
<td>{{d.tipo.descricao}}</td>
<td>{{d.data|date:"d/m/Y"}}</td>
<td>{{d.autor}}</td>
</tr>
{% endfor %}
</table>
{% else %}
{{ doc_ace_null }}
{% endif %}
</fieldset> </fieldset>
<br/><br/>
{% crispy form %} {% crispy form %}
</fieldset> </fieldset>
{% endblock %} {% endblock %}

7
templates/protocoloadm/documento_acessorio_administrativo_edit.html

@ -0,0 +1,7 @@
{% extends "protocoloadm/detail_doc_detail.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block detail_content %}
{% crispy form %}
{% endblock %}

6
templates/protocoloadm/protocolo_mostrar.html

@ -16,8 +16,8 @@
<br /> <br />
<strong>Documento Vinculado:</strong></br> <strong>Documento Vinculado:</strong></br>
<a href="" class="secondary button">Criar Documento</a> <a href="{% url 'criar_documento' protocolo.numero protocolo.ano %}" class="btn btn-primary">Criar Documento</a>
<br /> &nbsp;&nbsp;&nbsp;&nbsp;
<a href="{% url 'comprovante_protocolo' protocolo.numero protocolo.ano %}" target="popup" onclick="window.open('{% url 'comprovante_protocolo' protocolo.numero protocolo.ano %}','Comprovante','width=800, height=600')">Comprovante <a href="{% url 'comprovante_protocolo' protocolo.numero protocolo.ano %}" target="popup" class="btn btn-primary" onclick="window.open('{% url 'comprovante_protocolo' protocolo.numero protocolo.ano %}','Comprovante','width=800, height=600')">Comprovante
</a> </a>
{% endblock detail_content %} {% endblock detail_content %}
Loading…
Cancel
Save