Compare commits

..

No commits in common. "c87a22b1036db80d810cfcf5348a6225a4c9fcf2" and "966633fe3b884452fe50f6995ac75dd36ef88830" have entirely different histories.

9 changed files with 11561 additions and 11576 deletions

View File

@ -127,17 +127,17 @@ class StaffForm(forms.ModelForm):
queryset=Service.objects.all(),
required=False,
)
# phone_number = SaudiPhoneNumberField(
# required=False,
# widget=forms.TextInput(
# attrs={
# "class": "form-control",
# "placeholder": _("Phone Number"),
# "id": "phone",
# }
# ),
# label=_("Phone Number"),
# )
phone_number = SaudiPhoneNumberField(
required=False,
widget=forms.TextInput(
attrs={
"class": "form-control",
"placeholder": _("Phone Number"),
"id": "phone",
}
),
label=_("Phone Number"),
)
group = forms.ModelMultipleChoiceField(
label=_("Group"),
widget=forms.CheckboxSelectMultiple(attrs={"class": "form-check-input"}),

View File

@ -1467,7 +1467,7 @@ class Staff(models.Model):
first_name = models.CharField(max_length=255, verbose_name=_("First Name"))
last_name = models.CharField(max_length=255, verbose_name=_("Last Name"))
arabic_name = models.CharField(max_length=255, verbose_name=_("Arabic Name"),null=True,blank=True)
arabic_name = models.CharField(max_length=255, verbose_name=_("Arabic Name"))
phone_number = models.CharField(
max_length=255,
verbose_name=_("Phone Number"),

View File

@ -10,8 +10,8 @@ urlpatterns = [
# main URLs
path("", views.WelcomeView, name="welcome"),
path("signup/", views.dealer_signup, name="account_signup"),
path("", views.HomeView, name="home"),
path("<slug:dealer_slug>/", views.HomeView, name="home"),
path("", views.HomeView.as_view(), name="home"),
path("<slug:dealer_slug>/", views.HomeView.as_view(), name="home"),
# Tasks
path("legal/", views.terms_and_privacy, name="terms_and_privacy"),
# path('tasks/<int:task_id>/detail/', views.task_detail, name='task_detail'),
@ -130,7 +130,7 @@ urlpatterns = [
),
path(
"<slug:dealer_slug>/crm/leads/<slug:slug>/update/",
views.lead_update,
views.LeadUpdateView.as_view(),
name="lead_update",
),
path(

View File

@ -362,31 +362,24 @@ def dealer_signup(request):
"account/signup-wizard.html",
)
# class HomeView(LoginRequiredMixin, TemplateView):
# """
# HomeView class responsible for rendering the home page.
class HomeView(LoginRequiredMixin, TemplateView):
"""
HomeView class responsible for rendering the home page.
# This class ensures that only authenticated users can access the home page.
# Unauthenticated users are redirected to the welcome page. It is built on top of
# Django's TemplateView and includes additional functionality by inheriting from
# LoginRequiredMixin. The purpose of this class is to control the accessibility
# of the main index page of the application and manage context data for frontend
# rendering.
This class ensures that only authenticated users can access the home page.
Unauthenticated users are redirected to the welcome page. It is built on top of
Django's TemplateView and includes additional functionality by inheriting from
LoginRequiredMixin. The purpose of this class is to control the accessibility
of the main index page of the application and manage context data for frontend
rendering.
# :ivar template_name: The path to the template used for rendering the view's
# output.
# :type template_name: str
# """
:ivar template_name: The path to the template used for rendering the view's
output.
:type template_name: str
"""
# template_name = "index.html"
template_name = "index.html"
@login_required
def HomeView(request,dealer_slug=None):
dealer_slug=request.dealer.slug
if request.is_sales and not request.is_manager and not request.is_dealer:
return redirect('sales_dashboard', dealer_slug=dealer_slug)
else:
return redirect('general_dashboard',dealer_slug=dealer_slug)
class TestView(TemplateView):
"""

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 KiB

View File

@ -8,13 +8,13 @@
<div class="main-content flex-grow-1 container-fluid mt-4 mb-3">
<div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center mb-5 pb-3 border-bottom">
<h2 class="h3 fw-bold mb-3 mb-md-0">
{% if request.is_dealer %}
{% if request.is_dealer or request.is_manager%}
{% trans "Business Health Dashboard" %}
{% elif request.is_manger %}
{% trans "Manager Dashboard" %}
{% elif request.is_inventory %}
{% endif %}
{% if request.is_inventory and not request.is_manager and not request.is_dealer %}
{% trans "Inventory Dashboard" %}
{% else %}
{% endif %}
{% if request.is_accountant and not request.is_manager and not request.is_dealer %}
{% trans "Accountant Dashboard" %}
{% endif %}
<i class="fas fa-chart-area text-primary ms-2"></i>

View File

@ -11,7 +11,6 @@
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 %}
@ -440,23 +439,27 @@
</div>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'ticket_list' request.dealer.slug %}">
<div class="d-flex align-items-center">
{% if user.is_authenticated %}
<span class="nav-link-icon"><span class="fa-solid fa-car"></span></span>
<span class="nav-link-text">{{ request.dealer.user.username }}</span>
{% endif %}
</div>
</a>
</li>
</ul>
</div>
{% endif %}
</div>
</div>
<div class="navbar-vertical-footer">
<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-5"></span></span>
<span class="nav-link-text">{{ request.dealer.user.username }}</span>
{% endif %}
</div>
</a>
<button class="btn navbar-vertical-toggle border-0 fw-semibold w-100 white-space-nowrap d-flex align-items-center">
<span class="fas fa-angle-double-left fs-8"></span><span class="fas fa-angle-double-right fs-8"></span><span class="navbar-vertical-footer-text ms-2">Collapsed View</span>
</button>
</div>
</nav>
<nav class="navbar navbar-top fixed-top navbar-expand" id="navbarDefault">

View File

@ -1,5 +1,5 @@
{% comment %} {% extends 'base.html' %}
{% extends 'base.html' %}
{% load i18n static custom_filters django_ledger %}
{% block content %}
@ -20,6 +20,4 @@
</div>
</div>
{% endif %}
{% endblock %} {% endcomment %}
{% endblock %}

View File

@ -26,16 +26,7 @@
<form class="needs-validation" method="post" novalidate>
{% csrf_token %}
{{ redirect_field }}
{{ form.first_name|as_crispy_field }}
{{ form.last_name|as_crispy_field }}
{{ form.arabic_name|as_crispy_field }}
{{ form.email|as_crispy_field }}
{{ form.phone_number|as_crispy_field }}
{{ form.address|as_crispy_field }}
{{ form.logo|as_crispy_field }}
{{ form.group|as_crispy_field }}
{{ form|crispy }}
{% if form.errors %}
<div class="alert alert-danger mt-4" role="alert">
<h4 class="alert-heading small">{% trans "Please correct the following errors:" %}</h4>