Merge pull request 'SMALL FIX' (#216) from frontend into main

Reviewed-on: #216
This commit is contained in:
ismail 2025-09-01 14:31:51 +03:00
commit e1364d4f5a
7 changed files with 16 additions and 14 deletions

View File

@ -169,8 +169,7 @@ class DealerSlugMiddleware:
"/ar/help_center/",
"/en/help_center/",
]
print("------------------------------------")
print(request.path in paths)
if request.path in paths:
return None

View File

@ -690,6 +690,7 @@ def sales_dashboard(request,dealer_slug):
created__date__gte=start_date,
created__date__lte=end_date
)
total_leads=leads_filtered.count()
# ----------------------------------------------------
@ -747,6 +748,7 @@ def sales_dashboard(request,dealer_slug):
'total_new_cars_in_inventory': total_new_cars_in_inventory,
'total_used_cars_in_inventory': total_used_cars_in_inventory,
'aging_inventory_count': aging_inventory_count,
'total_leads':total_leads
}
return render(request, 'dashboards/sales_dashboard.html', context)

View File

@ -77,7 +77,7 @@
<div class="col-md-6">
<div class="card h-100 shadow-sm border-0">
<div class="card-header bg-white border-bottom-0">
<h5 class="fw-bold mb-0 text-dark">{% trans "Top Lead Sources" %}</h5>
<h5 class="fw-bold mb-0 text-dark">{% trans "Top Lead Sources" %}&nbsp;&nbsp;&nbsp;&nbsp;{% trans "Total Leads: " %}{{total_leads}}</h5>
</div>
<div class="card-body d-flex align-items-center justify-content-center"
style="height: 400px">

View File

@ -11,7 +11,7 @@
hx-swap="outerHTML"
hx-select-oob="#toast-container"
hx-indicator="#spinner">
<li class="nav-item">
{% comment %} <p class="navbar-vertical-label text-primary fs-8 text-truncate">{{request.dealer|default:"Apps"}}</p>
<hr class="navbar-vertical-line"> {% endcomment %}
@ -223,7 +223,7 @@
<li class="nav-item">
<a class="nav-link" href="{% url 'sales_list' request.dealer.slug %}">
<div class="d-flex align-items-center">
<span class="nav-link-icon"><span class="fas fa-money-check"></span></span><span class="nav-link-text">{% trans "Sale Order"|capfirst %}</span>
<span class="nav-link-icon"><span class="fas fa-money-check"></span></span><span class="nav-link-text">{% trans "Sale Orders"|capfirst %}</span>
</div>
</a>
</li>
@ -440,7 +440,7 @@
</div>
</a>
</li>
</ul>
</div> {% endcomment %}
{% endif %}
@ -450,11 +450,10 @@
<a class="nav-link ps-2" href="{% if request.is_dealer%}{% url 'ticket_list' request.dealer.slug %} {% else %}#{%endif%}">
<div class="d-flex align-items-center">
{% if user.is_authenticated%}
<span class="nav-link-icon"><span class="fa-solid fa-gear me-1 fs-7"></span></span>
<span class="nav-link-text">{{ request.dealer.user.username }}</span>
{% endif %}
</div>
</a>
@ -587,7 +586,7 @@
{% if request.is_dealer %}
<h6 class="mt-2 text-body-emphasis">{{ user.dealer.get_local_name }}</h6>
{% else %}
<h6 class="mt-2 text-body-emphasis">{{ user.staffmember.staff.get_local_name }}</h6>
<h6 class="mt-2 text-body-emphasis">{{ user.staff.get_local_name }}</h6>
{% endif %}
</div>
</div>

View File

@ -269,6 +269,7 @@
</tr>
<tr>
{% if perms.inventory.add_car%}
<td colspan="2">
{% if not car.get_transfer %}
<a href="{% url 'car_finance_update' request.dealer.slug car.slug %}"
@ -277,11 +278,14 @@
<span class="badge bg-danger">{% trans "Cannot Edit, Car in Transfer." %}</span>
{% endif %}
</td>
{% endif %}
</tr>
{% else %}
{% if perms.inventory.add_car%}
<p>{% trans "No finance details available." %}</p>
<a href="{% url 'car_finance_update' request.dealer.slug car.slug %}"
class="btn btn-phoenix-success btn-sm mb-3">{% trans "Add" %}</a>
{% endif %}
{% endif %}
</table>
</div>

View File

@ -98,7 +98,6 @@
<th scope="col">{% trans 'Status' %}</th>
<th scope="col">{% trans 'PO Amount' %}</th>
<th scope="col">{% trans 'Date Fulfilled' %}</th>
<th scope="col">{% trans 'Created By' %}</th>
<th scope="col">{% trans 'Cars Purchased' %}</th>
<th scope="col">{% trans 'Vendor' %}</th>
</tr>
@ -117,7 +116,6 @@
{% trans 'Not fulfilled' %}
{% endif %}
</td>
<td>{% firstof po.created_by.get_full_name 'staff' %}</td>
<td>{{ po.po_quantity }}</td>
<td>{{ po.vendors_str }}</td>
</tr>

View File

@ -122,9 +122,9 @@
<div class="row d-flex justify-content-center align-items-center mt-5 mb-3 ms-6 ps-3">
<div class="row">
<div class="col">
{% if not items %}
{% if not items.car %}
{% url "car_add" request.dealer.slug as create_car_url %}
{% include "message-illustration.html" with value1="Please add at least one car before creating a quotation." value2="Add car" message_image="images/logos/no-content-new.jpg" url=create_car_url %}
{% include "message-illustration.html" with value1="Please add at least one car or complete the car info before creating a quotation." value2="Add car" message_image="images/logos/no-content-new.jpg" url=create_car_url %}
{% endif %}
</div>
<div class="col">