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
+15 -11
View File
@@ -1,4 +1,5 @@
{% load static %}
{% load permission_tags %}
<aside class="sidebar">
<div class="header">
<a href="{% url 'index' %}" class="link-no-style">
@@ -14,6 +15,7 @@
{% url 'client_company' as client_company_url %}
{% url 'client_line' as client_line_url %}
{% url 'user_list' as user_list_url %}
{% url 'payments_list' as payments_list_url %}
<nav class="nav-menu">
<div class="section-title">Main</div>
<a href="{{ dashboard_url }}" class="nav-item {% if request.path == dashboard_url %}active{% endif %}">
@@ -40,17 +42,19 @@
</svg>
Bookings
</a>
<div class="section-title account">Reports</div>
<a href="#" class="nav-item">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<g>
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1.95-9H15v2h-4.95a2.5 2.5 0 0 0 4.064 1.41l1.7 1.133A4.5 4.5 0 0 1 8.028 13H7v-2h1.027a4.5 4.5 0 0 1 7.788-2.543L14.114 9.59A2.5 2.5 0 0 0 10.05 11z"/>
</g>
</svg>
Reports
</a>
{% if request.user.UserType == 'CA' or 1 == 1 %}
{% if request.user|has_company_perm:'can_view_payment' or request.user.user_type == 'CA'%}
<div class="section-title account">Reports</div>
<a href="{{ payments_list_url }}" class="nav-item">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<g>
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1.95-9H15v2h-4.95a2.5 2.5 0 0 0 4.064 1.41l1.7 1.133A4.5 4.5 0 0 1 8.028 13H7v-2h1.027a4.5 4.5 0 0 1 7.788-2.543L14.114 9.59A2.5 2.5 0 0 0 10.05 11z"/>
</g>
</svg>
Reports
</a>
{% endif %}
{% if request.user.user_type == 'CA' %}
<div class="section-title account">Nomenclatures</div>
<a href="{{ user_list_url }}" class="nav-item {% if request.path == user_list_url %}active{% endif %}">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+2 -1
View File
@@ -1,5 +1,6 @@
{% extends 'list-crud.html' %}
{% load static %}
{% load filters %}
{% block filter %}
<form id="filterForm" method="get" style="display: inline;">
@@ -33,7 +34,7 @@
<td>{{ object.containers_left }}</td>
<td>{{ object.vehicles }}</td>
<td>{{ object.vehicles_left }}</td>
<td>{{ object.created_on }}</td>
<td>{{ object.created_on|bg_date }}</td>
<td>{{ object.created_by.username }}</td>
<td>{{ object.status }}</td>
{% endblock %}
+2 -1
View File
@@ -1,5 +1,6 @@
{% extends 'list-crud.html' %}
{% load static %}
{% load filters %}
{% block filter %}
<form id="filterForm" method="get" style="display: inline;">
@@ -25,7 +26,7 @@
<td>{{ object.container_number|upper }}</td>
<td>{{ object.container_type }}</td>
<td>{{ object.line.short_name }}</td>
<td>{{ object.created_on|date:"d.m.Y h:m" }}</td>
<td>{{ object.created_on|bg_date }}</td>
<td>{{ object.created_by.username }}</td>
<td>{{ object.received|yesno:"Received,Pending" }}</td>
{% endblock %}
+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 %}
+27 -10
View File
@@ -1,4 +1,6 @@
{% load static %}
{% load permission_tags %}
<aside class="sidebar">
<div class="header">
<a href="{% url 'index' %}" class="link-no-style">
@@ -16,6 +18,7 @@
{% url 'employee_line' as employee_line_url %}
{% url 'user_list' as user_list_url %}
{% url 'not_paid' as not_paid_list_url %}
{% url 'payments_list' as payments_list_url %}
<nav class="nav-menu">
<div class="section-title">Main</div>
@@ -49,16 +52,30 @@
</svg>
Bookings
</a>
<div class="section-title account">Reports</div>
<a href="{{ not_paid_list_url }}" class="nav-item {% if request.path == not_paid_list_url %}active{% endif %}" id="ordersNav">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<g>
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1.95-9H15v2h-4.95a2.5 2.5 0 0 0 4.064 1.41l1.7 1.133A4.5 4.5 0 0 1 8.028 13H7v-2h1.027a4.5 4.5 0 0 1 7.788-2.543L14.114 9.59A2.5 2.5 0 0 0 10.05 11z"/>
</g>
</svg>
Reports
</a>
{% if request.user|has_employee_perm:'can_view_payments' %}
<div class="section-title account">Reports</div>
{% if request.user|has_employee_perm:'can_manage_payments' %}
<a href="{{ not_paid_list_url }}" class="nav-item {% if request.path == not_paid_list_url %}active{% endif %}" id="ordersNav">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<g>
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1.95-9H15v2h-4.95a2.5 2.5 0 0 0 4.064 1.41l1.7 1.133A4.5 4.5 0 0 1 8.028 13H7v-2h1.027a4.5 4.5 0 0 1 7.788-2.543L14.114 9.59A2.5 2.5 0 0 0 10.05 11z"/>
</g>
</svg>
Reports
</a>
{% endif %}
<a href="{{ payments_list_url }}" class="nav-item {% if request.path == payments_list_url %}active{% endif %}" id="ordersNav">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<g>
<path fill="none" d="M0 0h24v24H0z"/>
<path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1.95-9H15v2h-4.95a2.5 2.5 0 0 0 4.064 1.41l1.7 1.133A4.5 4.5 0 0 1 8.028 13H7v-2h1.027a4.5 4.5 0 0 1 7.788-2.543L14.114 9.59A2.5 2.5 0 0 0 10.05 11z"/>
</g>
</svg>
Payments
</a>
{% endif %}
{% if request.user.UserType == 'CA' or 1 == 1 %}
<div class="section-title account">Nomenclatures</div>
<a href="{{ user_list_url }}" class="nav-item {% if request.path == user_list_url %}active{% endif %}">
+2 -1
View File
@@ -1,5 +1,6 @@
{% extends 'list-crud.html' %}
{% load custom_filters %}
{% load filters %}
{% load static %}
{% block filter %}
@@ -34,7 +35,7 @@
<td>{{ object.containers_left }}</td>
<td>{{ object.vehicles|distinct_vehicles }}</td>
<td>{{ object.vehicles_left|distinct_vehicles }}</td>
<td>{{ object.created_on }}</td>
<td>{{ object.created_on|bg_date }}</td>
<td>{{ object.created_by.username }}</td>
<td>{{ object.status }}</td>
{% endblock %}
+2 -1
View File
@@ -1,5 +1,6 @@
{% extends 'list-crud.html' %}
{% load static %}
{% load filters %}
{% block filter %}
<form id="filterForm" method="get" style="display: inline;">
@@ -24,7 +25,7 @@
<td>{{ object.number }}</td>
<td>{{ object.container_type }}</td>
<td>{{ object.line.short_name }}</td>
<td>{{ object.received_on|date:"y.m.d h:m" }}</td>
<td>{{ object.received_on|bg_date }}</td>
<td>{{ object.position }}</td>
<td>{{ object.swept|yesno:"Yes," }}</td>
<td>{{ object.washed|yesno:"Yes," }}</td>
+3 -3
View File
@@ -1,5 +1,5 @@
{% extends 'common/base.html' %}
{% load filters %}
{% block content %}
<form method="POST">
{% csrf_token %}
@@ -32,8 +32,8 @@
<td>{{ container.number }}</td>
<td>{{ container.container_type }}</td>
<td>{{ container.line.company.short_name }}</td>
<td>{{ container.received_on|date:"Y-m-d" }}</td>
<td>{{ container.expedited_on|date:"Y-m-d" }}</td>
<td>{{ container.received_on|bg_date }}</td>
<td>{{ container.expedited_on|bg_date }}</td>
</tr>
{% endfor %}
</tbody>
+2 -1
View File
@@ -1,5 +1,6 @@
{% extends 'list-crud.html' %}
{% load static %}
{% load filters %}
{% block filter %}
<form id="filterForm" method="get" style="display: inline;">
@@ -25,7 +26,7 @@
<td>{{ object.container_number }}</td>
<td>{{ object.container_type }}</td>
<td>{{ object.line.short_name }}</td>
<td>{{ object.created_on }}</td>
<td>{{ object.created_on|bg_date }}</td>
<td>{{ object.created_by.username }}</td>
<td>{{ object.received|yesno:"Received,Pending" }}</td>
{% endblock %}