images default

This commit is contained in:
Faheedkhan 2025-07-29 13:29:56 +03:00
parent 5a24f572f6
commit 1955de632b
44 changed files with 139 additions and 78 deletions

View File

@ -1184,7 +1184,7 @@ class Dealer(models.Model, LocalizedNameMixin):
blank=True,
null=True,
verbose_name=_("Logo"),
default="user-logo.png",
default="default-image/dealer.png",
)
thumbnail = ImageSpecField(
source="logo",
@ -1288,7 +1288,7 @@ class Staff(models.Model, LocalizedNameMixin):
max_length=200, blank=True, null=True, verbose_name=_("Address")
)
logo = models.ImageField(
upload_to="logos/staff", blank=True, null=True, verbose_name=_("Image"),default="user-logo.jpg"
upload_to="logos/staff", blank=True, null=True, verbose_name=_("Image"),default="default-image/sales_person.png"
)
thumbnail = ImageSpecField(
source="logo",
@ -1511,7 +1511,7 @@ class Customer(models.Model):
)
active = models.BooleanField(default=True, verbose_name=_("Active"))
image = models.ImageField(
upload_to="customers/", blank=True, null=True, verbose_name=_("Image")
upload_to="customers/", blank=True, null=True, verbose_name=_("Image"),default="default-image/customer.png"
)
thumbnail = ImageSpecField(
source="image",
@ -2481,7 +2481,7 @@ class Vendor(models.Model, LocalizedNameMixin):
email = models.EmailField(max_length=255, verbose_name=_("Email Address"))
address = models.CharField(max_length=200, verbose_name=_("Address"))
logo = models.ImageField(
upload_to="logos/vendors", blank=True, null=True, verbose_name=_("Logo"),default="user-logo.jpg"
upload_to="logos/vendors", blank=True, null=True, verbose_name=_("Logo"),default="default-image/vendor.png"
)
thumbnail = ImageSpecField(
source="logo",

View File

@ -655,7 +655,7 @@ class CarCreateView(LoginRequiredMixin, PermissionRequiredMixin,SuccessMessageMi
def get_context_data(self, **kwargs):
dealer = get_user_type(self.request)
context = super().get_context_data(**kwargs)
context["vendor_exists"] = dealer.vendors.exists()
context["vendor_exists"] = dealer.vendors.filter(active=True).exists()
return context
@ -1625,7 +1625,7 @@ class CarUpdateView(
def get_form(self, form_class=None):
form = super().get_form(form_class)
dealer = get_user_type(self.request)
form.fields["vendor"].queryset = dealer.vendors.all()
form.fields["vendor"].queryset = dealer.vendors.filter(active=True)
return form
@ -10552,7 +10552,7 @@ def upload_cars(request, dealer_slug, pk=None):
return response
form = forms.CSVUploadForm()
form.fields["vendor"].queryset = dealer.vendors.all()
form.fields["vendor"].queryset = dealer.vendors.filter(active=True).all()
return render(
request,

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 KiB

BIN
static/images/logos/vendors/output_2.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

BIN
static/images/logos/vendors/output_4.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

BIN
static/images/logos/vendors/vnd.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -39,7 +39,15 @@
<div class="empty-state-container">
<!-- Empty State Illustration -->
<img src="{% static 'images/logos/no-content-new.jpg' %}" alt="No-empty-state-image" class="empty-state-image">
{% if image %}
{% static image as final_image_path %}
{% else %}
{% static 'images/no_content/no_item.jpg' as final_image_path %}
{% endif %}
<img src="{{ final_image_path }}" alt="No-empty-state-image" class="empty-state-image">
<!-- Title -->
<h3 class="empty-state-title">

View File

@ -19,22 +19,11 @@
<script src="{% static 'vendors/zxing/index.min.js' %}"></script>
<script src="{% static 'vendors/tesseract/tesseract.min.js' %}"></script>
{% if not vendor_exists %}
<div class="alert alert-outline-warning d-flex align-items-center"
role="alert">
<i class="fa-solid fa-circle-info fs-6"></i>
<p class="mb-0 flex-1">
{{ _("Please Add A Vendor, Before Adding A Car .") }} <a href="{% url 'vendor_create' request.dealer.slug %}"
class="ms-3 text-body-primary fs-9">{{ _("Add Vendor") }}</a>
</p>
<button class="btn-close"
type="button"
data-bs-dismiss="alert"
aria-label="Close"></button>
</div>
{% url "vendor_create" request.dealer.slug as create_vendor_url %}
{% include "message-illustration.html" with value1="Please Add A Vendor, Before Adding A Car." value2="Create Vendor" message_image="images/empty/vendor2.png" url=create_vendor_url %}
{% endif %}
<!---->
<div class="row justify-content-center mt-5 mb-3
{% if not vendor_exists %}disabled{% endif %}" hx-boost="false">
<div class="row justify-content-center mt-5 mb-3 {% if not vendor_exists %}d-none{% endif %}" hx-boost="false">
<div class="col-lg-8 col-md-10">
<div class="card shadow-sm border-0 rounded-3">
<div class="card-header bg-gray-200 py-3 border-0 rounded-top-3">

View File

@ -0,0 +1,89 @@
{% load static %}
{% load i18n %}
<style>
{% comment %} .empty-state-container {
background-color: #ffffff;
padding: 50px;
border-radius: 5px; /* Rounded corners */
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); /* Subtle shadow */
text-align: center;
max-width: 70rem; /* Max width for content - made wider */
width: 90%; /* Fluid width */
margin: 0px auto; /* Added margin-top and auto for horizontal centering */
max-height: 40vh; /* Added min-height to control the height */
display: flex; /* Use flexbox for vertical centering of content */
flex-direction: column; /* Stack children vertically */
justify-content: center; /* Center content vertically */
align-items: center; /* Center content horizontally */
}
.empty-state-image {
max-width: 90%; /* Responsive image size */
height: 90%;
border-radius: 10px; /* Rounded corners for image */
}
.empty-state-title {
color: #343a40; /* Dark text for title */
font-weight: 600;
margin-bottom: 15px;
}
.empty-state-text {
color: #6c757d; /* Muted text for description */
margin-bottom: 30px;
line-height: 1.6;
}
/* No specific styles for .btn-add-new or .message-box are needed here as per previous updates */ {% endcomment %}
.empty-state-container {
background-color: #ffffff;
padding: 50px;
border-radius: 5px; /* Rounded corners */
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); /* Subtle shadow */
text-align: center;
max-width: 70rem; /* Max width for content - made wider */
width: 90%; /* Fluid width */
margin: 0px auto; /* Added margin-top and auto for horizontal centering */
max-height: 80vh; /* Added min-height to control the height */
display: flex; /* Use flexbox for vertical centering of content */
flex-direction: column; /* Stack children vertically */
justify-content: center; /* Center content vertically */
align-items: center; /* Center content horizontally */
}
.empty-state-image {
max-width: 50%; /* Responsive image size */
height: auto%;
border-radius: 10px; /* Rounded corners for image */
}
.empty-state-title {
color: #343a40; /* Dark text for title */
font-weight: 600;
margin-bottom: 15px;
}
.empty-state-text {
color: #6c757d; /* Muted text for description */
margin-bottom: 30px;
line-height: 1.6;
}
/* No specific styles for .btn-add-new or .message-box are needed here as per previous updates */
</style>
<div class="empty-state-container alert mb-2" role="alert">
<img src="{% static message_image %}" alt="message-image" class="empty-state-image mb-2">
<!-- Title -->
<h3 class="empty-state-title mb-2">
{% blocktrans %}{{ value1}}{% endblocktrans %}
</h3>
<div class="d-flex justify-content-between mt-4">
<a class="btn btn-primary mx-2" href="{{ url }}">
<i class="fa fa-plus me-2"></i>
{% blocktrans %}{{value2}}{% endblocktrans %}
</a>
</div>
</div>

View File

@ -122,35 +122,23 @@
}
</style>
<div class="row justify-content-center mt-5 mb-3">
<div class="row">
<div class="col">
{% if not items %}
<div class="alert alert-outline-warning d-flex align-items-center"
role="alert">
<i class="fa-solid fa-circle-info fs-6"></i>
<p class="mb-0 flex-1">
{{ _("Please add at least one car before creating a quotation.") }}<a class="ms-3 text-body-primary fs-9"
href="{% url 'car_add' request.dealer.slug %}">{{ _("Add Car") }}</a>
</p>
<button class="btn-close"
type="button"
data-bs-dismiss="alert"
aria-label="Close"></button>
</div>
{% 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/empty/no_car.png" url=create_car_url %}
{% endif %}
</div>
<div class="col">
{% if not customer_count %}
<div class="alert alert-outline-warning d-flex align-items-center"
role="alert">
<i class="fa-solid fa-circle-info fs-6"></i>&nbsp;&nbsp;
<p class="mb-0 flex-1">
{{ _("Please add at least one customer before creating a quotation.") }}<a class="ms-3 text-body-primary fs-9"
href="{% url 'customer_create' request.dealer.slug %}">{{ _("Add Customer") }}</a>
</p>
<button class="btn-close"
type="button"
data-bs-dismiss="alert"
aria-label="Close"></button>
</div>
{% url "customer_create" request.dealer.slug as create_customer_url %}
{% include "message-illustration.html" with value1="Please add at least one customer before creating a quotation." value2="Add Customer" message_image="images/empty/no_estimate.png" url=create_customer_url %}
{% endif %}
<div class="col-lg-8 col-md-10">
</div>
<div>
<div class="col-lg-8 col-md-10 needs-validation {% if not items or not customer_count %}d-none{% endif %}">
<div class="card shadow-sm border-0 rounded-3">
<div class="card-header bg-gray-200 py-3 border-0 rounded-top-3">
<h3 class="mb-0 fs-4 text-center">
@ -160,7 +148,7 @@
<div class="card-body bg-light-subtle">
<form id="mainForm" method="post" class="needs-validation {% if not items or not customer_count %}disabled{% endif %}">
<form id="mainForm" method="post" class="needs-validation {% if not items and not customer_count %}d-none{% endif %}">
{% csrf_token %}
<div class="row g-3 col-12">

View File

@ -79,7 +79,7 @@
{% else %}
{% url "estimate_create" request.dealer.slug as create_estimate_url %}
{% include "empty-illustration-page.html" with value="estimate" url=create_estimate_url %}
{% include "empty-illustration-page.html" with value="estimate" url=create_estimate_url image='images/no_content/no_estimate.jpg' %}
{% endif %}
{% endblock %}

View File

@ -19,18 +19,10 @@
<a href="{% url 'group_list' request.dealer.slug %}"
class="btn btn-sm btn-phoenix-success"><i class="fa-solid fa-user-group me-1"></i> {% trans "Manage Groups & Permissions" %}</a>
{% else %}
<div class="alert alert-outline-warning d-flex align-items-center"
role="alert">
<i class="fa-solid fa-circle-info fs-6"></i>
<p class="mb-0 flex-1">
{{ _("No Active Subscription,please activate your subscription.") }}<a hx-boost="false" href="{% url 'pricing_page' request.dealer.slug %}"
class="ms-3 text-body-primary fs-9">Manage Subscription</a>
</p>
<button class="btn-close"
type="button"
data-bs-dismiss="alert"
aria-label="Close"></button>
</div>
{% url "pricing_page" request.dealer.slug as pricing_page_url %}
{% include "message-illustration.html" with value1="No Active Plan, please create your subscription plan." value2="Manage Subscription" message_image="images/messages/haikal_plan_message.jpg" url=pricing_page_url %}
{% endif %}
</div>
</div>
@ -91,24 +83,13 @@
</section>
{% else %}
{% if request.user.userplan %}
{% url "user_create" request.dealer.slug as create_staff_url %}
{% url "user_create" request.dealer.slug as create_staff_url image="images/no_content/no_user.png" %}
{% include "empty-illustration-page.html" with value="staff" url=create_staff_url %}
{% else %}
<div class="alert alert-outline-warning d-flex align-items-center"
role="alert">
<i class="fa-solid fa-circle-info fs-6"></i>
<p class="mb-0 flex-1">
{{ _("No Active Subscription,please activate your subscription.") }}<a href="{% url 'pricing_page' request.dealer.slug %}"
class="ms-3 text-body-primary fs-9">Manage Subscription</a>
</p>
<button class="btn-close"
type="button"
data-bs-dismiss="alert"
aria-label="Close"></button>
</div>
{% url "pricing_page" request.dealer.slug as pricing_page_url %}
{% include "message-illustration.html" with value1="No Active Plan, please create your subscription plan." value2="Buy Plan" message_image="images/no_content/no_plan.jpg" url=pricing_page_url %}
{% endif %}
{% endif %}

View File

@ -166,6 +166,6 @@
{% else %}
{% url "vendor_create" request.dealer.slug as create_vendor_url %}
{% include "empty-illustration-page.html" with value="vendor" url=create_vendor_url %}
{% include "empty-illustration-page.html" with value="vendor" url=create_vendor_url image="images/no_content/no_vendor.png" %}
{% endif %}
{% endblock %}

View File

@ -9,6 +9,11 @@
<div class="card shadow rounded">
<p class="card-header mb-0 fs-5">{% trans "Vendor Details" %}</p>
<div class="card-body">
<div class="col-12 col-sm-auto mb-sm-2">
<div class="avatar avatar-5xl">
{% if vendor.logo%}<img class="rounded-circle" src="{{ vendor.logo.url }}" alt="" />{% endif %}
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<strong>{% trans "Name" %}:</strong> {{ vendor.get_local_name }}
@ -50,3 +55,4 @@
</div>
{% include 'modal/delete_modal.html' %}
{% endblock %}