From b7001b3823918c5824168f19cead2ec687021d6c Mon Sep 17 00:00:00 2001 From: Lude Ribeiro Date: Tue, 16 Nov 2021 11:41:15 -0300 Subject: [PATCH] Alterando o submenu de Visitas --- sigi/apps/convenios/models.py | 10 +++++++++- sigi/apps/home/templatetags/menu_conf.yaml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 5ab575e..636d237 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -10,7 +10,6 @@ from django.utils.translation import ugettext as _ from sigi.apps.utils import SearchField, to_ascii from sigi.apps.casas.models import Orgao from sigi.apps.servidores.models import Servidor, Servico -#from sigi.apps.convenios.admin import ConvenioAdmin class Projeto(models.Model): """ Modelo para representar os projetos do programa @@ -66,6 +65,7 @@ class Convenio(models.Model): blank=True, help_text=_(u'Formatos:
Antigo: XXXXXX/XX-X.
SIGAD: XXXXX.XXXXXX/XXXX-XX') ) + link_processo_stf = ('get_sigad_url') num_convenio = models.CharField( _(u'número do convênio'), max_length=10, @@ -212,6 +212,14 @@ class Convenio(models.Model): return _(u"Indefinido") + def link_sigad(self, obj): + if obj.pk is None: + return "" + return obj.get_sigad_url() + + link_sigad.short_description = _("Processo no Senado") + link_sigad.allow_tags = True + def get_sigad_url(self): m = re.match( r'(?P00100|00200)\.(?P\d{6})/(?P\d{4})-\d{2}', diff --git a/sigi/apps/home/templatetags/menu_conf.yaml b/sigi/apps/home/templatetags/menu_conf.yaml index 5be956b..8ef31b9 100644 --- a/sigi/apps/home/templatetags/menu_conf.yaml +++ b/sigi/apps/home/templatetags/menu_conf.yaml @@ -50,7 +50,7 @@ main_menu: - title: Oficinas url: eventos/evento/?tipo_evento__nome__contains=Oficina - title: Visitas Interlegis - url: eventos/evento/?tipo_evento__nome__exact=Visita Interlegis + url: eventos/evento/?tipo_evento__nome__contains=Visita - title: Calendário mensal url: eventos/calendario - title: Alocação de equipe