mirror of https://github.com/interlegis/sapl.git
committed by
GitHub
72 changed files with 1142 additions and 642 deletions
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.11.29 on 2020-05-18 18:14 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('materia', '0067_auto_20200416_1538'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.CreateModel( |
||||
|
name='ConfigEtiquetaMateriaLegislativa', |
||||
|
fields=[ |
||||
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
||||
|
('largura', models.FloatField(default=5)), |
||||
|
('altura', models.FloatField(default=3)), |
||||
|
], |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,20 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.11.29 on 2020-05-18 18:19 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
def create_first(apps, schema_editor): |
||||
|
db_alias = schema_editor.connection.alias |
||||
|
Type = apps.get_model("materia", "ConfigEtiquetaMateriaLegislativa") |
||||
|
Type.objects.using(db_alias).create() |
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
dependencies = [ |
||||
|
('materia', '0068_configetiquetamaterialegislativa'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RunPython(create_first), |
||||
|
] |
||||
@ -0,0 +1,21 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.11.29 on 2020-07-08 16:12 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('protocoloadm', '0032_auto_20200416_1538'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='protocolo', |
||||
|
name='autor', |
||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.Autor'), |
||||
|
), |
||||
|
] |
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1,2 +1,2 @@ |
|||||
(function(e){function a(a){for(var r,s,l=a[0],o=a[1],u=a[2],c=0,f=[];c<l.length;c++)s=l[c],Object.prototype.hasOwnProperty.call(n,s)&&n[s]&&f.push(n[s][0]),n[s]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);p&&p(a);while(f.length)f.shift()();return i.push.apply(i,u||[]),t()}function t(){for(var e,a=0;a<i.length;a++){for(var t=i[a],r=!0,l=1;l<t.length;l++){var o=t[l];0!==n[o]&&(r=!1)}r&&(i.splice(a--,1),e=s(s.s=t[0]))}return e}var r={},n={parlamentar:0},i=[];function s(a){if(r[a])return r[a].exports;var t=r[a]={i:a,l:!1,exports:{}};return e[a].call(t.exports,t,t.exports,s),t.l=!0,t.exports}s.m=e,s.c=r,s.d=function(e,a,t){s.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:t})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,a){if(1&a&&(e=s(e)),8&a)return e;if(4&a&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(s.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var r in e)s.d(t,r,function(a){return e[a]}.bind(null,r));return t},s.n=function(e){var a=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(a,"a",a),a},s.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},s.p="/static/sapl/frontend/";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],o=l.push.bind(l);l.push=a,l=l.slice();for(var u=0;u<l.length;u++)a(l[u]);var p=o;i.push([3,"chunk-vendors"]),t()})({3:function(e,a,t){e.exports=t("71e4")},"49c2":function(e,a,t){},"71e4":function(e,a,t){"use strict";t.r(a),function(e){t("4de4"),t("e260"),t("e6cf"),t("cca6"),t("a79d"),t("49c2");var a=t("a026"),r=t("44d4"),n=t("bc3a"),i=t.n(n);i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFToken",a["a"].use(r["a"]);new a["a"]({delimiters:["[[","]]"],el:"#app2",data:function(){return{nome_pesquisa:"",is_pesquisa:!1,legislatura_selecionada:"",legislaturas:[],parlamentares:[],visible_parlamentares:[],size_parlamentares:0,filter_ativo:"",filter_titular:""}},watch:{nome_pesquisa:function(e){this.debouncepesquisaParlamentar()}},created:function(){this.debouncepesquisaParlamentar=e.debounce(this.pesquisaParlamentar,500)},methods:{getParlamentares:function(e){var a=this;this.legislatura_selecionada&&i.a.get("/api/parlamentares/parlamentar/"+this.legislatura_selecionada+"/parlamentares_by_legislatura/").then((function(e){a.parlamentares=e.data,a.visible_parlamentares=a.parlamentares,a.size_parlamentares=a.visible_parlamentares.length})).catch((function(e){}))},pesquisaParlamentar:function(e){var a=this;i.a.get("/api/parlamentares/parlamentar/search_parlamentares/",{params:{nome_parlamentar:this.nome_pesquisa}}).then((function(e){a.parlamentares=e.data,a.visible_parlamentares=a.parlamentares,a.size_parlamentares=a.visible_parlamentares.length})).catch((function(e){}))},checkTitularAtivo:function(e){this.visible_parlamentares=this.parlamentares,this.filter_ativo&&(this.visible_parlamentares=this.visible_parlamentares.filter((function(e){return e.ativo}))),this.filter_titular&&(this.visible_parlamentares=this.visible_parlamentares.filter((function(e){return"Sim"===e.titular}))),this.size_parlamentares=this.visible_parlamentares.length},pesquisaChange:function(e){this.is_pesquisa=!this.is_pesquisa,this.filter_ativo=!1,this.is_pesquisa?this.parlamentares=[]:this.getParlamentares()}},mounted:function(){var e=this;i.a.get("/api/parlamentares/legislatura/?get_all=true").then((function(a){e.legislaturas=a.data,e.legislatura_selecionada=a.data[0].id})).then((function(a){e.getParlamentares()})).catch((function(e){}))}})}.call(this,t("2ef0"))}}); |
(function(e){function a(a){for(var r,s,l=a[0],o=a[1],u=a[2],c=0,f=[];c<l.length;c++)s=l[c],Object.prototype.hasOwnProperty.call(n,s)&&n[s]&&f.push(n[s][0]),n[s]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);p&&p(a);while(f.length)f.shift()();return i.push.apply(i,u||[]),t()}function t(){for(var e,a=0;a<i.length;a++){for(var t=i[a],r=!0,l=1;l<t.length;l++){var o=t[l];0!==n[o]&&(r=!1)}r&&(i.splice(a--,1),e=s(s.s=t[0]))}return e}var r={},n={parlamentar:0},i=[];function s(a){if(r[a])return r[a].exports;var t=r[a]={i:a,l:!1,exports:{}};return e[a].call(t.exports,t,t.exports,s),t.l=!0,t.exports}s.m=e,s.c=r,s.d=function(e,a,t){s.o(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:t})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,a){if(1&a&&(e=s(e)),8&a)return e;if(4&a&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(s.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&a&&"string"!=typeof e)for(var r in e)s.d(t,r,function(a){return e[a]}.bind(null,r));return t},s.n=function(e){var a=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(a,"a",a),a},s.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},s.p="/static/sapl/frontend/";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],o=l.push.bind(l);l.push=a,l=l.slice();for(var u=0;u<l.length;u++)a(l[u]);var p=o;i.push([3,"chunk-vendors"]),t()})({3:function(e,a,t){e.exports=t("71e4")},"49c2":function(e,a,t){},"71e4":function(e,a,t){"use strict";t.r(a),function(e){t("4de4"),t("e260"),t("e6cf"),t("cca6"),t("a79d"),t("49c2");var a=t("a026"),r=t("44d4"),n=t("bc3a"),i=t.n(n);i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFToken",a["a"].use(r["a"]);new a["a"]({delimiters:["[[","]]"],el:"#app2",data:function(){return{nome_pesquisa:"",is_pesquisa:!1,legislatura_selecionada:"",legislaturas:[],parlamentares:[],visible_parlamentares:[],size_parlamentares:0,filter_ativo:!0,filter_titular:""}},watch:{nome_pesquisa:function(e){this.debouncepesquisaParlamentar()}},created:function(){this.debouncepesquisaParlamentar=e.debounce(this.pesquisaParlamentar,500)},methods:{getParlamentares:function(e){var a=this;this.legislatura_selecionada&&i.a.get("/api/parlamentares/parlamentar/"+this.legislatura_selecionada+"/parlamentares_by_legislatura/").then((function(e){a.parlamentares=e.data,a.visible_parlamentares=a.parlamentares,a.size_parlamentares=a.visible_parlamentares.length,a.checkTitularAtivo()})).catch((function(e){}))},pesquisaParlamentar:function(e){var a=this;i.a.get("/api/parlamentares/parlamentar/search_parlamentares/",{params:{nome_parlamentar:this.nome_pesquisa}}).then((function(e){a.parlamentares=e.data,a.visible_parlamentares=a.parlamentares,a.size_parlamentares=a.visible_parlamentares.length})).catch((function(e){}))},checkTitularAtivo:function(e){this.visible_parlamentares=this.parlamentares,this.filter_ativo&&(this.visible_parlamentares=this.visible_parlamentares.filter((function(e){return e.ativo}))),this.filter_titular&&(this.visible_parlamentares=this.visible_parlamentares.filter((function(e){return"Sim"===e.titular}))),this.size_parlamentares=this.visible_parlamentares.length},pesquisaChange:function(e){this.is_pesquisa=!this.is_pesquisa,this.filter_ativo=!1,this.is_pesquisa?this.parlamentares=[]:this.getParlamentares()}},mounted:function(){var e=this;i.a.get("/api/parlamentares/legislatura/?get_all=true").then((function(a){e.legislaturas=a.data,e.legislatura_selecionada=a.data[0].id})).then((function(a){e.getParlamentares()})).catch((function(e){}))}})}.call(this,t("2ef0"))}}); |
||||
//# sourceMappingURL=parlamentar.35e37659.js.map
|
//# sourceMappingURL=parlamentar.307451cf.js.map
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,14 @@ |
|||||
|
{% extends "crud/detail.html" %} |
||||
|
{% load i18n %} |
||||
|
{% load crispy_forms_tags staticfiles %} |
||||
|
|
||||
|
{% block sub_actions %} |
||||
|
<div class="actions btn-group btn-group-sm" role="group"> |
||||
|
<a href="{% url 'sapl.base:pesquisar_autor' %}" class="btn btn-outline-primary"> |
||||
|
{% blocktrans with verbose_name=view.verbose_name %} Pesquisar {{ verbose_name }} {% endblocktrans %} |
||||
|
</a> |
||||
|
<a href="{{ view.create_url }}" class="btn btn-outline-primary"> |
||||
|
{% blocktrans with verbose_name=view.verbose_name %} Adicionar {{ verbose_name }} {% endblocktrans %} |
||||
|
</a> |
||||
|
</div> |
||||
|
{% endblock sub_actions %} |
||||
@ -0,0 +1,51 @@ |
|||||
|
{% extends "crud/list.html" %} |
||||
|
{% load i18n %} |
||||
|
{% load crispy_forms_tags staticfiles %} |
||||
|
|
||||
|
{% block base_content %} |
||||
|
{% if not show_results %} |
||||
|
{% crispy filter.form %} |
||||
|
{% else %} |
||||
|
<div class="actions btn-group float-right btn-group-sm" role="group"> |
||||
|
<a href="{% url 'sapl.base:pesquisar_autor' %}" class="btn btn-outline-primary">{% trans 'Fazer nova pesquisa' %}</a> |
||||
|
{% if not request.user.is_anonymous %} |
||||
|
<a href="{% url 'sapl.base:autor_create' %}"class="btn btn-outline-primary">Cadastrar Autor</a> |
||||
|
{% endif %} |
||||
|
</div> |
||||
|
<br> |
||||
|
{% if numero_res > 0 %} |
||||
|
{% if numero_res == 1 %} |
||||
|
<p>Foi encontrado {{ numero_res }} resultado</p> |
||||
|
{% else %} |
||||
|
<p>Foram encontrados {{ numero_res }} resultados</p> |
||||
|
{% endif %} |
||||
|
<table class="table table-striped table-hover"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>Tipo do Autor</th> |
||||
|
<th>Nome do Autor</th> |
||||
|
<th>Usuário</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
{% for autor in page_obj %} |
||||
|
<tr> |
||||
|
<td>{{ autor.tipo }}</td> |
||||
|
<td> |
||||
|
<a href="{% url 'sapl.base:autor_detail' autor.pk %}"> |
||||
|
{% if autor.nome %} {{ autor.nome }} {% else %} - {% endif %} |
||||
|
</a> |
||||
|
</td> |
||||
|
<td>{% if autor.user %} {{ autor.user }} {% else %} - {% endif %}</td> |
||||
|
</tr> |
||||
|
{% endfor %} |
||||
|
</tbody> |
||||
|
</table> |
||||
|
{% else %} |
||||
|
<font size="4"><p align="center">{{ NO_ENTRIES_MSG }}</p></font> |
||||
|
{% endif %} |
||||
|
{% endif %} |
||||
|
<br/> |
||||
|
{% include 'paginacao.html'%} |
||||
|
<br /><br /><br /> |
||||
|
{% endblock base_content %} |
||||
@ -0,0 +1,19 @@ |
|||||
|
{% extends "crud/form.html" %} |
||||
|
{% load i18n %} |
||||
|
{% load crispy_forms_tags %} |
||||
|
|
||||
|
{% block base_content %} |
||||
|
<h1>Configuração Etiqueta Materia Legislativa</h1> |
||||
|
<form action="." method="post"> |
||||
|
{% csrf_token %} |
||||
|
{{ form|crispy }} |
||||
|
<div class="row"> |
||||
|
<div class="col-md-12"> |
||||
|
<div class="form-group row justify-content-between"> |
||||
|
<a href="{% url 'sapl.base:sistema' %}" class="btn btn-dark">Cancelar</a> |
||||
|
<input type="submit" name="salvar" value="Salvar" class="btn btn-primary float-right" id="submit-id-salvar" onclick="this.form.submit();this.disabled=true;"> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
{% endblock base_content %} |
||||
@ -1,111 +1,109 @@ |
|||||
|
|
||||
{% extends "crud/form.html" %} |
{% extends "crud/form.html" %} |
||||
{% load i18n %} |
{% load i18n %} |
||||
{% load crispy_forms_tags %} |
{% load crispy_forms_tags %} |
||||
{% load common_tags %} |
{% load common_tags %} |
||||
|
|
||||
{% block extra_js %} |
{% block extra_js %} |
||||
|
<script language="Javascript"> |
||||
|
function recuperar_numero_ano() { |
||||
|
var tipo = $("#id_tipo").val() |
||||
|
var ano = $("#id_ano").val() |
||||
|
|
||||
<script language="Javascript"> |
if (tipo){ |
||||
|
$.get("/materia/recuperar-materia", { tipo: tipo, ano: ano }, |
||||
function recuperar_numero_ano() { |
function (data, status) { |
||||
var tipo = $("#id_tipo").val() |
$("#id_numero").val(data.numero); |
||||
var ano = $("#id_ano").val() |
$("#id_ano").val(data.ano); |
||||
|
console.log(data); |
||||
if (tipo) { |
}); |
||||
$.get("/materia/recuperar-materia",{tipo: tipo, ano: ano}, |
} |
||||
function(data, status) { |
|
||||
$("#id_numero").val(data.numero); |
|
||||
$("#id_ano").val(data.ano); |
|
||||
console.log(data) |
|
||||
}); |
|
||||
} |
} |
||||
} |
$("#id_tipo, #id_ano").change(recuperar_numero_ano); |
||||
$("#id_tipo, #id_ano").change(recuperar_numero_ano); |
|
||||
|
|
||||
function compare(a, b) { |
function compare(a, b) { |
||||
if (a.text < b.text) |
if (a.text < b.text) |
||||
return -1; |
return -1; |
||||
if (a.text > b.text) |
if (a.text > b.text) |
||||
return 1; |
return 1; |
||||
return 0; |
return 0; |
||||
} |
} |
||||
|
|
||||
var modal_estilos = 'display: block;' |
var modal_estilos = 'display: block;' |
||||
+'width: 85%; max-width: 600px;' |
+'width: 85%; max-width: 600px;' |
||||
+'background: #fff; padding: 15px;' |
+'background: #fff; padding: 15px;' |
||||
+'border-radius: 5px;' |
+'border-radius: 5px;' |
||||
+'-webkit-box-shadow: 0px 6px 14px -2px rgba(0,0,0,0.75);' |
+'-webkit-box-shadow: 0px 6px 14px -2px rgba(0,0,0,0.75);' |
||||
+'-moz-box-shadow: 0px 6px 14px -2px rgba(0,0,0,0.75);' |
+'-moz-box-shadow: 0px 6px 14px -2px rgba(0,0,0,0.75);' |
||||
+'box-shadow: 0px 6px 14px -2px rgba(0,0,0,0.75);' |
+'box-shadow: 0px 6px 14px -2px rgba(0,0,0,0.75);' |
||||
+'position: fixed;' |
+'position: fixed;' |
||||
+'top: 50%; left: 50%;' |
+'top: 50%; left: 50%;' |
||||
+'transform: translate(-50%,-50%);' |
+'transform: translate(-50%,-50%);' |
||||
+'z-index: 99999999; text-align: center'; |
+'z-index: 99999999; text-align: center'; |
||||
|
|
||||
var fundo_modal_estilos = 'top: 0; right: 0;' |
var fundo_modal_estilos = 'top: 0; right: 0;' |
||||
+'bottom: 0; left: 0; position: fixed;' |
+'bottom: 0; left: 0; position: fixed;' |
||||
+'background-color: rgba(0, 0, 0, 0.6); z-index: 99999999;' |
+'background-color: rgba(0, 0, 0, 0.6); z-index: 99999999;' |
||||
+'display: none;'; |
+'display: none;'; |
||||
|
|
||||
var meu_modal = '<div id="fundo_modal" style="'+fundo_modal_estilos+'">' |
var meu_modal = '<div id="fundo_modal" style="'+fundo_modal_estilos+'">' |
||||
+'<div id="meu_modal" style="'+modal_estilos+'">' |
+'<div id="meu_modal" style="'+modal_estilos+'">' |
||||
+'<h2>Atenção! Ano de apresentação e ano da matéria são diferentes.</h2><br />' |
+'<h2>Atenção! Ano de apresentação e ano da matéria são diferentes.</h2><br />' |
||||
+'<button id="close_model_btn" type="button" class="btn btn-warning" data-dismiss="modal">' |
+'<button id="close_model_btn" type="button" class="btn btn-warning" data-dismiss="modal">' |
||||
+'Compreendo e quero continuar</button>' |
+'Compreendo e quero continuar</button>' |
||||
+'</div></div>'; |
+'</div></div>'; |
||||
|
|
||||
function verifica_ano(){ |
function verifica_ano() { |
||||
let ano = $("select#id_ano.select").val(); |
let ano = $("select#id_ano.select").val(); |
||||
let data_apresentacao = $("input#id_data_apresentacao.dateinput").val(); |
let data_apresentacao = $("input#id_data_apresentacao.dateinput").val(); |
||||
let ano_apresentacao = data_apresentacao.substr(data_apresentacao.length - 4); |
let ano_apresentacao = data_apresentacao.substr(data_apresentacao.length - 4); |
||||
|
|
||||
if(ano && ano_apresentacao && ano_apresentacao != ano){ |
if (ano && ano_apresentacao && ano_apresentacao != ano){ |
||||
$('#fundo_modal').fadeIn(); |
$('#fundo_modal').fadeIn(); |
||||
|
} |
||||
} |
} |
||||
} |
|
||||
|
|
||||
$(document).ready(function() { |
$(document).ready( function() { |
||||
$("#id_tipo_autor").change(function() { |
$("#id_tipo_autor, #id_data_apresentacao").change( function() { |
||||
var tipo_selecionado = $("#id_tipo_autor").val(); |
var tipo_selecionado = $("#id_tipo_autor").val(); |
||||
var autor_selecionado = $("#id_autor").val(); |
var autor_selecionado = $("#id_autor").val(); |
||||
$("#id_autor option").remove() |
|
||||
if (tipo_selecionado !== undefined && tipo_selecionado !== null) { |
$("#id_autor option").remove() |
||||
var json_data = { |
|
||||
|
if (tipo_selecionado !== undefined && tipo_selecionado !== null){ |
||||
|
var json_data = { |
||||
tipo : tipo_selecionado, |
tipo : tipo_selecionado, |
||||
data_relativa : $("#id_data_apresentacao").val() |
data_relativa : $("#id_data_apresentacao").val() |
||||
} |
|
||||
$.getJSON("/api/autor/possiveis", json_data, function(data){ |
|
||||
if (data) { |
|
||||
var results = data.sort(compare); |
|
||||
if (results.length > 1) { |
|
||||
$("#id_autor").append("<option>-----</option>"); |
|
||||
} |
|
||||
$.each(results, function(idx, obj) { |
|
||||
$("#id_autor") |
|
||||
.append($("<option></option>") |
|
||||
.attr("value", obj.value) |
|
||||
.text(obj.text)); |
|
||||
}); |
|
||||
$("#id_autor").val(autor_selecionado); |
|
||||
} |
} |
||||
}); |
$.getJSON("/api/autor/possiveis", json_data, function(data) { |
||||
} |
if (data) { |
||||
}); |
var results = data.sort(compare); |
||||
$("#id_tipo_autor").trigger('change'); |
if (results.length > 1) { |
||||
|
$("#id_autor").append("<option>-----</option>"); |
||||
|
} |
||||
|
$.each(results, function(idx, obj) { |
||||
|
$("#id_autor") |
||||
|
.append($("<option></option>") |
||||
|
.attr("value", obj.value) |
||||
|
.text(obj.text)); |
||||
|
}); |
||||
|
$("#id_autor").val(autor_selecionado); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
$("#id_tipo_autor").trigger('change'); |
||||
|
|
||||
$("body").append(meu_modal); |
$("body").append(meu_modal); |
||||
|
|
||||
$("#fundo_modal, #close_model_btn").click(function(){ $("#fundo_modal").hide(); }); |
$("#fundo_modal, #close_model_btn").click( function() { $("#fundo_modal").hide(); }); |
||||
$("#meu_modal").click(function(e){ e.stopPropagation(); }); |
$("#meu_modal").click( function(e) { e.stopPropagation(); }); |
||||
|
|
||||
$("select#id_ano.select.form-control").change(function(){ |
$("select#id_ano.select.form-control").change( function() { |
||||
verifica_ano(); |
verifica_ano(); |
||||
|
}); |
||||
|
$("input#id_data_apresentacao.dateinput.form-control").change( function() { |
||||
|
verifica_ano(); |
||||
|
}); |
||||
}); |
}); |
||||
$("input#id_data_apresentacao.dateinput.form-control").change(function(){ |
</script> |
||||
verifica_ano(); |
|
||||
}); |
|
||||
}); |
|
||||
</script> |
|
||||
|
|
||||
{% endblock %} |
{% endblock %} |
||||
|
|||||
@ -0,0 +1,40 @@ |
|||||
|
|
||||
|
{% load i18n %} |
||||
|
{% load crispy_forms_tags %} |
||||
|
{% load common_tags %} |
||||
|
{% load static %} |
||||
|
|
||||
|
|
||||
|
<head> |
||||
|
<style> |
||||
|
@page{ |
||||
|
margin: 0cm |
||||
|
} |
||||
|
|
||||
|
div {page-break-inside: avoid;} |
||||
|
p { |
||||
|
font-size:4pt; |
||||
|
margin: 5px; |
||||
|
font-family: Georgia, Times, "Times New Roman"; |
||||
|
} |
||||
|
img { |
||||
|
position: absolute; |
||||
|
bottom:0px; |
||||
|
left: 0px; |
||||
|
padding:10px; |
||||
|
height: 20px; |
||||
|
width: 90%; |
||||
|
} |
||||
|
|
||||
|
</style> |
||||
|
</head> |
||||
|
|
||||
|
<body> |
||||
|
<div> |
||||
|
<p><strong>Materia Legislativa - {{numero}}/{{ano}}</strong></p> |
||||
|
<p>Tipo: {{tipo.sigla}} - {{tipo.descricao}}</p> |
||||
|
<p>Data: {{data_apresentacao}}</p> |
||||
|
<p>Ementa: {{ementa}}</p> |
||||
|
<img src="{{barcode}}"> |
||||
|
</div> |
||||
|
</body> |
||||
@ -0,0 +1,17 @@ |
|||||
|
{% extends "crud/form.html" %} |
||||
|
{% load i18n %} |
||||
|
{% load crispy_forms_tags %} |
||||
|
{% load common_tags %} |
||||
|
|
||||
|
{% block extra_js %} |
||||
|
<script type="text/javascript" > |
||||
|
$(document).ready(function(){ |
||||
|
if("{{ultima_ordem}}" != "None"){ |
||||
|
$("#id_numero_ordem").val({{ultima_ordem}}+1); |
||||
|
} |
||||
|
else{ |
||||
|
$("#id_numero_ordem").val(1); |
||||
|
} |
||||
|
}); |
||||
|
</script> |
||||
|
{% endblock extra_js %} |
||||
@ -1 +1 @@ |
|||||
{"status":"done","publicPath":"/static/sapl/frontend/","chunks":{"chunk-vendors":[{"name":"css/chunk-vendors.42151acc.css","publicPath":"/static/sapl/frontend/css/chunk-vendors.42151acc.css","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.42151acc.css"},{"name":"js/chunk-vendors.f89f6c45.js","publicPath":"/static/sapl/frontend/js/chunk-vendors.f89f6c45.js","path":"../sapl/sapl/static/sapl/frontend/js/chunk-vendors.f89f6c45.js"},{"name":"css/chunk-vendors.42151acc.css.map","publicPath":"/static/sapl/frontend/css/chunk-vendors.42151acc.css.map","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.42151acc.css.map"},{"name":"js/chunk-vendors.f89f6c45.js.map","publicPath":"/static/sapl/frontend/js/chunk-vendors.f89f6c45.js.map","path":"../sapl/sapl/static/sapl/frontend/js/chunk-vendors.f89f6c45.js.map"}],"compilacao":[{"name":"css/compilacao.eff62463.css","publicPath":"/static/sapl/frontend/css/compilacao.eff62463.css","path":"../sapl/sapl/static/sapl/frontend/css/compilacao.eff62463.css"},{"name":"js/compilacao.d421699a.js","publicPath":"/static/sapl/frontend/js/compilacao.d421699a.js","path":"../sapl/sapl/static/sapl/frontend/js/compilacao.d421699a.js"},{"name":"css/compilacao.eff62463.css.map","publicPath":"/static/sapl/frontend/css/compilacao.eff62463.css.map","path":"../sapl/sapl/static/sapl/frontend/css/compilacao.eff62463.css.map"},{"name":"js/compilacao.d421699a.js.map","publicPath":"/static/sapl/frontend/js/compilacao.d421699a.js.map","path":"../sapl/sapl/static/sapl/frontend/js/compilacao.d421699a.js.map"}],"global":[{"name":"css/global.278b5d61.css","publicPath":"/static/sapl/frontend/css/global.278b5d61.css","path":"../sapl/sapl/static/sapl/frontend/css/global.278b5d61.css"},{"name":"js/global.49490c4a.js","publicPath":"/static/sapl/frontend/js/global.49490c4a.js","path":"../sapl/sapl/static/sapl/frontend/js/global.49490c4a.js"},{"name":"css/global.278b5d61.css.map","publicPath":"/static/sapl/frontend/css/global.278b5d61.css.map","path":"../sapl/sapl/static/sapl/frontend/css/global.278b5d61.css.map"},{"name":"js/global.49490c4a.js.map","publicPath":"/static/sapl/frontend/js/global.49490c4a.js.map","path":"../sapl/sapl/static/sapl/frontend/js/global.49490c4a.js.map"}],"painel":[{"name":"css/painel.5d957a9b.css","publicPath":"/static/sapl/frontend/css/painel.5d957a9b.css","path":"../sapl/sapl/static/sapl/frontend/css/painel.5d957a9b.css"},{"name":"js/painel.33e8b8a5.js","publicPath":"/static/sapl/frontend/js/painel.33e8b8a5.js","path":"../sapl/sapl/static/sapl/frontend/js/painel.33e8b8a5.js"},{"name":"css/painel.5d957a9b.css.map","publicPath":"/static/sapl/frontend/css/painel.5d957a9b.css.map","path":"../sapl/sapl/static/sapl/frontend/css/painel.5d957a9b.css.map"},{"name":"js/painel.33e8b8a5.js.map","publicPath":"/static/sapl/frontend/js/painel.33e8b8a5.js.map","path":"../sapl/sapl/static/sapl/frontend/js/painel.33e8b8a5.js.map"}],"parlamentar":[{"name":"css/parlamentar.0e433876.css","publicPath":"/static/sapl/frontend/css/parlamentar.0e433876.css","path":"../sapl/sapl/static/sapl/frontend/css/parlamentar.0e433876.css"},{"name":"js/parlamentar.35e37659.js","publicPath":"/static/sapl/frontend/js/parlamentar.35e37659.js","path":"../sapl/sapl/static/sapl/frontend/js/parlamentar.35e37659.js"},{"name":"css/parlamentar.0e433876.css.map","publicPath":"/static/sapl/frontend/css/parlamentar.0e433876.css.map","path":"../sapl/sapl/static/sapl/frontend/css/parlamentar.0e433876.css.map"},{"name":"js/parlamentar.35e37659.js.map","publicPath":"/static/sapl/frontend/js/parlamentar.35e37659.js.map","path":"../sapl/sapl/static/sapl/frontend/js/parlamentar.35e37659.js.map"}]}} |
{"status":"done","publicPath":"/static/sapl/frontend/","chunks":{"chunk-vendors":[{"name":"css/chunk-vendors.42151acc.css","publicPath":"/static/sapl/frontend/css/chunk-vendors.42151acc.css","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.42151acc.css"},{"name":"js/chunk-vendors.f8cff174.js","publicPath":"/static/sapl/frontend/js/chunk-vendors.f8cff174.js","path":"../sapl/sapl/static/sapl/frontend/js/chunk-vendors.f8cff174.js"},{"name":"css/chunk-vendors.42151acc.css.map","publicPath":"/static/sapl/frontend/css/chunk-vendors.42151acc.css.map","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.42151acc.css.map"},{"name":"js/chunk-vendors.f8cff174.js.map","publicPath":"/static/sapl/frontend/js/chunk-vendors.f8cff174.js.map","path":"../sapl/sapl/static/sapl/frontend/js/chunk-vendors.f8cff174.js.map"}],"compilacao":[{"name":"css/compilacao.eff62463.css","publicPath":"/static/sapl/frontend/css/compilacao.eff62463.css","path":"../sapl/sapl/static/sapl/frontend/css/compilacao.eff62463.css"},{"name":"js/compilacao.d421699a.js","publicPath":"/static/sapl/frontend/js/compilacao.d421699a.js","path":"../sapl/sapl/static/sapl/frontend/js/compilacao.d421699a.js"},{"name":"css/compilacao.eff62463.css.map","publicPath":"/static/sapl/frontend/css/compilacao.eff62463.css.map","path":"../sapl/sapl/static/sapl/frontend/css/compilacao.eff62463.css.map"},{"name":"js/compilacao.d421699a.js.map","publicPath":"/static/sapl/frontend/js/compilacao.d421699a.js.map","path":"../sapl/sapl/static/sapl/frontend/js/compilacao.d421699a.js.map"}],"global":[{"name":"css/global.278b5d61.css","publicPath":"/static/sapl/frontend/css/global.278b5d61.css","path":"../sapl/sapl/static/sapl/frontend/css/global.278b5d61.css"},{"name":"js/global.49490c4a.js","publicPath":"/static/sapl/frontend/js/global.49490c4a.js","path":"../sapl/sapl/static/sapl/frontend/js/global.49490c4a.js"},{"name":"css/global.278b5d61.css.map","publicPath":"/static/sapl/frontend/css/global.278b5d61.css.map","path":"../sapl/sapl/static/sapl/frontend/css/global.278b5d61.css.map"},{"name":"js/global.49490c4a.js.map","publicPath":"/static/sapl/frontend/js/global.49490c4a.js.map","path":"../sapl/sapl/static/sapl/frontend/js/global.49490c4a.js.map"}],"painel":[{"name":"css/painel.5d957a9b.css","publicPath":"/static/sapl/frontend/css/painel.5d957a9b.css","path":"../sapl/sapl/static/sapl/frontend/css/painel.5d957a9b.css"},{"name":"js/painel.33e8b8a5.js","publicPath":"/static/sapl/frontend/js/painel.33e8b8a5.js","path":"../sapl/sapl/static/sapl/frontend/js/painel.33e8b8a5.js"},{"name":"css/painel.5d957a9b.css.map","publicPath":"/static/sapl/frontend/css/painel.5d957a9b.css.map","path":"../sapl/sapl/static/sapl/frontend/css/painel.5d957a9b.css.map"},{"name":"js/painel.33e8b8a5.js.map","publicPath":"/static/sapl/frontend/js/painel.33e8b8a5.js.map","path":"../sapl/sapl/static/sapl/frontend/js/painel.33e8b8a5.js.map"}],"parlamentar":[{"name":"css/parlamentar.0e433876.css","publicPath":"/static/sapl/frontend/css/parlamentar.0e433876.css","path":"../sapl/sapl/static/sapl/frontend/css/parlamentar.0e433876.css"},{"name":"js/parlamentar.307451cf.js","publicPath":"/static/sapl/frontend/js/parlamentar.307451cf.js","path":"../sapl/sapl/static/sapl/frontend/js/parlamentar.307451cf.js"},{"name":"css/parlamentar.0e433876.css.map","publicPath":"/static/sapl/frontend/css/parlamentar.0e433876.css.map","path":"../sapl/sapl/static/sapl/frontend/css/parlamentar.0e433876.css.map"},{"name":"js/parlamentar.307451cf.js.map","publicPath":"/static/sapl/frontend/js/parlamentar.307451cf.js.map","path":"../sapl/sapl/static/sapl/frontend/js/parlamentar.307451cf.js.map"}]}} |
||||
@ -0,0 +1,35 @@ |
|||||
|
# Gerar hash de proposições para recebimento sem recibo |
||||
|
from sapl.materia.models import Proposicao |
||||
|
from sapl.utils import gerar_hash_arquivo, SEPARADOR_HASH_PROPOSICAO |
||||
|
from datetime import datetime |
||||
|
|
||||
|
def gerar_hash(proposicao): |
||||
|
if proposicao.texto_original: |
||||
|
try: |
||||
|
proposicao.hash_code = gerar_hash_arquivo( |
||||
|
proposicao.texto_original.path, str(proposicao.pk)) |
||||
|
except IOError: |
||||
|
raise Exception("Existem proposicoes com arquivos inexistentes.") |
||||
|
elif proposicao.texto_articulado.exists(): |
||||
|
ta = proposicao.texto_articulado.first() |
||||
|
proposicao.hash_code = 'P' + ta.hash() + SEPARADOR_HASH_PROPOSICAO + str(proposicao.pk) |
||||
|
print(proposicao.hash_code) |
||||
|
proposicao.save() |
||||
|
|
||||
|
|
||||
|
def gerar_hash_proposicoes(): |
||||
|
di = datetime.now() |
||||
|
print(di) |
||||
|
props = Proposicao.objects.filter(hash_code='', data_recebimento__isnull=True).exclude(data_envio__isnull=True) |
||||
|
print("Total de proposicoes: %s" % props.count()) |
||||
|
for prop in props: |
||||
|
try: |
||||
|
print(".",end="") |
||||
|
gerar_hash(prop) |
||||
|
except Exception as e: |
||||
|
print('Erro para proposicao', prop) |
||||
|
print(e) |
||||
|
|
||||
|
elapsed = datetime.now() - di |
||||
|
print("\n {}s".format(elapsed.seconds)) |
||||
|
|
||||
Loading…
Reference in new issue