-
-
-
-
{{ _("Inventory by Status") }}
-
-
-
-
- {{ _("Available") }}
-
-
{{ available_cars }}
-
-
-
-
-
- {{ _("Sold") }}
-
-
{{ sold_cars }}
-
-
-
-
-
- {{ _("Reserved") }}
-
-
{{ reserved_cars }}
-
-
-
-
-
- {{ _("Transfer") }}
-
-
{{ transfer_cars }}
-
-
-
-
-
- {{ _("Hold") }}
-
-
{{ hold_cars }}
-
-
-
-
-
- {{ _("Damaged") }}
-
-
{{ damaged_cars }}
-
-
-
-
-
-
+
+
-
+{% endblock content %}
+
+
+{% block customJS%}
+
+
-{% endblock %}
+// Chart.js configuration for the Pie Chart
+new Chart(ctx3, {
+ type: 'pie',
+ data: {
+ labels: ['Toyota', 'Ford', 'Honda', 'BMW', 'Other'],
+ datasets: [{
+ label: 'Car Count by Make',
+ data: [45, 30, 25, 15, 10], // Sample data for car counts
+ backgroundColor: [
+ '#007bff', // Blue
+ '#28a745', // Green
+ '#ffc107', // Yellow
+ '#dc3545', // Red
+ '#6c757d' // Gray
+ ],
+ hoverOffset: 15,
+ }]
+ },
+ options: {
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ position: 'right', // Places the legend on the right side
+ labels: {
+ color: '#343a40', // Dark text color for labels
+ font: {
+ size: 14
+ }
+ }
+ },
+ tooltip: {
+ backgroundColor: 'rgba(52, 58, 64, 0.9)',
+ titleColor: '#fff',
+ bodyColor: '#fff',
+ callbacks: {
+ label: function(context) {
+ const label = context.label || '';
+ const value = context.parsed || 0;
+ const total = context.dataset.data.reduce((a, b) => a + b, 0);
+ const percentage = ((value / total) * 100).toFixed(2);
+ return `${label}: ${value} cars (${percentage}%)`;
+ }
+ }
+ }
+ }
+ }
+});
+
+
+// Get the canvas context for the chart
+const ctx4 = document.getElementById('inventoryByBrandChart').getContext('2d');
+
+// Chart.js configuration for the Pie Chart
+new Chart(ctx4, {
+ type: 'pie',
+ data: {
+ labels: ['Toyota', 'Ford', 'Honda', 'BMW', 'Other'],
+ datasets: [{
+ label: 'Car Count by Make',
+ data: [45, 30, 25, 15, 10], // Sample data for car counts
+ backgroundColor: [
+ '#007bff', // Blue
+ '#28a745', // Green
+ '#ffc107', // Yellow
+ '#dc3545', // Red
+ '#6c757d' // Gray
+ ],
+ hoverOffset: 15,
+ }]
+ },
+ options: {
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ position: 'right', // Places the legend on the right side
+ labels: {
+ color: '#343a40', // Dark text color for labels
+ font: {
+ size: 14
+ }
+ }
+ },
+ tooltip: {
+ backgroundColor: 'rgba(52, 58, 64, 0.9)',
+ titleColor: '#fff',
+ bodyColor: '#fff',
+ callbacks: {
+ label: function(context) {
+ const label = context.label || '';
+ const value = context.parsed || 0;
+ const total = context.dataset.data.reduce((a, b) => a + b, 0);
+ const percentage = ((value / total) * 100).toFixed(2);
+ return `${label}: ${value} cars (${percentage}%)`;
+ }
+ }
+ }
+ }
+ }
+});
+
+
+// Get the canvas context for the chart
+const ctx_salesperson = document.getElementById('salespersonChart').getContext('2d');
+
+// Chart.js configuration for the Salesperson Performance Bar Chart
+new Chart(ctx_salesperson, {
+ type: 'bar',
+ data: {
+ labels: ['John Doe', 'Jane Smith', 'Peter Jones', 'Mary Brown'],
+ datasets: [{
+ label: 'Cars Sold',
+ data: [15, 22, 18, 25], // Sample data for cars sold by each salesperson
+ backgroundColor: [
+ '#007bff', // Blue
+ '#28a745', // Green
+ '#ffc107', // Yellow
+ '#dc3545' // Red
+ ],
+ borderWidth: 1
+ }]
+ },
+ options: {
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ display: false // Hide the legend for a single dataset
+ },
+ title: {
+ display: true,
+ text: 'Salesperson Performance',
+ font: {
+ size: 16
+ }
+ }
+ },
+ scales: {
+ x: {
+ title: {
+ display: true,
+ text: 'Salesperson Name'
+ },
+ ticks: {
+ color: '#495057' // Dark text for x-axis labels
+ }
+ },
+ y: {
+ beginAtZero: true,
+ title: {
+ display: true,
+ text: 'Number of Cars Sold'
+ },
+ ticks: {
+ color: '#495057' // Dark text for y-axis labels
+ }
+ }
+ }
+ }
+});
+
+
+// Get the canvas context for the chart
+const ctx_leadSources = document.getElementById('leadSourcesChart').getContext('2d');
+
+// Chart.js configuration for the Top 5 Lead Sources Bar Chart
+new Chart(ctx_leadSources, {
+ type: 'bar',
+ data: {
+ labels: ['Showroom', 'Referrals', 'WhatsApp', 'Facebook', 'TikTok'], // Labels from the provided list
+ datasets: [{
+ label: 'Number of Leads',
+ data: [45, 35, 25, 20, 15], // Sample data for leads from each source
+ backgroundColor: 'rgba(54, 162, 235, 0.8)', // A consistent blue color for the bars
+ borderColor: 'rgba(54, 162, 235, 1)',
+ borderWidth: 1
+ }]
+ },
+ options: {
+ indexAxis: 'y', // Makes it a horizontal bar chart
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ display: false
+ },
+ title: {
+ display: true,
+ text: 'Top 5 Lead Sources',
+ font: {
+ size: 16
+ }
+ }
+ },
+ scales: {
+ x: {
+ beginAtZero: true,
+ title: {
+ display: true,
+ text: 'Number of Leads',
+ color: '#495057'
+ },
+ ticks: {
+ color: '#495057'
+ }
+ },
+ y: {
+ ticks: {
+ color: '#495057',
+ font: {
+ size: 8 // Decreases the font size to fit more text
+ }
+ }
+ }
+ }
+ }
+});
+// Get the canvas context for the chart
+const ctx_appointments = document.getElementById('appointmentsChart').getContext('2d');
+
+// Chart.js configuration for the Appointments by Weekday Bar Chart
+new Chart(ctx_appointments, {
+ type: 'bar',
+ data: {
+ labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
+ datasets: [{
+ label: 'Number of Appointments',
+ data: [10, 15, 20, 18, 25, 30, 12], // Sample data for appointments per day
+ backgroundColor: 'rgba(75, 192, 192, 0.8)', // A consistent color for the bars
+ borderColor: 'rgba(75, 192, 192, 1)',
+ borderWidth: 1
+ }]
+ },
+ options: {
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ display: false
+ },
+ title: {
+ display: true,
+ text: 'Appointments by Weekday',
+ font: {
+ size: 16
+ }
+ }
+ },
+ scales: {
+ x: {
+ title: {
+ display: true,
+ text: 'Day of the Week',
+ color: '#495057'
+ },
+ ticks: {
+ color: '#495057'
+ }
+ },
+ y: {
+ beginAtZero: true,
+ title: {
+ display: true,
+ text: 'Number of Appointments',
+ color: '#495057'
+ },
+ ticks: {
+ color: '#495057'
+ }
+ }
+ }
+ }
+});
+
+
+// Get the canvas context for the funnel chart
+const ctx_funnel = document.getElementById('leadFunnelChart').getContext('2d');
+
+// Sample data for the funnel stages
+const funnelData = {
+ labels: ['Initial Contact', 'Qualified Leads', 'Test Drives', 'Negotiation', 'Closed Deals'],
+ data: [250, 180, 120, 80, 45], // Example lead counts at each stage
+};
+
+new Chart(ctx_funnel, {
+ type: 'bar',
+ data: {
+ labels: funnelData.labels,
+ datasets: [{
+ label: 'Number of Leads',
+ data: funnelData.data,
+ backgroundColor: [
+ 'rgba(0, 123, 255, 0.8)',
+ 'rgba(0, 123, 255, 0.7)',
+ 'rgba(0, 123, 255, 0.6)',
+ 'rgba(0, 123, 255, 0.5)',
+ 'rgba(0, 123, 255, 0.4)'
+ ],
+ borderColor: 'rgba(0, 123, 255, 1)',
+ borderWidth: 1
+ }]
+ },
+ options: {
+ indexAxis: 'y', // Makes it a horizontal bar chart
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ display: false
+ },
+ title: {
+ display: true,
+ text: 'Lead Conversion Funnel',
+ font: {
+ size: 16
+ }
+ },
+ tooltip: {
+ callbacks: {
+ label: function(context) {
+ const totalLeads = funnelData.data[0];
+ const currentLeads = context.parsed.x;
+ const percentage = ((currentLeads / totalLeads) * 100).toFixed(1);
+ return `Leads: ${currentLeads} (${percentage}%)`;
+ }
+ }
+ }
+ },
+ scales: {
+ x: {
+ beginAtZero: true,
+ display: false // Hide the x-axis to make it look like a funnel
+ },
+ y: {
+ ticks: {
+ color: '#495057'
+ }
+ }
+ }
+ }
+});
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/dealers/assign_car_makes.html b/templates/dealers/assign_car_makes.html
index 74ac619c..84dc2893 100644
--- a/templates/dealers/assign_car_makes.html
+++ b/templates/dealers/assign_car_makes.html
@@ -33,7 +33,7 @@
height: 0;
}
.car-make-option input[type="checkbox"]:checked + .car-make-image-container .car-make-image {
- border: 2px solid #2c7be5;
+ border: 3px solid rgb(44, 229, 44);
box-shadow: 0 0 10px rgba(44, 123, 229, 0.5);
background: #f0f7ff;
}
diff --git a/templates/dealers/dealer_detail.html b/templates/dealers/dealer_detail.html
index 45a078b9..8c30f461 100644
--- a/templates/dealers/dealer_detail.html
+++ b/templates/dealers/dealer_detail.html
@@ -1,239 +1,66 @@
{% extends 'base.html' %}
{% load i18n static custom_filters crispy_forms_filters %}
{% block title %}
- {% trans 'Profile' %} {% endblock %}
- {% block content %}
-
-
-
-
{% trans 'Profile' %}
-
-
-
+ {% trans 'Profile' %}
+{% endblock %}
+
+{% block content %}
+
+
+
+
{% trans 'Profile' %}
+
+
+
+
+ {{ _("Manage Profile") }}
+
+
-
-
-
-
-
-
-
-
-
- {% if dealer.logo %}
-
- {% else %}
-
-
- {% endif %}
-
-
-
-
{{ dealer.get_local_name }}
-
{% trans 'Joined' %} {{ dealer.joined_at|timesince }} {% trans 'ago' %}
-
-
-
-
-
-
-
{% trans 'last login'|capfirst %}
- {{ dealer.user.last_login|date:"D M d, Y H:i" }}
-
-
-
{% trans 'Total users'|capfirst %}
- {{ dealer.staff_count }} / {{ allowed_users }}
-
-
-
{% trans 'Total cars'|capfirst %}
- {{ cars_count }} / {{ allowed_cars }}
-
-
+
+
+
+
+
+
+
-
-
-
-
-
{% trans 'Default Address' %}
-
-
-
-
-
{% trans 'Address' %}
-
-
-
-
-
-
-
-
{% trans 'Email' %}
-
-
{{ dealer.user.email }}
-
-
-
-
{% trans 'Phone' %}
-
-
{{ dealer.phone_number }}
-
-
+
+
+
{{ dealer.get_local_name }}
+
{% trans 'Joined' %} {{ dealer.joined_at|timesince }} {% trans 'ago' %}
+
{% trans 'Last login' %}: {{ dealer.user.last_login|date:"D M d, Y H:i" }}
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ dealer.user.userplan.plan|capfirst }}
- {% if dealer.user.userplan %}
- {% if not dealer.user.userplan.is_expired %}
-
{% trans 'Active' %}
- {% else %}
-
{% trans 'Expired' %}
-
{{ _("Renew") }}
- {% endif %}
- {% if dealer.user.userplan.plan.name != "Enterprise" %}
-
{{ _("Upgrade") }}
- {% endif %}
- {% else %}
-
You have no active plan.
-
{{ _("Subscribe") }}
- {% endif %}
-
-
- {% trans 'Active until' %}: {{ dealer.user.userplan.expire }} {% trans 'Days left' %}: {{ dealer.user.userplan.days_left }}
-
-
-
- {{ dealer.user.userplan.plan.planpricing_set.first.price }}
-
- {{ _("Per month") }}
-
-
-
-
-
-
-
-
-
-
- {% for line in dealer.user.userplan.plan.description|splitlines %}
-
-
- {{ line }}
-
- {% endfor %}
-
-
-
+
+
+
+
{% trans 'Total users'|capfirst %}
+
{{ dealer.staff_count }} / {{ allowed_users }}
+
-
-
-
-
-
-
-
-
{{ _("Makes you are selling") }}
-
-
-
- {% for make in car_makes %}
-
- {% if make.logo %}
-
- {% endif %}
-
{{ make.get_local_name }}
-
- {% endfor %}
-
-
-
-
-
-
-
-
-
-
-
-
{{ _("VAT") }}
-
-
-
-
-
+
+
{% trans 'Total cars'|capfirst %}
+
{{ cars_count }} / {{ allowed_cars }}
+
@@ -241,4 +68,179 @@
- {% endblock %}
+
+
+
+
+
+
+
+
+ {{ _("Plan & Subscription") }}
+
+
+ {{ _("Company Details") }}
+
+
+ {{ _("Car Brands") }}
+
+
+
+
+
+
+
+
+
+
{{ dealer.user.userplan.plan|capfirst }}
+ {% if dealer.user.userplan and not dealer.user.userplan.is_expired %}
+ {{ _("Active") }}
+ {% elif dealer.user.userplan and dealer.user.userplan.is_expired %}
+ {{ _("Expired") }}
+ {% else %}
+ {{ _("No Active Plan") }}
+ {% endif %}
+
+
+ {% if dealer.user.userplan and not dealer.user.userplan.is_expired %}
+ {% trans 'Active until' %}: {{ dealer.user.userplan.expire }} {% trans 'Days left' %}: {{ dealer.user.userplan.days_left }}
+ {% else %}
+ {% trans 'Please subscribe or renew your plan to continue using our services.' %}
+ {% endif %}
+
+
+
+
+ {{ dealer.user.userplan.plan.planpricing_set.first.price }}
+
+ {{ _("Per month") }}
+
+
+
+ {% for line in dealer.user.userplan.plan.description|splitlines %}
+
+
+ {{ line }}
+
+ {% endfor %}
+
+
+
+ {% if dealer.user.userplan.is_expired %}
+
{{ _("Renew") }}
+ {% endif %}
+ {% if dealer.user.userplan.plan.name != "Enterprise" %}
+
{{ _("Upgrade Plan") }}
+ {% endif %}
+ {% if not dealer.user.userplan %}
+
{{ _("Subscribe Now") }}
+ {% endif %}
+
+
+
+
+
+
+
+
+
{{ _("Manage Users & Cars") }}
+
+
+
{{ _("Total users") }}
+
+
+ {{ _("Used") }}: {{ dealer.staff_count }}
+ {{ _("Limit") }}: {{ allowed_users }}
+
+
+
+
{{ _("Total cars") }}
+
+
+ {{ _("Used") }}: {{ cars_count }}
+ {{ _("Limit") }}: {{ allowed_cars }}
+
+
+
{{ _("Contact support to increase your limits") }}
+
+
+
+
+
+
+
+
+
+
+
+
{{ _("Makes you are selling") }}
+
+ {% for make in car_makes %}
+
+ {% if make.logo %}
+
+ {% endif %}
+
{{ make.get_local_name }}
+
+ {% empty %}
+
{{ _("No car makes selected.") }}
+ {% endfor %}
+
+
{{ _("Select Makes") }}
+
+
+
+
+
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/templates/emails/expiration_reminder_ar.html b/templates/emails/expiration_reminder_ar.html
index 421aea38..0f9b3d27 100644
--- a/templates/emails/expiration_reminder_ar.html
+++ b/templates/emails/expiration_reminder_ar.html
@@ -13,6 +13,6 @@
مع أطيب التحيات،
- فريق {{ SITE_NAME }}
+ فريق تنحل