added some filters to templates

This commit is contained in:
2025-08-03 10:50:59 +03:00
parent e824e87953
commit 13c4c324fc
29 changed files with 180 additions and 89 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
{% extends 'list-crud.html' %}
{% load static %}
{% load filters %}
{% block extra_styles %}
<link rel="stylesheet" href="{% static 'styles/details.css' %}">
@@ -170,7 +171,7 @@
</div>
<div class="detail-row">
<div class="detail-label">Expedited On:</div>
<div class="detail-value">{{ container.expedited_on|date:"Y-m-d H:i"|default:"-" }}</div>
<div class="detail-value">{{ container.expedited_on|bg_date|default:"-" }}</div>
</div>
<div class="detail-row">
<div class="detail-label">Expedition Vehicle:</div>
+41
View File
@@ -0,0 +1,41 @@
{% extends 'list-crud.html' %}
{% load static %}
{% load filters %}
{% block filter %}
<form id="filterForm" method="get" style="display: inline;">
<input type="hidden" name="filter" id="filterInput" value="{{ request.GET.filter|default:'active' }}">
<button type="button" class="btn btn-primary" id="activeBtn">Active</button>
<button type="button" class="btn btn-primary" id="allBtn">All</button>
</form>
{% endblock filter %}
{% block table_header %}
<th style="display: none;">Select</th>
<th>Company</th>
<th>Invoice №</th>
<th>Total amount</th>
<th>Created on</th>
<th>Paid</th>
<th>Paid on</th>
{% endblock table_header %}
{% block table_data %}
<td>{{ object.company.name }}</td>
<td>{{ object.invoice_number }}</td>
<td>{{ object.total_amount }}</td>
<td>{{ object.created_on|bg_date }}</td>
<td>{{ object.paid|yesno:"Yes,No" }}</td>
<td>{{ object.paid_on|bg_date|default:"" }}</td>
{% endblock %}
{% block buttons %}
{# <a href="{% url 'client_booking_create' %}" class="btn btn-primary">Create booking</a>#}
{# <a href="#" id="editBtn" data-url="{% url 'client_booking_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>#}
{# <button id="deleteButton" class="btn btn-danger">Delete Preinfo</button>#}
{# #}
{# <button class="btn btn-primary" type="button" onclick="window.location.href='{% url 'client_booking_create' %}'">Create booking</button>#}
{# <button class="btn btn-primary" type="button" id="editBtn" data-url="{% url 'client_booking_update' pk=0 %}" data-requires-selection disabled>Edit booking</button>#}
{# <button class="btn btn-primary" type="button" id="deleteBtn" data-url="{% url 'client_booking_active' pk=0 %}" data-requires-selection disabled>Delete booking</button> #}
{% endblock buttons %}