fixed client dashboard

fixed employee sidebar nomenclatures buttons
This commit is contained in:
2025-08-03 17:25:23 +03:00
parent 9167092f27
commit f501be9794
13 changed files with 154 additions and 236 deletions
+45 -187
View File
@@ -1,166 +1,8 @@
{% extends 'common/base.html' %}
{% block content %}
{% load filters %}
{% load permission_tags %}
{# <div id="dashboardContent" class="tab-content active">#}
{# <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">#}
{# <div class="card bg-white rounded-lg shadow p-6">#}
{# <div class="flex items-center">#}
{# <div class="p-3 rounded-full bg-blue-100 text-blue-600">#}
{# <svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor">#}
{# <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />#}
{# </svg>#}
{# </div>#}
{# <div class="ml-4">#}
{# <h3 class="text-lg font-semibold text-gray-700">Active Containers</h3>#}
{# <p class="text-3xl font-bold text-gray-900">42</p>#}
{# <p class="text-sm text-green-600">+3 since last week</p>#}
{# </div>#}
{# </div>#}
{# </div>#}
{##}
{# <div class="card bg-white rounded-lg shadow p-6">#}
{# <div class="flex items-center">#}
{# <div class="p-3 rounded-full bg-green-100 text-green-600">#}
{# <svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor">#}
{# <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" />#}
{# </svg>#}
{# </div>#}
{# <div class="ml-4">#}
{# <h3 class="text-lg font-semibold text-gray-700">Preinfo Sent</h3>#}
{# <p class="text-3xl font-bold text-gray-900">18</p>#}
{# <p class="text-sm text-green-600">+5 since last week</p>#}
{# </div>#}
{# </div>#}
{# </div>#}
{##}
{# <div class="card bg-white rounded-lg shadow p-6">#}
{# <div class="flex items-center">#}
{# <div class="p-3 rounded-full bg-orange-100 text-orange-600">#}
{# <svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor">#}
{# <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4" />#}
{# </svg>#}
{# </div>#}
{# <div class="ml-4">#}
{# <h3 class="text-lg font-semibold text-gray-700">Bookings</h3>#}
{# <p class="text-3xl font-bold text-gray-900">7</p>#}
{# <p class="text-sm text-orange-600">2 require attention</p>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{##}
{# <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">#}
{# <div class="bg-white rounded-lg shadow">#}
{# <div class="px-6 py-4 border-b border-gray-200">#}
{# <h3 class="text-lg font-semibold text-gray-800">Recent Container Activity</h3>#}
{# </div>#}
{# <div class="p-6">#}
{# <div class="overflow-x-auto">#}
{# <table class="min-w-full divide-y divide-gray-200">#}
{# <thead>#}
{# <tr>#}
{# <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Container</th>#}
{# <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>#}
{# <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>#}
{# <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>#}
{# </tr>#}
{# </thead>#}
{# <tbody class="divide-y divide-gray-200">#}
{# <tr>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900">MSCU1234567</td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">40HC</td>#}
{# <td class="px-4 py-3 whitespace-nowrap">#}
{# <span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Received</span>#}
{# </td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">2023-06-15</td>#}
{# </tr>#}
{# <tr>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900">MSCU7654321</td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">20DV</td>#}
{# <td class="px-4 py-3 whitespace-nowrap">#}
{# <span class="px-2 py-1 text-xs font-semibold rounded-full bg-blue-100 text-blue-800">Preinfo</span>#}
{# </td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">2023-06-14</td>#}
{# </tr>#}
{# <tr>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900">MSCU2468135</td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">40DV</td>#}
{# <td class="px-4 py-3 whitespace-nowrap">#}
{# <span class="px-2 py-1 text-xs font-semibold rounded-full bg-orange-100 text-orange-800">Order</span>#}
{# </td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">2023-06-13</td>#}
{# </tr>#}
{# <tr>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900">MSCU1357924</td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">20RF</td>#}
{# <td class="px-4 py-3 whitespace-nowrap">#}
{# <span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">Expedited</span>#}
{# </td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">2023-06-12</td>#}
{# </tr>#}
{# </tbody>#}
{# </table>#}
{# </div>#}
{# </div>#}
{# </div>#}
{##}
{# <div class="bg-white rounded-lg shadow">#}
{# <div class="px-6 py-4 border-b border-gray-200">#}
{# <h3 class="text-lg font-semibold text-gray-800">Payment Status</h3>#}
{# </div>#}
{# <div class="p-6">#}
{# <div class="overflow-x-auto">#}
{# <table class="min-w-full divide-y divide-gray-200">#}
{# <thead>#}
{# <tr>#}
{# <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Invoice</th>#}
{# <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>#}
{# <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>#}
{# <th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Due Date</th>#}
{# </tr>#}
{# </thead>#}
{# <tbody class="divide-y divide-gray-200">#}
{# <tr>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900">INV-2023-0042</td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">$1,250.00</td>#}
{# <td class="px-4 py-3 whitespace-nowrap">#}
{# <span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Paid</span>#}
{# </td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">2023-06-10</td>#}
{# </tr>#}
{# <tr>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900">INV-2023-0041</td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">$875.50</td>#}
{# <td class="px-4 py-3 whitespace-nowrap">#}
{# <span class="px-2 py-1 text-xs font-semibold rounded-full bg-yellow-100 text-yellow-800">Pending</span>#}
{# </td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">2023-06-20</td>#}
{# </tr>#}
{# <tr>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900">INV-2023-0040</td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">$2,100.00</td>#}
{# <td class="px-4 py-3 whitespace-nowrap">#}
{# <span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">Overdue</span>#}
{# </td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">2023-06-05</td>#}
{# </tr>#}
{# <tr>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm font-medium text-gray-900">INV-2023-0039</td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">$950.25</td>#}
{# <td class="px-4 py-3 whitespace-nowrap">#}
{# <span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">Paid</span>#}
{# </td>#}
{# <td class="px-4 py-3 whitespace-nowrap text-sm text-gray-700">2023-05-28</td>#}
{# </tr>#}
{# </tbody>#}
{# </table>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{# </div>#}
{% block content %}
<div class="dashboard-wrapper">
<div class="stats-grid">
<div class="dashboard-card">
@@ -172,8 +14,8 @@
</div>
<div class="stat-info">
<h3>Active Containers</h3>
<p class="stat-number">42</p>
<p class="stat-change">+3 since last week</p>
<p class="stat-number">{{ containers }}</p>
<p class="stat-change">+{{ containers_week }} since last week</p>
</div>
</div>
</div>
@@ -186,8 +28,8 @@
</div>
<div class="stat-info">
<h3>Preinfo sent</h3>
<p class="stat-number">17</p>
<p class="stat-change">+7 since last week</p>
<p class="stat-number">{{ preinfos }}</p>
<p class="stat-change">+{{ preinfos_week }} since last week</p>
</div>
</div>
</div>
@@ -200,13 +42,12 @@
</div>
<div class="stat-info">
<h3>Bookings active</h3>
<p class="stat-number">4</p>
<p class="stat-change">+8 since last week</p>
<p class="stat-number">{{ bookings }}</p>
<p class="stat-change">+{{ bookings_week }} since last week</p>
</div>
</div>
</div>
<!-- Other two cards similar structure -->
</div>
<div class="tables-grid">
@@ -225,17 +66,28 @@
</tr>
</thead>
<tbody>
<tr>
<td>MSCU1234567</td>
<td>40HC</td>
<td><span class="status-tag status-received">Received</span></td>
<td>2023-06-15</td>
</tr>
<!-- Other rows similar structure -->
{% for container in recent_containers %}
<tr>
<td>{{ container.number }}</td>
<td>{{ container.container_type.name }}</td>
{% if container.expedited %}
<td><span class="status-tag status-expedited">Expedited</span></td>
<td>{{ container.expedited_on|bg_date }}</td>
{% else %}
<td><span class="status-tag status-received">Received</span></td>
<td>{{ container.received_on|bg_date }}</td>
{% endif %}
</tr>
{% empty %}
<tr>
<td> No recent history</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% if request.user|has_company_perm:"can_view_payment" %}
<div class="dashboard-card">
<div class="card-header">
@@ -245,25 +97,31 @@
<table class="table">
<thead>
<tr>
<th>Container</th>
<th>Type</th>
<th>Status</th>
<th>Date</th>
<th>Invoice №</th>
<th>Company</th>
<th>Amount</th>
<th>Paid</th>
</tr>
</thead>
<tbody>
<tr>
<td>MSCU1234567</td>
<td>40HC</td>
<td><span class="status-tag status-received">Received</span></td>
<td>2023-06-15</td>
</tr>
<!-- Other rows similar structure -->
{% for payment in recent_payments %}
<tr>
<td>{{ payment.invoice_number }}</td>
<td>{{ payment.company.name }}</td>
<td>{{ payment.total_amount }}</td>
<td><span class="status-tag status-received">{{ payment.paid }}</span></td>
</tr>
{% empty %}
<tr>
<td> No recent history</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}
+13 -9
View File
@@ -139,11 +139,11 @@
</div>
<div class="detail-row">
<div class="detail-label">Preinfo:</div>
<div class="detail-value">{{ container.preinfo }}</div>
<div class="detail-value">{{ container.preinfo.id }}</div>
</div>
<div class="detail-row">
<div class="detail-label">Received On:</div>
<div class="detail-value">{{ container.received_on|date:"Y-m-d H:i" }}</div>
<div class="detail-value">{{ container.received_on|bg_date }}</div>
</div>
<div class="detail-row">
<div class="detail-label">Receive Vehicle:</div>
@@ -163,7 +163,7 @@
<div class="detail-label">Booking:</div>
<div class="detail-value">
{% if container.booking %}
{{ container.booking.name }}
{{ container.booking.id }}
{% else %}
-
{% endif %}
@@ -204,15 +204,19 @@
{% block table_header %}
<th style="display: none;">Select</th>
<th>Company name</th>
<th>Company short name</th>
<th>Description</th>
<th>Company</th>
<th>Receive date</th>
<th>Swept</th>
<th>Washed</th>
<th>Expedited date</th>
{% endblock table_header %}
{% block table_data %}
<td>{{ object.number }}</td>
<td>{{ object.number }}</td>
<td>{{ object.number }}</td>
<td>{{ object.line.company.short_name }}</td>
<td>{{ object.received_on|bg_date }}</td>
<td>{{ object.swept|yesno:"Yes,-" }}</td>
<td>{{ object.washed|yesno:"Yes,-" }}</td>
<td>{{ object.expedited_on|bg_date }}</td>
{% endblock %}
{% block buttons %}
-7
View File
@@ -30,12 +30,5 @@
{% 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 %}
+5 -6
View File
@@ -1,7 +1,7 @@
{% extends 'common/base.html' %}
{% block content %}
{% load filters %}
{% load permission_tags %}
{% load permission_tags %}
{% block content %}
<div class="dashboard-wrapper">
<div class="stats-grid">
<div class="dashboard-card">
@@ -14,7 +14,7 @@
<div class="stat-info">
<h3>Active Containers</h3>
<p class="stat-number">{{ containers }}</p>
<p class="stat-change">+3 since last week</p>
<p class="stat-change">+{{ containers_week }} since last week</p>
</div>
</div>
</div>
@@ -28,7 +28,7 @@
<div class="stat-info">
<h3>Active preinfos</h3>
<p class="stat-number">{{ preinfos }}</p>
<p class="stat-change">+7 since last week</p>
<p class="stat-change">+{{ preinfos_week }} since last week</p>
</div>
</div>
</div>
@@ -42,7 +42,7 @@
<div class="stat-info">
<h3>Active bookings</h3>
<p class="stat-number">{{ bookings }}</p>
<p class="stat-change">+8 since last week</p>
<p class="stat-change">+{{ bookings_week }} since last week</p>
</div>
</div>
</div>
@@ -83,7 +83,6 @@
<td> No recent history</td>
</tr>
{% endfor %}
<!-- Other rows similar structure -->
</tbody>
</table>
</div>
+9 -6
View File
@@ -76,7 +76,7 @@
</a>
{% endif %}
{% if request.user.UserType == 'CA' or 1 == 1 %}
{% if request.user.is_superuser %}
<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">
@@ -109,11 +109,14 @@
<div class="user-info">
<p class="username">{{ request.user }}</p>
</div>
<a href="{% url 'login' %}" class="logout">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
</svg>
</a>
<form action="{% url 'relogin' %}" method="post" style="display:inline;">
{% csrf_token %}
<button type="submit" class="logout" style="background:none; border:none; padding:0;">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
</svg>
</button>
</form>
</div>
</aside>