Browse Source

Subindo o filtro provisório com as escalas corretas dos itens na tela

Co-authored-by: Davi-Galati <Davi-Galati@users.noreply.github.com>
Dockerlg
Lude Ribeiro 3 years ago
parent
commit
a8aae1a314
  1. 3
      sigi/apps/convenios/admin.py
  2. 103
      sigi/templates/admin/change_list.html

3
sigi/apps/convenios/admin.py

@ -10,11 +10,8 @@ from sigi.apps.utils import queryset_ascii
from sigi.apps.servidores.models import Servidor from sigi.apps.servidores.models import Servidor
from sigi.apps.casas.admin import ConveniosInline, GerentesInterlegisFilter from sigi.apps.casas.admin import ConveniosInline, GerentesInterlegisFilter
from sigi.apps.utils.mixins import CartExportReportMixin, LabeledResourse from sigi.apps.utils.mixins import CartExportReportMixin, LabeledResourse
<<<<<<< HEAD
from django_weasyprint.views import WeasyTemplateResponse from django_weasyprint.views import WeasyTemplateResponse
=======
from sigi.apps.utils.filters import DateRangeFilter from sigi.apps.utils.filters import DateRangeFilter
>>>>>>> 96ea3b8f2dd4c7380c7e59f4a0546e6c27b09ffe
class ConvenioExportResourse(LabeledResourse): class ConvenioExportResourse(LabeledResourse):
class Meta: class Meta:

103
sigi/templates/admin/change_list.html

@ -2,15 +2,49 @@
{% load i18n static admin_list %} {% load i18n static admin_list %}
{% load i18n admin_urls %} {% load i18n admin_urls %}
{% block extrastyle %}
{{ block.super }}
<style>
.side-wrapper {
width: 100%;
}
</style>
<style>
#changelist {
width:100%
}
</style>
{% endblock extrastyle %}
{% block breadcrumbs %}{% endblock %} {% block breadcrumbs %}{% endblock %}
{% block object-tools %} {% block footer %}
<div class="fixed-action-btn"> {{ block.super }}
<a class="btn-floating btn-large"> <script>
$(document).ready(function(){
$('.fixed-action-btn').floatingActionButton();
M.Tooltip.init($('.tooltipped'), {});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.getElementById('filter');
var instances = M.Sidenav.init(elems,'');
});
</script>
{% endblock footer %}
{% block content %}
<div id="content-main" class="list-content">
{% block object-tools %}
<div class="fixed-action-btn">
<a class="btn-floating btn-large">
<i class="large material-icons">build</i> <i class="large material-icons">build</i>
</a> </a>
<ul> <ul>
{% block object-tools-items %} {% block object-tools-items %}
{% if has_add_permission %} {% if has_add_permission %}
<li> <li>
{% url cl.opts|admin_urlname:'add' as add_url %} {% url cl.opts|admin_urlname:'add' as add_url %}
@ -19,17 +53,52 @@
</a> </a>
</li> </li>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
</ul> </ul>
</div> </div>
{% endblock %} {% endblock %}
{% if cl.formset.errors %}
<p class="errornote">
{% if cl.formset.total_error_count == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
</p>
{{ cl.formset.non_form_errors }}
{% endif %}
<div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
{% block footer %} {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
{{ block.super }}
<script> <form id="changelist-form" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %}
$(document).ready(function(){ {% if cl.formset %}
$('.fixed-action-btn').floatingActionButton(); <div>{{ cl.formset.management_form }}</div>
M.Tooltip.init($('.tooltipped'), {}); {% endif %}
});
</script> {% block result_list %}
{% endblock footer %} {% result_list cl %}
{% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %}
{% endblock %}
{% block pagination %}{% pagination cl %}{% endblock %}
</form>
</div>
<ul id="filter" class="sidenav">
<div id="side-wrapper" class="side-wrapper">
<div id="changelist-form" class="card">
{% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %}
</div>
<div class="card">
{% block search %}{% search_form cl %}{% endblock %}
</div>
<div class="card">
{% block filters %}
{% if cl.has_filters %}
<div class="card-content" id="changelist-filter">
<label class="label">{% trans 'Filter' %}</label>
{% for spec in cl.filter_specs %}{% admin_list_filter cl spec %}{% endfor %}
</div>
{% endif %}
{% endblock %}
</div>
</div>
</ul>
<a href="#" data-target="filter" class="top sidenav-trigger"><i class="small material-icons">filter_list</i></a>
</div>
{% endblock %}

Loading…
Cancel
Save