Browse Source

Dinamiza pesquisa por Sessão Plenária

pull/1022/head
Eduardo Calil 8 years ago
parent
commit
575a47af4c
  1. 1
      sapl/settings.py
  2. 2
      sapl/templates/base.html
  3. 47
      sapl/templates/sessao/sessaoplenaria_filter.html
  4. 1
      sapl/templates/sessao/sessaoplenaria_form.html

1
sapl/settings.py

@ -237,6 +237,7 @@ BOWER_INSTALLED_APPS = (
'jQuery-Mask-Plugin#1.14.0',
'jsdiff#2.2.2',
'https://github.com/interlegis/drunken-parrot-flat-ui.git',
'jquery-query-object#2.2.3',
)
# Additional search paths for SASS files when using the @import statement

2
sapl/templates/base.html

@ -224,6 +224,8 @@
<script type="text/javascript" src="{% static 'js/app.js' %}"></script>
<script type="text/javascript" src="{% static 'jquery-query-object/jquery.query-object.js' %}"></script>
{% block extra_js %}{% endblock %}
{% endblock foot_js %}

47
sapl/templates/sessao/sessaoplenaria_filter.html

@ -9,16 +9,11 @@
{% blocktrans with verbose_name=view.verbose_name %} Adicionar Sessão Plenária {% endblocktrans %}
{% endif %}
</a>
{% if filter_url %}
<a href="{% url 'sapl.sessao:pesquisar_sessao' %}" class="btn btn-default">{% trans 'Fazer nova pesquisa' %}</a>
{% endif %}
</div>
{% endblock %}
{% block detail_content %}
{% if not filter_url %}
{% crispy filter.form %}
{% endif %}
{% if filter_url %}
<p></p>
@ -51,3 +46,45 @@
{% endblock detail_content %}
{% block table_content %}
{% endblock table_content %}
{% block extra_js %}
<script type="text/javascript">
var querystring = "{{filter_url|safe}}"
// Esse IF garante que já existe uma querystring, ou seja, algo já foi pesquisado
if(querystring.length != 0){
$('#id_data_inicio__year').on({
change: function(){
setTimeout(function(){
window.location.search = jQuery.query.set("data_inicio__year", $('#id_data_inicio__year').val());
});
}})
$('#id_data_inicio__month').on({
change: function(){
setTimeout(function(){
window.location.search = jQuery.query.set("data_inicio__month", $('#id_data_inicio__month').val());
});
}})
$('#id_data_inicio__day').on({
change: function(){
setTimeout(function(){
window.location.search = jQuery.query.set("data_inicio__day", $('#id_data_inicio__day').val());
});
}})
$('#id_tipo').on({
change: function(){
setTimeout(function(){
window.location.search = jQuery.query.set("tipo", $('#id_tipo').val());
});
}})
}
</script>
{% endblock %}

1
sapl/templates/sessao/sessaoplenaria_form.html

@ -31,7 +31,6 @@
$(function() {
function altera_legislatura(){
console.debug('hey');
var id_legislatura = $("#id_legislatura").val();
var id_sessao_leg = $("#id_sessao_legislativa").val();
$("#id_sessao_legislativa option").remove();

Loading…
Cancel
Save