diff --git a/sapl/context_processors.py b/sapl/context_processors.py index 820589d30..b62c56ebc 100644 --- a/sapl/context_processors.py +++ b/sapl/context_processors.py @@ -84,6 +84,12 @@ def pendencias_assinatura(request): } +def ged_configurado(request): + """Injeta flag indicando se o GED (acervo histórico) está configurado.""" + from sapl.materia.views_ged import GED_URL + return {'ged_configurado': bool(GED_URL)} + + @cached_call("site-title", timeout=60 * 2) def enable_sapn(request): verbose_name = _('SGVP') \ diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 82c056ef4..0ba1ca7f0 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -2003,10 +2003,8 @@ class ProposicaoForm(FileFieldCheckMixin, forms.ModelForm): label=_('Co-autores'), required=False, queryset=Autor.objects.all(), - widget=forms.SelectMultiple(attrs={ - 'class': 'select2-coautores', - 'style': 'width: 100%', - 'data-placeholder': _('Selecione os co-autores...') + widget=forms.CheckboxSelectMultiple(attrs={ + 'class': 'coautores-checkbox', }), help_text=_('Selecione os demais autores deste documento. ' 'Eles serão adicionados como co-autores ao incorporar a proposição.') diff --git a/sapl/materia/urls.py b/sapl/materia/urls.py index f55a89329..273318d42 100644 --- a/sapl/materia/urls.py +++ b/sapl/materia/urls.py @@ -1,5 +1,6 @@ from django.conf.urls import include, url +from sapl.materia.views_ged import ged_historico from sapl.materia.views import (AcompanhamentoConfirmarView, AcompanhamentoExcluirView, AcompanhamentoMateriaView, AnexadaCrud, @@ -350,5 +351,10 @@ urlpatterns_sistema = [ url(r'^sistema/materia/config-etiqueta-materia-legislativas/',configEtiquetaMateriaLegislativaCrud, name="configEtiquetaMateriaLegislativaCrud"), ] +urlpatterns_ged = [ + url(r'^materia/acervo-historico/$', ged_historico, + name='ged_historico'), +] + urlpatterns = urlpatterns_impressos + urlpatterns_materia + \ - urlpatterns_proposicao + urlpatterns_sistema + urlpatterns_proposicao + urlpatterns_sistema + urlpatterns_ged diff --git a/sapl/materia/views_ged.py b/sapl/materia/views_ged.py new file mode 100644 index 000000000..cc4cd567f --- /dev/null +++ b/sapl/materia/views_ged.py @@ -0,0 +1,22 @@ +""" +View pública para acesso ao acervo histórico via GED (sistema legado). +Issue #1326 / Task #1348 – Adicionar tela do GED dentro do Legislativo. +""" +from decouple import config +from django.shortcuts import render +from django.views.decorators.cache import cache_control + +# Sem default: se GED_URL não estiver no .env, retorna string vazia. +GED_URL = config('GED_URL', default='') + + +@cache_control(public=True, max_age=300) +def ged_historico(request): + """ + Exibe o sistema GED (acervo histórico – matérias anteriores a 2026) + incorporado em iframe. Acesso público, sem autenticação. + Se GED_URL não estiver configurado, exibe mensagem informativa. + """ + return render(request, 'materia/ged_historico.html', { + 'ged_url': GED_URL or '', + }) diff --git a/sapl/settings.py b/sapl/settings.py index 3db706fa4..454c07f3c 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -235,6 +235,7 @@ TEMPLATES = [ 'sapl.context_processors.google_recaptcha_configured', 'sapl.context_processors.enable_sapn', 'sapl.context_processors.pendencias_assinatura', + 'sapl.context_processors.ged_configurado', ], 'debug': DEBUG }, diff --git a/sapl/templates/index.html b/sapl/templates/index.html index fdd607214..15aae85c7 100644 --- a/sapl/templates/index.html +++ b/sapl/templates/index.html @@ -155,6 +155,21 @@ + + {% if ged_configurado %} +
+
+ +
+

Acervo Histórico

+

Matérias anteriores a 2026 (sistema legado)

+
+ + Acessar + +
+
+ {% endif %}
diff --git a/sapl/templates/materia/ged_historico.html b/sapl/templates/materia/ged_historico.html new file mode 100644 index 000000000..40a11ff58 --- /dev/null +++ b/sapl/templates/materia/ged_historico.html @@ -0,0 +1,151 @@ +{% extends "base.html" %} +{% load i18n staticfiles %} + +{% block head_title %}Acervo Histórico – Matérias Anteriores a 2026 – {{ nome_casa }}{% endblock %} + +{% block head_content %} + {{ block.super }} + +{% endblock %} + +{% block content_subnav %}{% endblock %} +{% block footer_container %}{% endblock %} + +{% block content_container %} +{% if ged_url %} +
+ +
+
+
+

Acervo Histórico – Matérias Legislativas

+

Documentos do sistema anterior (GED) · registros anteriores a 2026

+
+ +
+ +
+ +
+
+ Carregando… +
+ Carregando acervo histórico… +
+ +
+ + Não foi possível carregar o acervo histórico. +

O sistema GED pode estar temporariamente indisponível.

+ + Tentar acessar diretamente + +
+ + +
+ +
+ + + +{% else %} +
+ +

+ Acervo Histórico não disponível +

+

+ Esta instalação não possui proposições legadas configuradas.
+ Caso necessite acessar matérias de sistemas anteriores, entre em contato com o administrador do sistema. +

+ + Voltar à página inicial + +
+{% endif %} +{% endblock content_container %} diff --git a/sapl/templates/materia/proposicao_form.html b/sapl/templates/materia/proposicao_form.html index 1300f178a..69d9d02fe 100644 --- a/sapl/templates/materia/proposicao_form.html +++ b/sapl/templates/materia/proposicao_form.html @@ -3,26 +3,68 @@ {% load crispy_forms_tags %} {% block extra_css %} -