filter 2 page remove from filter page

This commit is contained in:
fjrodriguez
2022-12-05 09:56:04 -06:00
parent 896e39644f
commit 4604c0894c
9 changed files with 64 additions and 14 deletions

View File

@@ -11,13 +11,11 @@
<div class="form-group">
<label for="{{form.RFC.name}}"><strong> {{form.RFC.label|capfirst}} </strong></label>
{% render_field form.RFC id+="add" id+=form.RFC.name placeholder=form.RFC.label class="form-control" type="text" autocomplete="off" %}
</div>
</div>
<div class="form-group">
<label for="{{form.Nombre.name}}"><strong> {{form.Nombre.label|capfirst}} </strong></label>
{% render_field form.Nombre id+="add" id+=form.Nombre.name placeholder=form.Nombre.label class="form-control" type="text" autocomplete="off" %}
</div>
<div class="form-group form-check">
{% render_field form.Activo class+="form-checkbox" type="checkbox" %}
<label class="form-check-label" for="{{form.Activo.label}}">Activo</label>
@@ -32,6 +30,7 @@
{% block scripts %}
<script>
window.addEventListener("load", (event)=>{
if(!id_Activo.checked){
id_fecha_baja.setAttribute('required','')

View File

@@ -20,17 +20,27 @@ Timbres disponibles Comercio Digital: {{saldo.saldo}}
</th>
<th>Nombre</th>
<th>Totales Mes {{fecha|date:"F"}}</th>
<th>Estado</th>
<th scope="col">actions</th>
</tr>
</thead>
<tbody>
{% for obj in lista %}
<tr class="">
<tr class="{% if not obj.Activo %}table-danger{% endif %}">
<td>
<a href="{% url 'update_cliente' obj.pk %}">{{obj.RFC}}</a>
</td>
<td>{{obj.Nombre}}</td>
<td>{{obj.Nombre}} </td>
<td>{{obj.timbres_mes_count}}</td>
<td>
{% if obj.Activo %}
Activo
{% else %}
Inactivo
{% endif %}
</td>
<td>
{% if request.user.is_staff %}
<a href="{% url 'timbres_cliente' obj.RFC %}" class="btn btn-info">Ver Timbres</a>

View File

@@ -6,6 +6,15 @@
{% block content %}
<h1>Timbres <strong>{{RFC}}</strong> </h1>
<h2>Timbres totales: <strong></strong>{{conteo}}</strong></h2>
<span class="navbar-text mr-2">
{% if filters.datepicker%}
De fecha: <strong>"{{filters.datepicker}}"</strong>
{% endif %}
{% if filters.datepickerFin %}
A fecha: <strong>"{{filters.datepickerFin}}"</strong>
{% endif %}
</span>
<br><br>

View File

@@ -21,7 +21,9 @@
<div class="container-fluid">
{% include 'sidebar.html' %}
<h1>{% block titlePage %}{% endblock titlePage %}</h1>
{% include 'partials/messages.html' %}
{% block content %}{% endblock content %}
{% include 'paginator.html' %}
</div>

View File

@@ -1,4 +1,6 @@
{% if lista.has_other_pages %}
<nav>
<ul class="pagination justify-content-center">
{% if lista.has_previous %}
@@ -17,7 +19,7 @@
{% if lista.number == p %}
<li class="page-item"><a class="page-link" style="color: red;" href="#">{{ p }}</a></li>
{% else %}
<li class="page-item"><a class="page-link" href="?page={{ p }}">{{ p }}</a></li>
<li class="page-item"><a class="page-link" href="?page={{ p }}{% for i,v in filters.items %}&{{i}}={{v}}{% endfor%}">{{ p }}</a></li>
{% endif %}
{% endfor %}

View File

@@ -0,0 +1,13 @@
{% if form.errors %}
{% for field in form %}
{% for error in field.errors %}
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<strong>-{{field.name}}</strong><br>
<strong>{{ error|escape }}</strong> <br>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{% endfor %}
{% endfor %}
{% endif %}