Compare commits
No commits in common. "c87a22b1036db80d810cfcf5348a6225a4c9fcf2" and "966633fe3b884452fe50f6995ac75dd36ef88830" have entirely different histories.
c87a22b103
...
966633fe3b
@ -127,17 +127,17 @@ class StaffForm(forms.ModelForm):
|
|||||||
queryset=Service.objects.all(),
|
queryset=Service.objects.all(),
|
||||||
required=False,
|
required=False,
|
||||||
)
|
)
|
||||||
# phone_number = SaudiPhoneNumberField(
|
phone_number = SaudiPhoneNumberField(
|
||||||
# required=False,
|
required=False,
|
||||||
# widget=forms.TextInput(
|
widget=forms.TextInput(
|
||||||
# attrs={
|
attrs={
|
||||||
# "class": "form-control",
|
"class": "form-control",
|
||||||
# "placeholder": _("Phone Number"),
|
"placeholder": _("Phone Number"),
|
||||||
# "id": "phone",
|
"id": "phone",
|
||||||
# }
|
}
|
||||||
# ),
|
),
|
||||||
# label=_("Phone Number"),
|
label=_("Phone Number"),
|
||||||
# )
|
)
|
||||||
group = forms.ModelMultipleChoiceField(
|
group = forms.ModelMultipleChoiceField(
|
||||||
label=_("Group"),
|
label=_("Group"),
|
||||||
widget=forms.CheckboxSelectMultiple(attrs={"class": "form-check-input"}),
|
widget=forms.CheckboxSelectMultiple(attrs={"class": "form-check-input"}),
|
||||||
|
|||||||
@ -1467,7 +1467,7 @@ class Staff(models.Model):
|
|||||||
first_name = models.CharField(max_length=255, verbose_name=_("First Name"))
|
first_name = models.CharField(max_length=255, verbose_name=_("First Name"))
|
||||||
last_name = models.CharField(max_length=255, verbose_name=_("Last 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(
|
phone_number = models.CharField(
|
||||||
max_length=255,
|
max_length=255,
|
||||||
verbose_name=_("Phone Number"),
|
verbose_name=_("Phone Number"),
|
||||||
|
|||||||
@ -10,8 +10,8 @@ urlpatterns = [
|
|||||||
# main URLs
|
# main URLs
|
||||||
path("", views.WelcomeView, name="welcome"),
|
path("", views.WelcomeView, name="welcome"),
|
||||||
path("signup/", views.dealer_signup, name="account_signup"),
|
path("signup/", views.dealer_signup, name="account_signup"),
|
||||||
path("", views.HomeView, name="home"),
|
path("", views.HomeView.as_view(), name="home"),
|
||||||
path("<slug:dealer_slug>/", views.HomeView, name="home"),
|
path("<slug:dealer_slug>/", views.HomeView.as_view(), name="home"),
|
||||||
# Tasks
|
# Tasks
|
||||||
path("legal/", views.terms_and_privacy, name="terms_and_privacy"),
|
path("legal/", views.terms_and_privacy, name="terms_and_privacy"),
|
||||||
# path('tasks/<int:task_id>/detail/', views.task_detail, name='task_detail'),
|
# path('tasks/<int:task_id>/detail/', views.task_detail, name='task_detail'),
|
||||||
@ -130,7 +130,7 @@ urlpatterns = [
|
|||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"<slug:dealer_slug>/crm/leads/<slug:slug>/update/",
|
"<slug:dealer_slug>/crm/leads/<slug:slug>/update/",
|
||||||
views.lead_update,
|
views.LeadUpdateView.as_view(),
|
||||||
name="lead_update",
|
name="lead_update",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
|
|||||||
@ -362,31 +362,24 @@ def dealer_signup(request):
|
|||||||
"account/signup-wizard.html",
|
"account/signup-wizard.html",
|
||||||
)
|
)
|
||||||
|
|
||||||
# class HomeView(LoginRequiredMixin, TemplateView):
|
class HomeView(LoginRequiredMixin, TemplateView):
|
||||||
# """
|
"""
|
||||||
# HomeView class responsible for rendering the home page.
|
HomeView class responsible for rendering the home page.
|
||||||
|
|
||||||
# This class ensures that only authenticated users can access 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
|
Unauthenticated users are redirected to the welcome page. It is built on top of
|
||||||
# Django's TemplateView and includes additional functionality by inheriting from
|
Django's TemplateView and includes additional functionality by inheriting from
|
||||||
# LoginRequiredMixin. The purpose of this class is to control the accessibility
|
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
|
of the main index page of the application and manage context data for frontend
|
||||||
# rendering.
|
rendering.
|
||||||
|
|
||||||
# :ivar template_name: The path to the template used for rendering the view's
|
:ivar template_name: The path to the template used for rendering the view's
|
||||||
# output.
|
output.
|
||||||
# :type template_name: str
|
: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):
|
class TestView(TemplateView):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 429 KiB |
@ -8,13 +8,13 @@
|
|||||||
<div class="main-content flex-grow-1 container-fluid mt-4 mb-3">
|
<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">
|
<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">
|
<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" %}
|
{% trans "Business Health Dashboard" %}
|
||||||
{% elif request.is_manger %}
|
{% endif %}
|
||||||
{% trans "Manager Dashboard" %}
|
{% if request.is_inventory and not request.is_manager and not request.is_dealer %}
|
||||||
{% elif request.is_inventory %}
|
|
||||||
{% trans "Inventory Dashboard" %}
|
{% trans "Inventory Dashboard" %}
|
||||||
{% else %}
|
{% endif %}
|
||||||
|
{% if request.is_accountant and not request.is_manager and not request.is_dealer %}
|
||||||
{% trans "Accountant Dashboard" %}
|
{% trans "Accountant Dashboard" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<i class="fas fa-chart-area text-primary ms-2"></i>
|
<i class="fas fa-chart-area text-primary ms-2"></i>
|
||||||
|
|||||||
@ -11,7 +11,6 @@
|
|||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
hx-select-oob="#toast-container"
|
hx-select-oob="#toast-container"
|
||||||
hx-indicator="#spinner">
|
hx-indicator="#spinner">
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
{% comment %} <p class="navbar-vertical-label text-primary fs-8 text-truncate">{{request.dealer|default:"Apps"}}</p>
|
{% comment %} <p class="navbar-vertical-label text-primary fs-8 text-truncate">{{request.dealer|default:"Apps"}}</p>
|
||||||
<hr class="navbar-vertical-line"> {% endcomment %}
|
<hr class="navbar-vertical-line"> {% endcomment %}
|
||||||
@ -440,23 +439,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-vertical-footer">
|
<div class="navbar-vertical-footer">
|
||||||
<a class="nav-link ps-2" href="{% if request.is_dealer%}{% url 'ticket_list' request.dealer.slug %} {% else %}#{%endif%}">
|
<button class="btn navbar-vertical-toggle border-0 fw-semibold w-100 white-space-nowrap d-flex align-items-center">
|
||||||
<div class="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>
|
||||||
{% if user.is_authenticated%}
|
</button>
|
||||||
|
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<nav class="navbar navbar-top fixed-top navbar-expand" id="navbarDefault">
|
<nav class="navbar navbar-top fixed-top navbar-expand" id="navbarDefault">
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
{% comment %} {% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load i18n static custom_filters django_ledger %}
|
{% load i18n static custom_filters django_ledger %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
@ -20,6 +20,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% endblock %} {% endcomment %}
|
|
||||||
@ -26,16 +26,7 @@
|
|||||||
<form class="needs-validation" method="post" novalidate>
|
<form class="needs-validation" method="post" novalidate>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ redirect_field }}
|
{{ redirect_field }}
|
||||||
|
{{ form|crispy }}
|
||||||
{{ 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 }}
|
|
||||||
|
|
||||||
{% if form.errors %}
|
{% if form.errors %}
|
||||||
<div class="alert alert-danger mt-4" role="alert">
|
<div class="alert alert-danger mt-4" role="alert">
|
||||||
<h4 class="alert-heading small">{% trans "Please correct the following errors:" %}</h4>
|
<h4 class="alert-heading small">{% trans "Please correct the following errors:" %}</h4>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user