diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index b411171..d8534d6 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -241,17 +241,40 @@ class Convenio(models.Model): verbose_name = _(u'convênio') def __unicode__(self): - if self.data_retorno_assinatura is not None: - return _(u"Convênio {project} nº {number} assinado em {date}. Status: {status}".format( - number=self.num_convenio, - project=self.projeto.sigla, - date=self.data_retorno_assinatura, - status=self.get_status())) - else: - return _(u"Adesão ao projeto %(project)s, em %(date)s") % dict( - project=self.projeto.sigla, - date=self.data_adesao) - + # if self.data_retorno_assinatura is not None: + # return _(u"Convênio {project} nº {number} assinado em {date}. Status: {status}".format( + # number=self.num_convenio, + # project=self.projeto.sigla, + # date=self.data_retorno_assinatura, + # status=self.get_status())) + # else: + # return _(u"Adesão ao projeto %(project)s, em %(date)s") % dict( + # project=self.projeto.sigla, + # date=self.data_adesao) + + if ((self.data_retorno_assinatura is None) and + (self.equipada and self.data_termo_aceite is not None)): + return _(u"Equipada em {date} pelo {project}").format( + date=self.data_termo_aceite.strftime('%d/%m/%Y'), + project=self.projeto.sigla) + elif self.data_retorno_assinatura is None: + return _(u"Adesão ao projeto {project}, em {date}").format( + project=self.projeto.sigla, date=self.data_adesao) + if ((self.data_retorno_assinatura is not None) and not + (self.equipada and self.data_termo_aceite is not None)): + return _(u"Conveniada ao {project} em {date}. " + u"Status: {status}").format( + project=self.projeto.sigla, + date=self.data_retorno_assinatura.strftime('%d/%m/%Y'), + status=self.get_status()) + if ((self.data_retorno_assinatura is not None) and + (self.equipada and self.data_termo_aceite is not None)): + return _(u"Conveniada ao {project} em {date} e equipada em " + u"{equipped_date}. Status: {status}").format( + project=self.projeto.sigla, + date=self.data_retorno_assinatura.strftime('%d/%m/%Y'), + equipped_date=self.data_termo_aceite.strftime('%d/%m/%Y'), + status=self.get_status()) class EquipamentoPrevisto(models.Model): diff --git a/sigi/apps/metas/management/commands/gera_map_data.py b/sigi/apps/metas/management/commands/gera_map_data.py deleted file mode 100644 index a5541b2..0000000 --- a/sigi/apps/metas/management/commands/gera_map_data.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# -# sigi.apps.servicos.management.commands.atualiza_uso_servico -# -# Copyright (c) 2012 by Interlegis -# -# GNU General Public License (GPL) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# -from django.core.management.base import BaseCommand -from django.utils.translation import ugettext as _ - -from sigi.apps.metas.views import gera_map_data_file - - -class Command(BaseCommand): - help = _(u'Gera arquivo de dados de plotagem do mapa de atuação do Interlegis.') - - def handle(self, *args, **options): - result = gera_map_data_file(cronjob=True) - self.stdout.write(result + "\n") diff --git a/sigi/apps/metas/static/metas/css/openmap.css b/sigi/apps/metas/static/metas/css/openmap.css new file mode 100644 index 0000000..7da5183 --- /dev/null +++ b/sigi/apps/metas/static/metas/css/openmap.css @@ -0,0 +1,58 @@ +body, html, .mapbox, #map { + height: 100%; +} +.filterwrap { + background-color: rgba(255,255,255,0.5); + position: absolute; + top: 0; + left: 0; + z-index: 314159; + height: 100%; + max-height: 100%; + overflow-y: auto; +} +.sigi-logo { + pointer-events: none; + position: absolute; + top: 0; + left: 0; + z-index: 314159; + background-color: transparent; + width: 100%; + text-align: right; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + padding-right: 20px; +} +.sigi-logo h3 { + font-weight: bolder; + margin-bottom: 0px; +} +.sigi-logo a { + pointer-events: auto; +} +.sigi-logo div { + float: right; +} +.sigi-logo img { + margin: 15px; + width: 60px; + height: 60px; +} +.region-ufs { + margin-left: 15px; +} +#search-text { + min-width: 300px; +} +.ui-autocomplete { + max-width: 300px; + -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05); + box-shadow: 0 1px 2px rgba(0,0,0,.05); + border-color: #ddd; + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + padding: 15px; + font-size: 10px; +} \ No newline at end of file diff --git a/sigi/apps/metas/templates/metas/lista_casas.html b/sigi/apps/metas/templates/metas/lista_casas.html new file mode 100644 index 0000000..98df8c9 --- /dev/null +++ b/sigi/apps/metas/templates/metas/lista_casas.html @@ -0,0 +1,93 @@ +{% extends "base_report.html" %} +{% load mapa_tags %} +{% load i18n %} + +{% block extra_head %} + +{% endblock %} + +{% block pagesize %}A4 landscape{% endblock pagesize %} +{% block title %}{% trans 'Lista de Casas atendidas' %}{% endblock title %} + +{% block report %} +

{% trans 'Lista de Casas atendidas' %}

+ +{% if tipos_orgao %} + +{% endif %} +{% if tipos_servico %} + +{% endif %} +{% if tipos_convenio %} + +{% endif %} +{% if gerentes %} + +{% endif %} +{% if ufs %} + +{% endif %} +
{% trans 'Tipos de órgão' %}{% for t in tipos_orgao %}{{ t.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}
{% trans 'Tipos de serviço' %}{% for s in tipos_servico %}{{ s.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}
{% trans 'Tipos de convênio' %}{% for c in tipos_convenio %}{{ c.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}
{% trans 'Gerentes Interlegis' %}{% for g in gerentes %}{{ g.nome_completo }}{% if not forloop.last %}, {% endif %}{% endfor %}
{% trans 'Estados' %}{% for uf in ufs %}{{ uf.nome }}{% if not forloop.last %}, {% endif %}{% endfor %}
+ +
+ + + + + + + + + + {% for casa in casas %} + + + + + + + + + {% endfor %} +
{% trans 'Casa Legislativa' %}{% trans 'Estado' %}{% trans 'Região' %}{% trans 'Serviços' %}{% trans 'Convênios' %}{% trans 'Gerente(s)' %}
{{ casa.nome }} {{ casa.municipio.uf.nome }}{{ casa.municipio.uf.get_regiao_display }}
    {% for s in casa.servico_set.all %} + {% if s.data_desativacao == None %} +
  • {{ s }}
  • + {% endif %} + {% endfor %}
    {% for c in casa.convenio_set.all %} +
  • {{ c }}
  • + {% endfor %} +
    {% for g in casa.gerentes_interlegis.all %} +
  • {{ g }}
  • + {% endfor %}
+
+{% endblock %} diff --git a/sigi/apps/metas/templates/metas/openmap.html b/sigi/apps/metas/templates/metas/openmap.html index e58cb3a..067cbd1 100644 --- a/sigi/apps/metas/templates/metas/openmap.html +++ b/sigi/apps/metas/templates/metas/openmap.html @@ -8,6 +8,7 @@ + - + - - - - - - + + + + + -
+
-
- +
+ +

Filtros

@@ -104,6 +79,10 @@
+
+ + +
@@ -125,6 +104,10 @@
+
+ + +
@@ -171,6 +154,10 @@
+
+ + +
@@ -184,19 +171,17 @@
- {% comment %}
+
-
-
{% endcomment %} +
-
@@ -204,6 +189,43 @@