This commit is contained in:
2025-07-15 20:57:15 +03:00
parent f6c78a20a3
commit 0ffd79cee9
51 changed files with 1227 additions and 653 deletions
+38 -35
View File
@@ -1,40 +1,43 @@
{% extends 'employee-base.html' %}
{% extends 'list-crud.html' %}
{% load static %}
{% block content %}
<table>
<tr>
<th>Status</th>
<th>Booking №</th>
<th>Vehicles</th>
<th>Container number</th>
<th>Container type</th>
<th>Container count</th>
<th>Line</th>
<th>Carrier</th>
<th>Containers expedited</th>
<th>Vehicles left</th>
</tr>
{% block table_header %}
<th style="display: none;">Select</th>
<th>Line</th>
<th>Booking №</th>
<th>Container type</th>
<th>Container №</th>
<th>Containers count</th>
<th>Containers left</th>
<th>Vehicles</th>
<th>Vehicles left</th>
<th>Created on</th>
<th>Created by</th>
{% endblock table_header %}
{% for booking in bookings %}
<tr>
<td>{{ booking.status }}</td>
<td>{{ booking.number }}</td>
<td>{{ booking.vehicles }}</td>
<td>{{ booking.container_number }}</td>
<td>{{ booking.container_type }}</td>
<td>{{ booking.container_count }}</td>
<td>{{ booking.line.short_name }}</td>
<td>{{ booking.carrier }}</td>
<td>{{ booking.container_expedited_count }}</td>
<td>{{ booking.vehicles_left }}</td>
<td>
{# <a href="{% url 'employee:preinfo_edit' preinfo.id %}">Edit</a> |#}
{# <a href="{% url 'employee:preinfo_delete' preinfo.id %}">Delete</a>#}
</td>
</tr>
{% block table_data %}
<td>{{ object.line.short_name }}</td>
<td>{{ object.number }}</td>
<td>{{ object.container_type }}</td>
<td>{{ object.container_number }}</td>
<td>{{ object.container_count }}</td>
<td>{{ object.containers_left }}</td>
<td>{{ object.vehicles }}</td>
<td>{{ object.vehicles_left }}</td>
<td>{{ object.created_on }}</td>
<td>{{ object.created_by.username }}</td>
{% endblock %}
{% endfor %}
{% block buttons %}
{# <a href="{% url 'employee_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>#}
{% endblock buttons %}
</table>
{% endblock content %}
{% block create_modal_header %}
<h2>Create Booking</h2>
{% endblock %}
{% block modal_header %}
<h2>Edit Booking</h2>
{% endblock modal_header %}
+2 -2
View File
@@ -15,8 +15,8 @@
{% endblock %}
{% block buttons %}
<a href="{% url 'company_create' %}" class="btn btn-primary">Create company</a>
<a href="#" id="editBtn" data-url="{% url 'company_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>
<a href="{% url 'employee_company_create' %}" class="btn btn-primary">Create company</a>
<a href="#" id="editBtn" data-url="{% url 'employee_company_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>
<button id="deleteButton" class="btn btn-danger">Delete Preinfo</button>
{% endblock buttons %}
+22 -23
View File
@@ -1,9 +1,7 @@
{% extends 'employee-base.html' %}
{% extends 'list-crud.html' %}
{% load static %}
{% block content %}
<table>
<tr>
{% block table_header %}
<th>Container №</th>
<th>Container type</th>
<th>Line</th>
@@ -12,25 +10,26 @@
<th>Swept</th>
<th>Washed</th>
<th>Booking</th>
</tr>
{% endblock table_header %}
{% for container in containers %}
<tr>
<td>{{ container.number }}</td>
<td>{{ container.container_type }}</td>
<td>{{ container.line.short_name }}</td>
<td>{{ container.received_on }}</td>
<td>{{ container.position }}</td>
<td>{{ container.swept }}</td>
<td>{{ container.washed }}</td>
<td>{{ container.booking.id }}</td>
<td>
{# <a href="{% url 'employee:preinfo_edit' preinfo.id %}">Edit</a> |#}
{# <a href="{% url 'employee:preinfo_delete' preinfo.id %}">Delete</a>#}
</td>
</tr>
{% block table_data %}
<td>{{ object.number }}</td>
<td>{{ object.container_type }}</td>
<td>{{ object.line.short_name }}</td>
<td>{{ object.received_on }}</td>
<td>{{ object.position }}</td>
<td>{{ object.swept }}</td>
<td>{{ object.washed }}</td>
<td>{{ object.booking.number }}</td>
{% endblock %}
{% endfor %}
{% block buttons %}
{% endblock buttons %}
</table>
{% endblock content %}
{% block create_modal_header %}
<h2>Create Container</h2>
{% endblock %}
{% block modal_header %}
<h2>Edit Container</h2>
{% endblock modal_header %}
+1 -1
View File
@@ -1,4 +1,4 @@
{% extends 'client-base.html' %}
{% extends 'employee-base.html' %}
{% load static %}
{% block content %}
+5 -3
View File
@@ -3,20 +3,22 @@
{% block table_header %}
<th style="display: none;">Select</th>
<th>Company</th>
<th>Line name</th>
<th>Short name</th>
<th>Description</th>
{% endblock table_header %}
{% block table_data %}
<td>{{ object.company }}</td>
<td>{{ object.name }}</td>
<td>{{ object.short_name }}</td>
<td>{{ object.description }}</td>
{% endblock %}
{% block buttons %}
<a href="{% url 'client_line_create' %}" class="btn btn-primary">Create line</a>
<a href="#" id="editBtn" data-url="{% url 'client_line_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>
<a href="{% url 'employee_line_create' %}" class="btn btn-primary">Create line</a>
<a href="#" id="editBtn" data-url="{% url 'employee_line_update' pk=0 %}" class="btn btn-primary" disabled>Edit Preinfo</a>
<button id="deleteButton" class="btn btn-danger">Delete Preinfo</button>
{% endblock buttons %}
@@ -25,5 +27,5 @@
{% endblock %}
{% block modal_header %}
<h2>edit line</h2>
<h2>edit line</h2>
{% endblock modal_header %}
+1 -1
View File
@@ -1,4 +1,4 @@
{% extends 'client-base.html' %}
{% extends 'employee-base.html' %}
{% load static %}
{% block content %}
+33 -9
View File
@@ -1,10 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
{% extends "employee-base.html" %}
</body>
</html>
{% block content %}
{% csrf_token %}
{{ form.as_p }}
<div class="selected-containers">
<h3>Selected Containers</h3>
<table class="table">
<thead>
<tr>
<th>Container Number</th>
<th>Type</th>
<th>Company</th>
<th>Received Date</th>
<th>Expedited Date</th>
</tr>
</thead>
<tbody>
{% for container in containers %}
<tr>
<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>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
+78 -10
View File
@@ -1,10 +1,78 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$Title$</title>
</head>
<body>
$END$
</body>
</html>
{% extends 'list-crud.html' %}
{% load static %}
{% block filter %}
<div class="filter-form">
<form method="GET">
<span style="display: flex; align-items: center; width: 100%;">
<label for="date" style="margin-right: 8px;">Date:</label>
<input type="date" id="date" name="date" value="{{ request.GET.date }}" style="margin-right: 20px;">
<label for="company" style="margin-right: 8px;">Company:</label>
<select id="company" name="company" style="margin-right: 20px;">
<option value="">Select company</option>
{% for company in companies %}
<option value="{{ company.id }}" {% if request.GET.company|add:'0' == company.id %}selected{% endif %}>
{{ company.name }}
</option>
{% endfor %}
</select>
<button type="submit">Search</button>
</span>
</form>
</div>
{% endblock %}
{% block selection %}
"multiple"
{% endblock selection %}
{% block table_header %}
<th>Container Number</th>
<th>Type</th>
<th>Company</th>
<th>Expedited Date</th>
{% endblock table_header %}
{% block table_data %}
<td class="td-left">{{ object.number }}</td>
<td>{{ object.container_type }}</td>
<td class="td-left">{{ object.line.company.short_name }}</td>
<td>{{ object.expedited_on|date:"Y-m-d h:m:s" }}</td>
{% endblock table_data %}
{% block buttons %}
<button id="createPaymentBtn" class="btn btn-primary" data-requires-selection disabled>Create Payment</button>
{% endblock buttons %}
{% block create_modal_header %}
<h2>Create Container</h2>
{% endblock %}
{% block modal_header %}
<h2>Edit Container</h2>
{% endblock modal_header %}
{% block custom_js %}
<script>
document.getElementById('createPaymentBtn').addEventListener('click', function() {
const selectedIds = Array.from(document.querySelectorAll('.selected-row'))
.map(row => row.dataset.id);
const dateInput = document.getElementById('date').value;
const companySelect = document.getElementById('company').value;
if (selectedIds.length > 0) {
const params = new URLSearchParams({
containers: selectedIds.join(','),
date: dateInput,
company: companySelect
});
window.location.href = '{% url "payments_create" %}?' + params.toString();
}
});
</script>
{% endblock custom_js %}
+1 -1
View File
@@ -21,5 +21,5 @@
{% endblock %}
{% block modal_header %}
<h2>Edit Preinfo</h2>
<h2>Edit Preinfo</h2>
{% endblock modal_header %}