Browse Source

Migração de todas urls da app servicos

stable/2.0
Breno Teixeira 11 years ago
parent
commit
ece34b01fb
  1. 4
      sigi/apps/convenios/urls.py
  2. 1
      sigi/apps/convenios/views.py
  3. 5
      sigi/apps/diagnosticos/urls.py
  4. 41
      sigi/apps/metas/templates/metas/dashboard.html
  5. 44
      sigi/apps/metas/templates/metas/map_list.html
  6. 98
      sigi/apps/metas/templates/metas/map_sum.html
  7. 102
      sigi/apps/metas/templates/metas/mapa.html
  8. 40
      sigi/apps/metas/templates/metas/snippets.html
  9. 13
      sigi/apps/metas/urls.py
  10. 2
      sigi/apps/parlamentares/templates/parlamentares/carrinho.html
  11. 2
      sigi/apps/parlamentares/templates/parlamentares/change_list.html
  12. 7
      sigi/apps/parlamentares/urls.py
  13. 3
      sigi/apps/parlamentares/views.py
  14. 129
      sigi/apps/servicos/templates/servicos/casa_manifesta.html
  15. 61
      sigi/apps/servicos/templates/servicos/mapa.html
  16. 12
      sigi/apps/servicos/urls.py
  17. 12
      sigi/apps/servicos/views.py
  18. 50
      sigi/apps/servidores/templates/servidores/servidores_por_cargo.html
  19. 50
      sigi/apps/servidores/templates/servidores/servidores_por_funcao.html
  20. 9
      sigi/apps/servidores/urls.py
  21. 5
      sigi/settings.py
  22. 4
      sigi/urls.py

4
sigi/apps/convenios/urls.py

@ -4,4 +4,8 @@ from django.conf.urls import patterns, url
urlpatterns = patterns('sigi.apps.convenios.views',
url(r'^reports/$', 'report', name='convenios-report'),
url(r'^carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'),
url(r'^carrinho/excluir_carrinho/$', 'excluir_carrinho', name='excluir-carrinho'),
url(r'^carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'),
# url(r'^$', '', name=''),
)

1
sigi/apps/convenios/views.py

