Browse Source

Filtro flutuante no changelist

pull/159/head
Sesostris Vieira 3 years ago
parent
commit
59e4cc1a2f
  1. 22
      sigi/static/css/changelists.css
  2. 57
      sigi/templates/admin/change_list.html

22
sigi/static/css/changelists.css

@ -0,0 +1,22 @@
.side-wrapper {
width: 100%;
}
#changelist {
width:100%
}
.float-filter {
right: 0;
left: auto;
position: fixed;
width: 300px;
top: 0;
margin: 0;
height: calc(100% + 60px);
padding-bottom: 60px;
background-color: #fff;
z-index: 999;
overflow-y: auto;
will-change: transform;
backface-visibility: hidden;
}

57
sigi/templates/admin/change_list.html

@ -4,33 +4,12 @@
{% block extrastyle %}
{{ block.super }}
<style>
.side-wrapper {
width: 100%;
}
#changelist {
width:100%
}
.float-filter {
right: 0;
left: auto;
position: fixed;
width: 300px;
top: 0;
margin: 0;
height: calc(100% + 60px);
padding-bottom: 60px;
background-color: #fff;
z-index: 999;
overflow-y: auto;
will-change: transform;
backface-visibility: hidden;
}
</style>
{% endblock extrastyle %}
<link rel="stylesheet" type="text/css" href="{% static 'material/admin/css/changelists.min.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'css/changelists.css' %}">
{% endblock %}
{% block content %}
<div id="content-main" class="list-content">
{% block object-tools %}
<div class="fixed-action-btn">
<a class="btn-floating btn-large">
@ -55,7 +34,28 @@
</ul>
</div>
{% 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 date_hierarchy %}{% date_hierarchy cl %}{% endblock %}
<form id="changelist-form" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% csrf_token %}
{% if cl.formset %}
<div>{{ cl.formset.management_form }}</div>
{% endif %}
{% block result_list %}
{% 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>
{% block side_wrapper %}
<div id="float-filter" class="float-filter hide">
<div id="side-wrapper" class="side-wrapper">
@ -73,6 +73,9 @@
</div>
</div>
{% endblock %}
</div>
</div>
{% endblock %}
{% block footer %}
{{ block.super }}
@ -80,7 +83,6 @@
$(document).ready(function(){
$('.fixed-action-btn').floatingActionButton();
M.Tooltip.init($('.tooltipped'), {});
// M.Sidenav.init($("#filter"), {edge: 'right'});
$('.float-filter').each(function() {
var id=this.id;
$(`[data-target="${id}"]`).on("click", function(e) {
@ -93,4 +95,3 @@
});
</script>
{% endblock footer %}

Loading…
Cancel
Save