@ -126,7 +126,6 @@ def visualizar_carrinho(request):
return render_to_response(
'convenios/carrinho.html',
{
"ADMIN_MEDIA_PREFIX":settings.ADMIN_MEDIA_PREFIX,
'MEDIA_URL':settings.MEDIA_URL,
'carIsEmpty':carrinhoIsEmpty,
'paginas':paginas,

5
sigi/apps/diagnosticos/urls.py

@ -26,7 +26,10 @@ urlpatterns = patterns('sigi.apps.diagnosticos.views',
'categoria_detalhes', name='detalhes_categoria'),
url(r'^mapa/$', TemplateView.as_view(template_name="diagnosticos/mapa.html"), name='template-mapa'),
url(r'^mundiagjson/$', 'municipios_diagnosticados', name='municipios-diagnosticados')
url(r'^mundiagjson/$', 'municipios_diagnosticados', name='municipios-diagnosticados'),
# Reports diagnosticos
url(r'^diagnostico/(?P<id_diagnostico>\w+).pdf$', 'diagnostico_pdf', name='diagnostico-pdf'),
)
urlpatterns += patterns('django.contrib.auth.views',

41
sigi/apps/metas/templates/metas/dashboard.html

@ -0,0 +1,41 @@
{% extends "admin/index.html" %}
{% load adminmedia %}
{% block title %}SIGI{% endblock %}
{% block extrahead %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
{% endblock %}
{% block content_title %}
<h1>Triggers e indicadores de progresso</h1>
{% comment %}
<div id="changelist">
<div id="toolbar">
<p></p>
</div>
</div>
{% endcomment %}
{% endblock %}
{% block content %}
<div class="colMS" id="content">
<div id="content-main">
{% include "metas/snippets.html" %}
</div>
</div>
{% endblock %}
{% block sidebar %}
<div id="content-related">
{% comment %}
<div class="module" id="filters">
<h2>Filtros</h2>
<h3>Filtro 1</h3>
</div>
{% endcomment %}
</div>
{% endblock %}

44
sigi/apps/metas/templates/metas/map_list.html

@ -0,0 +1,44 @@
{% extends "base_report.html" %}
{% load mapa_tags %}
{% block extra_head %}
<style>
table.data, table.data td, table.data th {
border: 1px solid #CCCCCC;
border-collapse:collapse;
font-size: 10px;
padding: 2px;
}
td.qtde, th.qtde {
text-align: right;
}
td.nome_uf {
padding: 0 5px !important;
}
</style>
<title>Lista de Casas atendidas</title>
{% endblock %}
{% block report %}
<h1>Lista de Casas atendidas</h1>
<hr/><br/>
<table class="data" repeat="1">
<tr>
<th>Casa Legislativa</th>
<th>Estado</th>
<th>Região</th>
<th>Serviços</th>
</tr>
{% for casa in casas %}
<tr>
<td width="35%">{{ casa.nome }}</td>
<td>{{ casa.municipio.uf.nome }}</td>
<td>{{ casa.municipio.uf.get_regiao_display }}</td>
<td width="45%"><ul>{{ casa|map_desc_serv }}</ul></td>
</tr>
{% endfor %}
</table>
{% endblock %}
</body>
</html>

98
sigi/apps/metas/templates/metas/map_sum.html

@ -0,0 +1,98 @@
{% extends "base_report.html" %}
{% block extra_head %}
<style>
table.data, table.data td, table.data th {
border: 1px solid #CCCCCC;
border-collapse:collapse;
font-size: 10px;
padding: 2px;
}
td.qtde, th.qtde {
text-align: right;
}
td.nome_uf {
padding: 0 5px !important;
}
</style>
<title>Sumário da atuação do Interlegis</title>
{% endblock %}
{% block report %}
<h1>Sumário da atuação do Interlegis</h1>
<hr/><br/>
<table class="data" repeat="2">
<tr>
<th rowspan="2">Região / Estado</th>
<th colspan="{{ servicos.count }}">Serviços SEIT</th>
<th colspan="{{ projetos.count }}">Conveniadas</th>
<th colspan="{{ projetos.count }}">Equipadas</th>
<th colspan="2">Diagnósticos</th>
</tr>
<tr>
{% for servico in servicos %}
<th>{{ servico.nome }}</th>
{% endfor %}
{% for projeto in projetos %}
<th>{{ projeto.sigla }}</th>
{% endfor %}
{% for projeto in projetos %}
<th>{{ projeto.sigla }}</th>
{% endfor %}
<th>Em andamento</th>
<th>Publicados</th>
</tr>
{% for r_sigla, regiao in result.iteritems %}
<tr>
<td><strong>{{ regiao.nome }}</strong></td>
{% for sigla, qtde in regiao.servicos.iteritems %}
<td class="qtde"><strong>{{ qtde|default:"-" }}</strong></td>
{% endfor %}
{% for sigla, qtde in regiao.convenios.iteritems %}
<td class="qtde"><strong>{{ qtde|default:"-" }}</strong></td>
{% endfor %}
{% for sigla, qtde in regiao.equipadas.iteritems %}
<td class="qtde"><strong>{{ qtde|default:"-" }}</strong></td>
{% endfor %}
{% for sigla, qtde in regiao.diagnosticos.iteritems %}
<td class="qtde"><strong>{{ qtde|default:"-" }}</strong></td>
{% endfor %}
</tr>
{% for uf_id, uf in regiao.ufs.iteritems %}
<tr>
<td class="nome_uf">{{ uf.nome }}</td>
{% for sigla, qtde in uf.servicos.iteritems %}
<td class="qtde">{{ qtde|default:"-" }}</td>
{% endfor %}
{% for sigla, qtde in uf.convenios.iteritems %}
<td class="qtde">{{ qtde|default:"-" }}</td>
{% endfor %}
{% for sigla, qtde in uf.equipadas.iteritems %}
<td class="qtde">{{ qtde|default:"-" }}</td>
{% endfor %}
{% for sigla, qtde in uf.diagnosticos.iteritems %}
<td class="qtde">{{ qtde|default:"-" }}</td>
{% endfor %}
</tr>
{% endfor %}
{% endfor %}
<tr>
<th>Total</th>
{% for sigla, qtde in tot_servicos.iteritems %}
<th class="qtde">{{ qtde|default:"-" }}</th>
{% endfor %}
{% for sigla, qtde in tot_convenios.iteritems %}
<th class="qtde">{{ qtde|default:"-" }}</th>
{% endfor %}
{% for sigla, qtde in tot_equipadas.iteritems %}
<th class="qtde">{{ qtde|default:"-" }}</th>
{% endfor %}
{% for sigla, qtde in tot_diagnosticos.iteritems %}
<th class="qtde">{{ qtde|default:"-" }}</th>
{% endfor %}
</table>
{% endblock %}
</body>
</html>

102
sigi/apps/metas/templates/metas/mapa.html

@ -0,0 +1,102 @@
{% extends "admin/index.html" %}
{% block title %}SIGI{% endblock %}
{% block extrahead %}
{{ block.super }}
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}js/metas/mapa.js"></script>
<style>
.totalizador { float:right; }
</style>
{% endblock %}
{% block content_title %}
<h1>Mapa de atuação do Interlegis</h1>
<div id="changelist">
<div id="toolbar">
<form method="get" action="" id="changelist-search">
<div><!-- DIV needed for valid HTML -->
<label for="searchbar"><img alt="Search" src="/sigi/admin_media/img/admin/icon_searchbox.png"></label>
<input type="text" id="searchbar" value="" name="q" size="40">
<input type="submit" value="Pesquisar">
<span id="search-panel" class="small quiet">&nbsp;</span>
</div>
</form>
<ul class="object-tools">
<li> <a href="/sigi/dashboard/mapsum/" id="summary_report" onclick="return false;">Relatório resumo</a> </li>
<li> <a href="/sigi/dashboard/maplist/" id="list_report" onclick="return false;">Listagem das Casas</a> </li>
<li> <a href="/sigi/dashboard/maplist/?fmt=csv" id="list_csv" onclick="return false;">Exportar Casas</a> </li>
<li> <a href="#" id="closeiwlink">Fechar todas as janelas de informação</a> </li>
</ul>
</div>
</div>
{% endblock %}
{% block content %}
<div id="map" style="width:100%; height: 800px; float: left;">
<!-- google map -->
</div>
{% endblock %}
{% block sidebar %}
<form id="filter_form" method="get" action="">
<div id="content-related">
<div class="module" id="filters"> {% comment %} Adicione style="overflow: auto; height: 800px;" para rolar apenas na caixa de filtros {% endcomment %}
<h2>Filtros</h2>
<h3>Por Serviços SEIT</h3>
<ul>
{% for s in servico_choices %}
<li><input type="checkbox" name="seit" value="{{ s.sigla }}"
{% if s.sigla in seit %} checked="checked" {% endif %}/>
{{ s.nome }}
<span id="{{ s.sigla }}" class="totalizador">&nbsp;</span>
</li>
{% endfor %}
</ul>
<h3>Por Casas conveniadas</h3>
<ul>
{% for p in projeto_choices %}
<li><input type="checkbox" name="convenios" value="{{ p.sigla }}" {% if p.sigla in convenios %}checked="checked" {% endif %}/>
ao {{ p.sigla }} <span id="convenio_{{ p.sigla }}" class="totalizador">&nbsp;</span> </li>
{% endfor %}
</ul>
<h3>Por Casas equipadas</h3>
<ul>
{% for p in projeto_choices %}
<li><input type="checkbox" name="equipadas" value="{{ p.sigla }}" {% if p.sigla in equipadas %}checked="checked"{% endif %} />
pelo {{ p.sigla }}<span id="equip_{{ p.sigla }}" class="totalizador">&nbsp;</span> </li></li>
{% endfor %}
</ul>
<h3>Por Diagnósticos</h3>
<ul>
<li><input type="checkbox" name="diagnosticos" value="A" {% if "A" in diagnosticos %}checked="checked" {% endif %}/>
Em andamento<span id="diagnostico_A" class="totalizador">&nbsp;(1)</span></li>
<li><input type="checkbox" name="diagnosticos" value="P" {% if "P" in diagnosticos %}checked="checked" {% endif %}/>
Publicados<span id="diagnostico_P" class="totalizador">&nbsp;(1)</span></li>
</ul>
<h3>Por região</h3>
<ul>
{% for r in regiao_choices %}
<li><input type="checkbox" name="regioes" value="{{ r.0 }}" {% if r.0 in regioes %}checked="checked"{% endif %}/> {{ r.1 }}
<span id="{{ r.0 }}" class="totalizador">&nbsp;(1)</span></li>
{% endfor %}
</ul>
<h3>Por Estado</h3>
<ul>
{% for e in estado_choices %}
<li><input type="checkbox" name="estados" value="{{ e.sigla }}"
{% if e.sigla in estados %} checked="checked" {% endif %}/>
{{ e.nome }}
<span id="{{ e.sigla }}" class="totalizador">&nbsp;(1)</span>
</li>
{% endfor %}
</ul>
</div>
</div>
</form>
{% endblock %}

40
sigi/apps/metas/templates/metas/snippets.html

@ -0,0 +1,40 @@
{% load charts %}
{# ------------- Todas as metas ------------- #}
<div style="height: 300px;" class="module">
<h2>Todas as metas</h2>
<h3>Estado das metas do contrato BID</h3>
<table style="margin: auto;">
{% for meta in metas %}
<tr>
<td><strong>{{ meta.titulo }}</strong></td>
<td>
<img src="//chart.googleapis.com/chart?chf=c,s,CDCDCD&chbh=a&chs=250x18&cht=bhs&chco={{ meta.saude }}&chd=t:{{ meta.percentual_concluido|stringformat:'d' }}&chm=r,00000034,0,{{ meta.percentual_desejado_low|stringformat:'f' }},{{ meta.percentual_desejado_high|stringformat:'f' }},1"
width="100%" alt="" />
</td>
<td style="text-align: center;"><font color="{{ meta.saude }}">{{ meta.percentual_concluido }}%</font></td>
</tr>
{% endfor %}
</table>
<div class="legend">
<span><div style="background-color: #E74A69;">&nbsp;</div>Ruim</span>
<span><div style="background-color: #FFDB6E;">&nbsp;</div>Preocupante</span>
<span><div style="background-color: #89D7AF;">&nbsp;</div>Bom</span>
<span><div style="background-color: #A2BBED;">&nbsp;</div>Atingido</span>
</div>
</div>
{# ------------- Evolução dos desembolsos ------------- #}
<div style="height: 300px;" class="module">
<h2>Evolução dos desembolsos</h2>
<h3>Desembolsos últimos seis meses</h3>
<img src="//chart.googleapis.com/chart?chxr=0,0,{{ desembolsos_max }}&chxl=1:{% for m in meses %}|{{ m }}{% endfor %}&chxt=y,x&chbh=a&chs=400x240&cht=bvg&chd=t:{% for serie in desembolsos.values %}{% for v in serie.1.values %}{{ v }}{% if not forloop.last %},{% endif %}{% endfor %}{% if not forloop.last %}|{% endif %}{% endfor %}&chdl={% for l in desembolsos.values %}{{ l.0 }}{% if not forloop.last %}|{% endif %}{% endfor %}&chdlp=t&chds={% for d in desembolsos %}0,{{ desembolsos_max }}{% if not forloop.last %},{% endif %}{% endfor %}&chco={{ colors }}" />
</div>
{% comment %}
{# ------------- Evolução dos desembolsos ------------- #}
<div style="height: 300px;" class="module">
<h2>Todas as metas</h2>
<h3>Estado das metas do contrato BID</h3>
</div>
{% endcomment %}

13
sigi/apps/metas/urls.py

@ -1,3 +1,12 @@
from django.conf.urls.defaults import *
# coding: utf-8
from django.conf.urls import patterns, url
# place app url patterns here
urlpatterns = patterns('sigi.apps.metas.views',
url(r'^$', 'dashboard', name='metas-dashboardsss'), #tagerror
url(r'^mapa/$', 'mapa', name='metas-mapa'), #tagerror
url(r'^mapdata/$', 'map_data', name='metas-map_data'),
url(r'^mapsearch/$', 'map_search', name='metas-map_search'),
url(r'^mapsum/$', 'map_sum', name='metas-map_sum'),
url(r'^maplist/$', 'map_list', name='metas-map_list'),
)

2
sigi/apps/parlamentares/templates/parlamentares/carrinho.html

@ -1,5 +1,5 @@
{% extends "admin/carrinho.html" %}
{% load adminmedia admin_list i18n %}
{% load admin_list i18n %}
{% block extrastyle %}
{{ block.super }}
{% include "admin/tabs_style.html" %}

2
sigi/apps/parlamentares/templates/parlamentares/change_list.html

@ -1,5 +1,5 @@
{% extends "admin/change_list.html" %}
{% load adminmedia admin_list i18n reporting_tags %}
{% load admin_list i18n reporting_tags %}
{% block object-tools %}
<ul class="object-tools">

7
sigi/apps/parlamentares/urls.py

@ -7,4 +7,11 @@ urlpatterns = patterns('sigi.apps.parlamentares.views',
# Reports labels parlamentares
url(r'^labels/$', 'labels_report', name='labels-report-all'),
url(r'^(?P<id>\w+)/labels/$', 'labels_report', name='labels-report-id'),
# Carrinho
url(r'^carrinho/$', 'visualizar_carrinho', name='visualizar-carrinho'),
url(r'^carrinho/deleta_itens_carrinho$', 'deleta_itens_carrinho', name='deleta-itens-carrinho'),
# A view excluir_carrinho n existe ainda.
# url(r'^carrinho/exluir_carrinho$', 'excluir_carrinho', name='excluir-carrinho'),
)

3
sigi/apps/parlamentares/views.py

@ -55,8 +55,7 @@ def visualizar_carrinho(request):
carrinhoIsEmpty = not(request.session.has_key('carrinho_parlamentares'))
return render_to_response('parlamentares/carrinho.html',
{"ADMIN_MEDIA_PREFIX":settings.ADMIN_MEDIA_PREFIX,
'MEDIA_URL':settings.MEDIA_URL,
{'MEDIA_URL':settings.MEDIA_URL,
'carIsEmpty':carrinhoIsEmpty,
'paginas':paginas,
'query_str':'?'+request.META['QUERY_STRING']},

129
sigi/apps/servicos/templates/servicos/casa_manifesta.html

@ -0,0 +1,129 @@
{% extends "admin/change_form.html" %}
{% load i18n admin_modify %}
{% block extrahead %}{{ block.super }}
{% url 'admin:jsi18n' as 'jsi18nurl' %}
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../jsi18n/" }}"></script>
<style type="text/css">
div.breadcrumbs {
display: inherit;
}
</style>
{{ media }}
{% endblock %}
{% block coltype %}colMS{% endblock %}
{% block bodyclass %}casa-manifesta change-form{% endblock %}
{% block nav-global %}
<div id="nav-global">
</div>
{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
{% if casa_list %}
<a href="./">Unidade da Federação</a> &rsaquo; Casa legislativa
{% else %}
{% if casa %}
<a href="./">Unidade da Federação</a> &rsaquo;
<a href="./?uf={{ casa.municipio.uf.sigla }}">Casa legislativa</a> &rsaquo;
{{ casa.nome }}
{% else %}
Unidade da Federação
{% endif %}
{% endif %}
</div>
{% endblock %}
{% block content %}
<div id="content-main">
{% if uf_list %}
<h3>1. Informe a Unidade da Federação onde se localiza sua Casa Legislativa</h3>
<ul>
{% for uf in uf_list %}
<li><a href="./?uf={{ uf.sigla }}">{{ uf.nome }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% if casa_list %}
<h3>2. Identifique sua Casa Legislativa</h3>
<br/>
<ul>
{% for casa in casa_list %}
<li><a href="./?casa_id={{ casa.pk }}">{{ casa.nome }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% if cmf %}
<h3>3. Informe os dados para a {{ casa.nome }} - {{ casa.municipio.uf }}</h3>
<form action="" method="post" id="manifesta_form">{% csrf_token %}
{% for fieldset in cmf.fieldsets %}
{% if forloop.first %}
<fieldset class="module aligned {{ fieldset.classes }}">
{% if fieldset.name %}<h2>{{ fieldset.name }}</h2>{% endif %}
{% for line in fieldset.lines %}
<div class="form-row">
{% for field in line %}
<div class="field-box{% if not field.is_readonly and field.errors %} errors{% endif %}">
{% if not field.is_readonly %}{{ field.errors }}{% endif %}
{% if field.is_checkbox %}
{{ field }}{{ field.label_tag }}
{% else %}
{{ field.label_tag }}
{% if field.is_readonly %}
<p>{{ field.contents }}</p>
{% else %}
{{ field }}
{% endif %}
{% endif %}
{% if field.field.help_text %}
<p class="help">{{ field.field.help_text|safe }}</p>
{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
</fieldset>
<fieldset class="module aligned {{ fieldset.classes }}">
<h2>Serviços e produtos Interlegis</h2>
<table>
<tr>
<th>Nome do serviço ou produto</th>
<th>Marque se a Casa utiliza este serviço ou produto</th>
<th>Informe a URL onde se localiza o serviço ou produto</th>
<th>Marque se o serviço ou produto está hospedado no Interlegis</th>
</tr>
{% else %}
<tr>
<th>{{ fieldset.name }}</th>
{% for line in fieldset.lines %}
{% for field in line %}
<td>{{ field }}</td>
{% endfor %}
{% endfor %}
</tr>
{% endif %}
{% endfor %}
</table>
</fieldset>
<div class="submit-row">
<input type="submit" value="{% trans 'Save' %}" class="default" name="_save"/>
</div>
</form>
{% endif %}
{% if thanks %}
<h1>Obrigado por responder à nossa pesquisa!</h1>
<h3>Quadro resumo das informações prestadas:</h3>
<table>
{% for row in thanks %}
<tr><th>{{ row.0 }}</th><td>{{ row.1|default:"Não informado" }}</td></tr>
{% endfor %}
</table>
<p>Se desejar, você poderá alterar esses dados repetindo o processo</p>
{% endif %}
{% endblock %}

61
sigi/apps/servicos/templates/servicos/mapa.html

@ -0,0 +1,61 @@
{% extends "admin/index.html" %}
{% block title %}SIGI{% endblock %}
{% block extrahead %}
{{ block.super }}
{% load staticfiles %}
<script type="text/javascript" src="{% static "admin/js/core.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"> </script>
<script type="text/javascript">
(function($) {
$(document).ready(function($) {
var latlng = new google.maps.LatLng(-14.2350040, -51.925280);
var myOptions = {
zoom: 5,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"),
myOptions);
$.get("/sigi/servicos/munatenjson/{{ params.servico }}", function(municipios) {
for (var i in municipios) {
var municipio = municipios[i];
var markData = {
map: map,
position: new google.maps.LatLng(municipio.lat, municipio.lng),
title: municipio.nome,
icon: '{{ MEDIA_URL }}images/mapmarker.png' //'/sigi/media/images/mapmarker.png'
}
var mark = new google.maps.Marker(markData);
var infoWin = new google.maps.InfoWindow({content:
'<strong>' + municipio.nome + '</strong><br/>' +
'<strong>Serviço(s):</strong><br/>' + municipio.servicos });
linkMarkMessage(mark, infoWin, map);
}
});
function linkMarkMessage(mark, infoWin, map) {
google.maps.event.addListener(mark, 'click', function() {
infoWin.open(map, mark);});
}
})})(django.jQuery);
</script>
{% endblock %}
{% block content %}
{% comment %}
<div id="painel">
<form method="get">
{% for tipo in servicos %}
<input type="checkbox" value="{{ tipo.sigla }}"/>{{ tipo.nome }}
{% endfor %}
</form>
</div>
{% endcomment %}
<div id="map" style="width:100%; height: 800px; float: left;"></div>
{% endblock %}

12
sigi/apps/servicos/urls.py

@ -0,0 +1,12 @@
# coding: utf-8
from django.conf.urls import patterns, url
from django.views.generic.base import TemplateView
from .views import MapaView
urlpatterns = patterns('sigi.apps.servicos.views',
url(r'^manifesta/$', 'casa_manifesta_view', name="casa-manifesta-view"),
url(r'^munatenjson/(?P<servico>\w+)/$', 'municipios_atendidos', name="municipios-atendidos"),
url(r'^mapa/(?P<servico>\w+)/$', MapaView.as_view(), name="servicos-mapa"),
)

12
sigi/apps/servicos/views.py

@ -13,6 +13,18 @@ from django.forms.forms import BoundField
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
from django.contrib.admin.helpers import AdminForm
from django.views.generic.base import TemplateView
class MapaView(TemplateView):
template_name = "servicos/mapa.html"
def get_context_data(self, **kwargs):
context = super(MapaView, self).get_context_data(**kwargs)
context['servicos'] = TipoServico.objects.all()
return context
def municipios_atendidos(self, servico):
municipios = []

50
sigi/apps/servidores/templates/servidores/servidores_por_cargo.html

@ -0,0 +1,50 @@
{% extends "base_report.html" %}
{% block extra_head %}
<style type="text/css">
tr.title {
text-align: center;
font-size: 1.2em;
border-bottom: 2px black solid;
}
tr.data {
padding: 2px 5px;
border-bottom: 1px gray solid;
}
tr.total {
font-weight: bold;
}
td.index {
width: 50px;
}
</style>
{% endblock %}
{% block subsecretaria %}
SUBSECRETARIA DE ADMINISTRAÇÃO – SSADM
{% endblock %}
{% block report %}
<div>
<h1>Relatório de Servidores por Cargo</h1>
<table class="report">
<tr class="title">
<td class="index"></td>
<td>Cargo</td>
<td>Servidores</td>
</tr>
{% for r in report %}
<tr class="data">
<td>{{ forloop.counter }}</td>
<td>{{ r.cargo }}</td>
<td>{{ r.cargo__count }}</td>
</tr>
{% endfor %}
<tr class="data total">
<td></td>
<td>Total</td>
<td>{{ total }}</td>
</tr>
</table>
</div>
{% endblock %}

50
sigi/apps/servidores/templates/servidores/servidores_por_funcao.html

@ -0,0 +1,50 @@
{% extends "base_report.html" %}
{% block extra_head %}
<style type="text/css">
tr.title {
text-align: center;
font-size: 1.2em;
border-bottom: 2px black solid;
}
tr.data {
padding: 2px 5px;
border-bottom: 1px gray solid;
}
tr.total {
font-weight: bold;
}
td.index {
width: 50px;
}
</style>
{% endblock %}
{% block subsecretaria %}
SUBSECRETARIA DE ADMINISTRAÇÃO – SSADM
{% endblock %}
{% block report %}
<div>
<h1>Relatório de Servidores por Função</h1>
<table class="report">
<tr class="title">
<td class="index"></td>
<td>Função</td>
<td>Servidores</td>
</tr>
{% for r in report %}
<tr class="data">
<td>{{ forloop.counter }}</td>
<td>{{ r.funcao }}</td>
<td>{{ r.funcao__count }}</td>
</tr>
{% endfor %}
<tr class="data total">
<td></td>
<td>Total</td>
<td>{{ total }}</td>
</tr>
</table>
</div>
{% endblock %}

9
sigi/apps/servidores/urls.py

@ -0,0 +1,9 @@
# -*- coding: utf8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns('sigi.apps.servidores.views',
# Reports servidores
url(r'^servidores_por_funcao.pdf$', 'servidores_por_funcao', name='servidores-funcao-pdf'),
url(r'^servidores_por_cargo.pdf$', 'servidores_por_cargo', name='servidores-cargo-pdf'),
)

5
sigi/settings.py

@ -107,6 +107,8 @@ DEFAULT_FROM_EMAIL = 'sesostris@interlegis.leg.br'
TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
)
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
# STATIC_ROOT = os.path.join(BASE_DIR, 'static')
@ -117,4 +119,5 @@ TEMPLATE_DIRS = (
# STATICFILES_FINDERS = (
# "django.contrib.staticfiles.finders.FileSystemFinder",
# "django.contrib.staticfiles.finders.AppDirectoriesFinder"
# )
# )

4
sigi/urls.py

@ -8,11 +8,13 @@ admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url='/sigi/'), name='go-to-sigi'),
# url(r'^sigi/servidores/', include('sigi.apps.servidores.urls')),
url(r'^sigi/parlamentares/parlamentar/', include('sigi.apps.parlamentares.urls')),
url(r'^sigi/casas/casalegislativa/', include('sigi.apps.casas.urls')),
url(r'^sigi/convenios/convenio/', include('sigi.apps.convenios.urls')),
url(r'^sigi/diagnosticos/', include('sigi.apps.diagnosticos.urls')),
url(r'^sigi/servidores/', include('sigi.apps.servidores.urls')),
url(r'^sigi/dashboard/', include('sigi.apps.metas.urls')),
url(r'^sigi/servicos/', include('sigi.apps.servicos.urls')),
url(r'^sigi/', include(admin.site.urls)),
)

Loading…
Cancel
Save