conflicts

This commit is contained in:
Faheedkhan 2025-07-22 12:24:49 +03:00
commit aa58919c56
322 changed files with 20481 additions and 16420 deletions

1
.gitignore vendored
View File

@ -11,6 +11,7 @@ dbtest.sqlite3
db.sqlite3
db.sqlite3.backup
db.sqlite*
new.sqlite3
*.sqlite3
media
car*.json

View File

@ -17,7 +17,7 @@ urlpatterns = [
path("api-auth/", include("rest_framework.urls")),
path("api/", include("api.urls")),
# path('dj-rest-auth/', include('dj_rest_auth.urls')),
]# + debug_toolbar_urls()
] # + debug_toolbar_urls()
urlpatterns += i18n_patterns(
path("admin/", admin.site.urls),
path("switch_language/", views.switch_language, name="switch_language"),

View File

@ -1,4 +1,4 @@
# Generated by Django 5.2.4 on 2025-07-15 13:26
# Generated by Django 5.2.4 on 2025-07-15 11:38
import django.db.models.deletion
import django.utils.timezone

View File

@ -1,4 +1,4 @@
# Generated by Django 5.2.4 on 2025-07-15 13:26
# Generated by Django 5.2.4 on 2025-07-15 11:38
import django.db.models.deletion
from django.db import migrations, models

View File

@ -1,5 +1,6 @@
from django.conf import settings
def currency_context(request):
"""
Provides a context dictionary containing the currency setting. This is typically
@ -42,7 +43,6 @@ def breadcrumbs(request):
return {"breadcrumbs": breadcrumbs}
def user_types(request):
"""
Sets various flags indicating the user's role types.

View File

@ -142,9 +142,10 @@ class StaffForm(forms.ModelForm):
queryset=CustomGroup.objects.all(),
required=True,
)
class Meta:
model = Staff
fields = ["name", "arabic_name", "phone_number", "address","logo","group"]
fields = ["name", "arabic_name", "phone_number", "address", "logo", "group"]
# Dealer Form
@ -1564,6 +1565,7 @@ class GroupForm(forms.ModelForm):
# 60 * 60,
# )
# class Meta:
# model = Permission
# fields = ["name"]
@ -1571,6 +1573,7 @@ class PermissionForm(forms.ModelForm):
"""
Form for managing permissions with grouped checkboxes by app and model.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
EXCLUDED_MODELS = [
@ -1591,31 +1594,27 @@ class PermissionForm(forms.ModelForm):
"inventory.schedule",
"inventory.activity",
"inventory.opportunity",
"inventory.carreservation"
"inventory.customer",
"inventory.carreservationinventory.customer",
"inventory.organization",
# "inventory.salequotation",
# "inventory.salequotationcar"
"django_ledger.purchaseordermodel"
"django_ledger.bankaccountmodel",
"django_ledger.purchaseordermodeldjango_ledger.bankaccountmodel",
"django_ledger.estimatemodel",
"django_ledger.accountmodel",
"django_ledger.chartofaccountmodel",
"django_ledger.billmodel"
"django_ledger.itemmodel",
"django_ledger.billmodeldjango_ledger.itemmodel",
"django_ledger.invoicemodel",
"django_ledger.vendormodel",
"django_ledger.journalentrymodel"
"django_ledger.purchaseordermodel",#TODO add purchase order
]
"django_ledger.purchaseordermodel", # TODO add purchase order
]
permissions = cache.get(
"permissions_queryset",
Permission.objects.filter(
content_type__app_label__in=[m.split('.')[0] for m in EXCLUDED_MODELS],
content_type__model__in=[m.split('.')[1] for m in EXCLUDED_MODELS]
).select_related('content_type')
content_type__app_label__in=[m.split(".")[0] for m in EXCLUDED_MODELS],
content_type__model__in=[m.split(".")[1] for m in EXCLUDED_MODELS],
).select_related("content_type"),
)
# Group permissions by app_label and model
@ -1630,11 +1629,11 @@ class PermissionForm(forms.ModelForm):
self.grouped_permissions[app_label][model].append(perm)
# Create a multiple choice field (hidden, will use custom rendering)
self.fields['permissions'] = forms.ModelMultipleChoiceField(
self.fields["permissions"] = forms.ModelMultipleChoiceField(
queryset=permissions,
widget=forms.MultipleHiddenInput(),
required=False,
initial=self.instance.permissions.all() if self.instance.pk else []
initial=self.instance.permissions.all() if self.instance.pk else [],
)
class Meta:
@ -2036,17 +2035,17 @@ class CSVUploadForm(forms.Form):
)
year = forms.IntegerField(
label=_("Year"),
widget=forms.NumberInput(attrs=
{
"class": "form-control",
"hx-get": "",
"hx-target": "#serie",
"hx-select": "#serie",
"hx-include": "#model",
"hx-trigger": "input delay:500ms",
"hx-swap": "outerHTML",
}
),
widget=forms.NumberInput(
attrs={
"class": "form-control",
"hx-get": "",
"hx-target": "#serie",
"hx-select": "#serie",
"hx-include": "#model",
"hx-trigger": "input delay:500ms",
"hx-swap": "outerHTML",
}
),
required=True,
)
exterior = forms.ModelChoiceField(
@ -2101,7 +2100,8 @@ class AdditionalFinancesForm(forms.Form):
required=False,
)
class VatRateForm(forms.ModelForm):
class Meta:
model = VatRate
fields = ['rate']
fields = ["rate"]

View File

@ -1,16 +1,49 @@
from inventory.models import Lead,Car
from inventory.models import Lead, Car
from django.contrib.auth.models import Permission
from django.core.management.base import BaseCommand
from django.contrib.contenttypes.models import ContentType
from django_ledger.models import EstimateModel,BillModel,AccountModel,LedgerModel
from django_ledger.models import EstimateModel, BillModel, AccountModel, LedgerModel
class Command(BaseCommand):
def handle(self, *args, **kwargs):
Permission.objects.get_or_create(name="Can view crm",codename="can_view_crm",content_type=ContentType.objects.get_for_model(Lead))
Permission.objects.get_or_create(name="Can reassign lead",codename="can_reassign_lead",content_type=ContentType.objects.get_for_model(Lead))
Permission.objects.get_or_create(name="Can view sales",codename="can_view_sales",content_type=ContentType.objects.get_for_model(EstimateModel))
Permission.objects.get_or_create(name="Can view reports",codename="can_view_reports",content_type=ContentType.objects.get_for_model(LedgerModel))
Permission.objects.get_or_create(name="Can view inventory",codename="can_view_inventory",content_type=ContentType.objects.get_for_model(Car))
Permission.objects.get_or_create(name="Can approve bill",codename="can_approve_billmodel",content_type=ContentType.objects.get_for_model(BillModel))
Permission.objects.get_or_create(name="Can view financials",codename="can_view_financials",content_type=ContentType.objects.get_for_model(AccountModel))
Permission.objects.get_or_create(name="Can approve estimate",codename="can_approve_estimatemodel",content_type=ContentType.objects.get_for_model(EstimateModel))
Permission.objects.get_or_create(
name="Can view crm",
codename="can_view_crm",
content_type=ContentType.objects.get_for_model(Lead),
)
Permission.objects.get_or_create(
name="Can reassign lead",
codename="can_reassign_lead",
content_type=ContentType.objects.get_for_model(Lead),
)
Permission.objects.get_or_create(
name="Can view sales",
codename="can_view_sales",
content_type=ContentType.objects.get_for_model(EstimateModel),
)
Permission.objects.get_or_create(
name="Can view reports",
codename="can_view_reports",
content_type=ContentType.objects.get_for_model(LedgerModel),
)
Permission.objects.get_or_create(
name="Can view inventory",
codename="can_view_inventory",
content_type=ContentType.objects.get_for_model(Car),
)
Permission.objects.get_or_create(
name="Can approve bill",
codename="can_approve_billmodel",
content_type=ContentType.objects.get_for_model(BillModel),
)
Permission.objects.get_or_create(
name="Can view financials",
codename="can_view_financials",
content_type=ContentType.objects.get_for_model(AccountModel),
)
Permission.objects.get_or_create(
name="Can approve estimate",
codename="can_approve_estimatemodel",
content_type=ContentType.objects.get_for_model(EstimateModel),
)

View File

@ -135,6 +135,7 @@ class InjectDealerMiddleware:
# return redirect(reverse('verify_otp'))
# return self.get_response(request)
class DealerSlugMiddleware:
def __init__(self, get_response):
self.get_response = get_response
@ -142,19 +143,22 @@ class DealerSlugMiddleware:
def __call__(self, request):
response = self.get_response(request)
return response
def process_view(self, request, view_func, view_args, view_kwargs):
if request.path_info.startswith('/ar/signup/') or \
request.path_info.startswith('/en/signup/') or \
request.path_info.startswith('/ar/login/') or \
request.path_info.startswith('/en/login/') or \
request.path_info.startswith('/ar/logout/') or \
request.path_info.startswith('/en/logout/') or \
request.path_info.startswith('/en/ledger/') or \
request.path_info.startswith('/ar/ledger/') or \
request.path_info.startswith('/en/notifications/') or \
request.path_info.startswith('/ar/notifications/') or \
request.path_info.startswith('/en/appointment/') or \
request.path_info.startswith('/ar/appointment/'):
if (
request.path_info.startswith("/ar/signup/")
or request.path_info.startswith("/en/signup/")
or request.path_info.startswith("/ar/login/")
or request.path_info.startswith("/en/login/")
or request.path_info.startswith("/ar/logout/")
or request.path_info.startswith("/en/logout/")
or request.path_info.startswith("/en/ledger/")
or request.path_info.startswith("/ar/ledger/")
or request.path_info.startswith("/en/notifications/")
or request.path_info.startswith("/ar/notifications/")
or request.path_info.startswith("/en/appointment/")
or request.path_info.startswith("/ar/appointment/")
):
return None
if not request.user.is_authenticated:
@ -164,12 +168,14 @@ class DealerSlugMiddleware:
if not dealer_slug:
return None
if not hasattr(request, 'dealer') or not request.dealer:
if not hasattr(request, "dealer") or not request.dealer:
logger.warning("No dealer associated with request")
return None
if dealer_slug.lower() != request.dealer.slug.lower():
logger.warning(f"Dealer slug mismatch: {dealer_slug} != {request.dealer.slug}")
logger.warning(
f"Dealer slug mismatch: {dealer_slug} != {request.dealer.slug}"
)
raise Http404("Dealer slug mismatch")
return None

View File

@ -1,4 +1,4 @@
# Generated by Django 5.2.4 on 2025-07-15 13:26
# Generated by Django 5.2.4 on 2025-07-15 11:38
import datetime
import django.core.serializers.json

View File

@ -79,13 +79,15 @@ class DealerSlugMixin:
class AuthorizedEntityMixin:
def get_authorized_entity_queryset(self):
dealer = get_object_or_404(models.Dealer,slug=self.kwargs["dealer_slug"])
dealer = get_object_or_404(models.Dealer, slug=self.kwargs["dealer_slug"])
return EntityModel.objects.for_user(
user_model=dealer.entity.admin,
authorized_superuser=self.get_superuser_authorization(),
)
def get_queryset(self):
dealer = get_object_or_404(models.Dealer,slug=self.kwargs["dealer_slug"])
dealer = get_object_or_404(models.Dealer, slug=self.kwargs["dealer_slug"])
self.queryset = EntityModel.objects.for_user(
user_model=dealer.entity.admin).select_related('default_coa')
user_model=dealer.entity.admin
).select_related("default_coa")
return super().get_queryset()

View File

@ -18,7 +18,7 @@ from django_ledger.models import (
ItemModel,
CustomerModel,
JournalEntryModel,
LedgerModel
LedgerModel,
)
from django_ledger.io.io_core import get_localdate
from django.core.exceptions import ValidationError
@ -35,7 +35,7 @@ from django_ledger.models import (
EntityManagementModel,
PurchaseOrderModel,
ItemTransactionModel,
BillModel
BillModel,
)
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
@ -248,9 +248,9 @@ class CarMake(models.Model, LocalizedNameMixin):
class Meta:
verbose_name = _("Make")
indexes = [
models.Index(fields=['name'], name='car_make_name_idx'),
models.Index(fields=['is_sa_import'], name='car_make_sa_import_idx'),
models.Index(fields=['car_type'], name='car_make_type_idx'),
models.Index(fields=["name"], name="car_make_name_idx"),
models.Index(fields=["is_sa_import"], name="car_make_sa_import_idx"),
models.Index(fields=["car_type"], name="car_make_type_idx"),
]
@ -282,9 +282,11 @@ class CarModel(models.Model, LocalizedNameMixin):
class Meta:
verbose_name = _("Model")
indexes = [
models.Index(fields=['id_car_make'], name='car_model_make_idx'),
models.Index(fields=['name'], name='car_model_name_idx'),
models.Index(fields=['id_car_make', 'name'], name='car_model_make_name_idx'),
models.Index(fields=["id_car_make"], name="car_model_make_idx"),
models.Index(fields=["name"], name="car_model_name_idx"),
models.Index(
fields=["id_car_make", "name"], name="car_model_make_name_idx"
),
]
@ -321,10 +323,10 @@ class CarSerie(models.Model, LocalizedNameMixin):
class Meta:
verbose_name = _("Series")
indexes = [
models.Index(fields=['id_car_model'], name='car_serie_model_idx'),
models.Index(fields=['year_begin', 'year_end'], name='car_serie_years_idx'),
models.Index(fields=['name'], name='car_serie_name_idx'),
models.Index(fields=['generation_name'], name='car_serie_generation_idx'),
models.Index(fields=["id_car_model"], name="car_serie_model_idx"),
models.Index(fields=["year_begin", "year_end"], name="car_serie_years_idx"),
models.Index(fields=["name"], name="car_serie_name_idx"),
models.Index(fields=["generation_name"], name="car_serie_generation_idx"),
]
@ -360,9 +362,12 @@ class CarTrim(models.Model, LocalizedNameMixin):
class Meta:
verbose_name = _("Trim")
indexes = [
models.Index(fields=['id_car_serie'], name='car_trim_serie_idx'),
models.Index(fields=['start_production_year', 'end_production_year'], name='car_trim_prod_years_idx'),
models.Index(fields=['name'], name='car_trim_name_idx'),
models.Index(fields=["id_car_serie"], name="car_trim_serie_idx"),
models.Index(
fields=["start_production_year", "end_production_year"],
name="car_trim_prod_years_idx",
),
models.Index(fields=["name"], name="car_trim_name_idx"),
]
@ -385,9 +390,9 @@ class CarEquipment(models.Model, LocalizedNameMixin):
class Meta:
verbose_name = _("Equipment")
indexes = [
models.Index(fields=['id_car_trim'], name='car_equipment_trim_idx'),
models.Index(fields=['year_begin'], name='car_equipment_year_idx'),
models.Index(fields=['name'], name='car_equipment_name_idx'),
models.Index(fields=["id_car_trim"], name="car_equipment_trim_idx"),
models.Index(fields=["year_begin"], name="car_equipment_year_idx"),
models.Index(fields=["name"], name="car_equipment_name_idx"),
]
@ -421,8 +426,8 @@ class CarSpecification(models.Model, LocalizedNameMixin):
class Meta:
verbose_name = _("Specification")
indexes = [
models.Index(fields=['id_parent'], name='car_spec_parent_idx'),
models.Index(fields=['name'], name='car_spec_name_idx'),
models.Index(fields=["id_parent"], name="car_spec_parent_idx"),
models.Index(fields=["name"], name="car_spec_name_idx"),
]
@ -441,9 +446,12 @@ class CarSpecificationValue(models.Model):
class Meta:
verbose_name = _("Specification Value")
indexes = [
models.Index(fields=['id_car_trim'], name='car_spec_val_trim_idx'),
models.Index(fields=['id_car_specification'], name='car_spec_val_spec_idx'),
models.Index(fields=['id_car_trim', 'id_car_specification'], name='car_spec_val_trim_spec_idx'),
models.Index(fields=["id_car_trim"], name="car_spec_val_trim_idx"),
models.Index(fields=["id_car_specification"], name="car_spec_val_spec_idx"),
models.Index(
fields=["id_car_trim", "id_car_specification"],
name="car_spec_val_trim_spec_idx",
),
]
@ -477,8 +485,8 @@ class CarOption(models.Model, LocalizedNameMixin):
class Meta:
verbose_name = _("Option")
indexes = [
models.Index(fields=['id_parent'], name='car_option_parent_idx'),
models.Index(fields=['name'], name='car_option_name_idx'),
models.Index(fields=["id_parent"], name="car_option_parent_idx"),
models.Index(fields=["name"], name="car_option_name_idx"),
]
@ -500,10 +508,13 @@ class CarOptionValue(models.Model):
class Meta:
verbose_name = _("Option Value")
indexes = [
models.Index(fields=['id_car_option'], name='car_opt_val_option_idx'),
models.Index(fields=['id_car_equipment'], name='car_opt_val_equipment_idx'),
models.Index(fields=['is_base'], name='car_opt_val_is_base_idx'),
models.Index(fields=['id_car_option', 'id_car_equipment'], name='cov_option_equipment_idx'),
models.Index(fields=["id_car_option"], name="car_opt_val_option_idx"),
models.Index(fields=["id_car_equipment"], name="car_opt_val_equipment_idx"),
models.Index(fields=["is_base"], name="car_opt_val_is_base_idx"),
models.Index(
fields=["id_car_option", "id_car_equipment"],
name="cov_option_equipment_idx",
),
]
@ -566,7 +577,7 @@ class AdditionalServices(models.Model, LocalizedNameMixin):
@property
def price_(self):
vat = VatRate.objects.filter(dealer=self.dealer,is_active=True).first()
vat = VatRate.objects.filter(dealer=self.dealer, is_active=True).first()
return (
Decimal(self.price + (self.price * vat.rate))
if self.taxable
@ -656,7 +667,10 @@ class Car(Base):
# history = HistoricalRecords()
def get_absolute_url(self):
return reverse("car_detail", kwargs={"dealer_slug": self.dealer.slug,"slug": self.slug})
return reverse(
"car_detail", kwargs={"dealer_slug": self.dealer.slug, "slug": self.slug}
)
def save(self, *args, **kwargs):
self.slug = slugify(self.vin)
self.hash = self.get_hash
@ -666,24 +680,27 @@ class Car(Base):
verbose_name = _("Car")
verbose_name_plural = _("Cars")
indexes = [
models.Index(fields=['vin'], name='car_vin_idx'),
models.Index(fields=['year'], name='car_year_idx'),
models.Index(fields=['status'], name='car_status_idx'),
models.Index(fields=['dealer'], name='car_dealer_idx'),
models.Index(fields=['vendor'], name='car_vendor_idx'),
models.Index(fields=['id_car_make'], name='car_make_idx'),
models.Index(fields=['id_car_model'], name='car_model_idx'),
models.Index(fields=['id_car_serie'], name='car_serie_idx'),
models.Index(fields=['id_car_trim'], name='car_trim_idx'),
models.Index(fields=['id_car_make', 'id_car_model'], name='car_make_model_idx'),
models.Index(fields=['id_car_make', 'year'], name='car_make_year_idx'),
models.Index(fields=['dealer', 'status'], name='car_dealer_status_idx'),
models.Index(fields=['vendor', 'status'], name='car_vendor_status_idx'),
models.Index(fields=['year', 'status'], name='car_year_status_idx'),
models.Index(fields=['status'], name='car_active_status_idx',
condition=Q(status=CarStatusChoices.AVAILABLE)),
models.Index(fields=["vin"], name="car_vin_idx"),
models.Index(fields=["year"], name="car_year_idx"),
models.Index(fields=["status"], name="car_status_idx"),
models.Index(fields=["dealer"], name="car_dealer_idx"),
models.Index(fields=["vendor"], name="car_vendor_idx"),
models.Index(fields=["id_car_make"], name="car_make_idx"),
models.Index(fields=["id_car_model"], name="car_model_idx"),
models.Index(fields=["id_car_serie"], name="car_serie_idx"),
models.Index(fields=["id_car_trim"], name="car_trim_idx"),
models.Index(
fields=["id_car_make", "id_car_model"], name="car_make_model_idx"
),
models.Index(fields=["id_car_make", "year"], name="car_make_year_idx"),
models.Index(fields=["dealer", "status"], name="car_dealer_status_idx"),
models.Index(fields=["vendor", "status"], name="car_vendor_status_idx"),
models.Index(fields=["year", "status"], name="car_year_status_idx"),
models.Index(
fields=["status"],
name="car_active_status_idx",
condition=Q(status=CarStatusChoices.AVAILABLE),
),
]
def __str__(self):
@ -800,10 +817,12 @@ class Car(Base):
car=self, exterior=exterior, interior=interior
)
self.save()
@property
def logo(self):
return self.id_car_make.logo.url if self.id_car_make.logo else None
class CarTransfer(models.Model):
car = models.ForeignKey(
"Car",
@ -893,10 +912,16 @@ class CarFinance(models.Model):
max_digits=14, decimal_places=2, verbose_name=_("Cost Price")
)
selling_price = models.DecimalField(
max_digits=14, decimal_places=2, verbose_name=_("Selling Price"),default=Decimal("0.00")
max_digits=14,
decimal_places=2,
verbose_name=_("Selling Price"),
default=Decimal("0.00"),
)
marked_price = models.DecimalField(
max_digits=14, decimal_places=2, verbose_name=_("Marked Price"),default=Decimal("0.00")
max_digits=14,
decimal_places=2,
verbose_name=_("Marked Price"),
default=Decimal("0.00"),
)
discount_amount = models.DecimalField(
max_digits=14,
@ -969,11 +994,13 @@ class CarFinance(models.Model):
verbose_name = _("Car Financial Details")
verbose_name_plural = _("Car Financial Details")
indexes = [
models.Index(fields=['car'], name='car_finance_car_idx'),
models.Index(fields=['cost_price'], name='car_finance_cost_price_idx'),
models.Index(fields=['selling_price'], name='car_finance_selling_price_idx'),
models.Index(fields=['marked_price'], name='car_finance_marked_price_idx'),
models.Index(fields=['discount_amount'], name='car_finance_discount_idx'),
models.Index(fields=["car"], name="car_finance_car_idx"),
models.Index(fields=["cost_price"], name="car_finance_cost_price_idx"),
models.Index(
fields=["selling_price"], name="car_finance_selling_price_idx"
),
models.Index(fields=["marked_price"], name="car_finance_marked_price_idx"),
models.Index(fields=["discount_amount"], name="car_finance_discount_idx"),
]
@ -986,8 +1013,8 @@ class ExteriorColors(models.Model, LocalizedNameMixin):
verbose_name = _("Exterior Colors")
verbose_name_plural = _("Exterior Colors")
indexes = [
models.Index(fields=['name'], name='exterior_color_name_idx'),
models.Index(fields=['arabic_name'], name='exterior_color_arabic_name_idx'),
models.Index(fields=["name"], name="exterior_color_name_idx"),
models.Index(fields=["arabic_name"], name="exterior_color_arabic_name_idx"),
]
def __str__(self):
@ -1003,8 +1030,8 @@ class InteriorColors(models.Model, LocalizedNameMixin):
verbose_name = _("Interior Colors")
verbose_name_plural = _("Interior Colors")
indexes = [
models.Index(fields=['name'], name='interior_color_name_idx'),
models.Index(fields=['arabic_name'], name='interior_color_arabic_name_idx'),
models.Index(fields=["name"], name="interior_color_name_idx"),
models.Index(fields=["arabic_name"], name="interior_color_arabic_name_idx"),
]
def __str__(self):
@ -1025,9 +1052,11 @@ class CarColors(models.Model):
verbose_name_plural = _("Colors")
unique_together = ("car", "exterior", "interior")
indexes = [
models.Index(fields=['exterior'], name='car_colors_exterior_idx'),
models.Index(fields=['interior'], name='car_colors_interior_idx'),
models.Index(fields=['exterior', 'interior'], name='car_colors_ext_int_combo_idx'),
models.Index(fields=["exterior"], name="car_colors_exterior_idx"),
models.Index(fields=["interior"], name="car_colors_interior_idx"),
models.Index(
fields=["exterior", "interior"], name="car_colors_ext_int_combo_idx"
),
]
def __str__(self):
@ -1145,7 +1174,11 @@ class Dealer(models.Model, LocalizedNameMixin):
max_length=200, blank=True, null=True, verbose_name=_("Address")
)
logo = models.ImageField(
upload_to="logos/users", blank=True, null=True, verbose_name=_("Logo"),default="logo.png"
upload_to="logos/users",
blank=True,
null=True,
verbose_name=_("Logo"),
default="logo.png",
)
entity = models.ForeignKey(
EntityModel, on_delete=models.SET_NULL, null=True, blank=True
@ -1204,7 +1237,8 @@ class Dealer(models.Model, LocalizedNameMixin):
@property
def vat_rate(self):
return VatRate.objects.get(dealer=self,is_active=True).rate
return VatRate.objects.get(dealer=self, is_active=True).rate
class Meta:
verbose_name = _("Dealer")
verbose_name_plural = _("Dealers")
@ -1245,10 +1279,10 @@ class Staff(models.Model, LocalizedNameMixin):
upload_to="logos/staff", blank=True, null=True, verbose_name=_("Image")
)
thumbnail = ImageSpecField(
source='logo',
source="logo",
processors=[ResizeToFill(40, 40)],
format='WEBP',
options={'quality': 80}
format="WEBP",
options={"quality": 80},
)
active = models.BooleanField(default=True, verbose_name=_("Active"))
created = models.DateTimeField(auto_now_add=True, verbose_name=_("Created"))
@ -1301,13 +1335,15 @@ class Staff(models.Model, LocalizedNameMixin):
@property
def groups(self):
return CustomGroup.objects.select_related("group").filter(pk__in=[x.customgroup.pk for x in self.user.groups.all()])
return CustomGroup.objects.select_related("group").filter(
pk__in=[x.customgroup.pk for x in self.user.groups.all()]
)
def clear_groups(self):
self.remove_superuser_permission()
return self.user.groups.clear()
def add_group(self, group,clean=False):
def add_group(self, group, clean=False):
if clean:
self.clear_groups()
try:
@ -1321,19 +1357,19 @@ class Staff(models.Model, LocalizedNameMixin):
entity = self.dealer.entity
if entity.managers.count() == 0:
entity.managers.add(self.user)
def remove_superuser_permission(self):
entity = self.dealer.entity
if self.user in entity.managers.all():
entity.managers.remove(self.user)
class Meta:
verbose_name = _("Staff")
verbose_name_plural = _("Staff")
indexes = [
models.Index(fields=["name"]),
models.Index(fields=["staff_type"]),
]
]
permissions = []
def __str__(self):
@ -1979,7 +2015,7 @@ class Schedule(models.Model):
dealer = models.ForeignKey(Dealer, on_delete=models.CASCADE)
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
content_object = GenericForeignKey("content_type", "object_id")
customer = models.ForeignKey(
CustomerModel,
on_delete=models.CASCADE,
@ -2156,7 +2192,6 @@ class Opportunity(models.Model):
# scheduled_by=self.request.user
# )
return (
self.lead.get_all_schedules()
.filter(scheduled_at__gt=timezone.now())
.order_by("scheduled_at")
@ -2226,17 +2261,19 @@ class Notes(models.Model):
verbose_name = _("Note")
verbose_name_plural = _("Notes")
indexes = [
models.Index(fields=['dealer'], name='note_dealer_idx'),
models.Index(fields=['created_by'], name='note_created_by_idx'),
models.Index(fields=['content_type'], name='note_content_type_idx'),
models.Index(fields=['content_type', 'object_id'], name='note_content_object_idx'),
models.Index(fields=['created'], name='note_created_date_idx'),
models.Index(fields=['updated'], name='note_updated_date_idx'),
models.Index(fields=['dealer', 'created'], name='note_dealer_created_idx'),
models.Index(fields=['content_type', 'object_id', 'created'],
name='note_content_obj_created_idx'),
models.Index(fields=["dealer"], name="note_dealer_idx"),
models.Index(fields=["created_by"], name="note_created_by_idx"),
models.Index(fields=["content_type"], name="note_content_type_idx"),
models.Index(
fields=["content_type", "object_id"], name="note_content_object_idx"
),
models.Index(fields=["created"], name="note_created_date_idx"),
models.Index(fields=["updated"], name="note_updated_date_idx"),
models.Index(fields=["dealer", "created"], name="note_dealer_created_idx"),
models.Index(
fields=["content_type", "object_id", "created"],
name="note_content_obj_created_idx",
),
]
def __str__(self):
@ -2269,17 +2306,19 @@ class Tasks(models.Model):
verbose_name = _("Task")
verbose_name_plural = _("Tasks")
indexes = [
models.Index(fields=['dealer'], name='task_dealer_idx'),
models.Index(fields=['created_by'], name='task_created_by_idx'),
models.Index(fields=['content_type'], name='task_content_type_idx'),
models.Index(fields=['content_type', 'object_id'], name='task_content_object_idx'),
models.Index(fields=['created'], name='task_created_date_idx'),
models.Index(fields=['updated'], name='task_updated_date_idx'),
models.Index(fields=['dealer', 'created'], name='task_dealer_created_idx'),
models.Index(fields=['content_type', 'object_id', 'created'],
name='task_content_obj_created_idx'),
models.Index(fields=["dealer"], name="task_dealer_idx"),
models.Index(fields=["created_by"], name="task_created_by_idx"),
models.Index(fields=["content_type"], name="task_content_type_idx"),
models.Index(
fields=["content_type", "object_id"], name="task_content_object_idx"
),
models.Index(fields=["created"], name="task_created_date_idx"),
models.Index(fields=["updated"], name="task_updated_date_idx"),
models.Index(fields=["dealer", "created"], name="task_dealer_created_idx"),
models.Index(
fields=["content_type", "object_id", "created"],
name="task_content_obj_created_idx",
),
]
def __str__(self):
@ -2310,15 +2349,17 @@ class Email(models.Model):
verbose_name = _("Email")
verbose_name_plural = _("Emails")
indexes = [
models.Index(fields=['created_by'], name='email_created_by_idx'),
models.Index(fields=['content_type'], name='email_content_type_idx'),
models.Index(fields=['content_type', 'object_id'], name='email_content_object_idx'),
models.Index(fields=['created'], name='email_created_date_idx'),
models.Index(fields=['updated'], name='email_updated_date_idx'),
models.Index(fields=['content_type', 'object_id', 'created'],
name='email_content_obj_created_idx'),
models.Index(fields=["created_by"], name="email_created_by_idx"),
models.Index(fields=["content_type"], name="email_content_type_idx"),
models.Index(
fields=["content_type", "object_id"], name="email_content_object_idx"
),
models.Index(fields=["created"], name="email_created_date_idx"),
models.Index(fields=["updated"], name="email_updated_date_idx"),
models.Index(
fields=["content_type", "object_id", "created"],
name="email_content_obj_created_idx",
),
]
def __str__(self):
@ -2346,15 +2387,17 @@ class Activity(models.Model):
verbose_name = _("Activity")
verbose_name_plural = _("Activities")
indexes = [
models.Index(fields=['created_by'], name='activity_created_by_idx'),
models.Index(fields=['content_type'], name='activity_content_type_idx'),
models.Index(fields=['content_type', 'object_id'], name='activity_content_object_idx'),
models.Index(fields=['created'], name='activity_created_date_idx'),
models.Index(fields=['updated'], name='activity_updated_date_idx'),
models.Index(fields=['content_type', 'object_id', 'created'],
name='a_content_obj_created_idx'),
models.Index(fields=["created_by"], name="activity_created_by_idx"),
models.Index(fields=["content_type"], name="activity_content_type_idx"),
models.Index(
fields=["content_type", "object_id"], name="activity_content_object_idx"
),
models.Index(fields=["created"], name="activity_created_date_idx"),
models.Index(fields=["updated"], name="activity_updated_date_idx"),
models.Index(
fields=["content_type", "object_id", "created"],
name="a_content_obj_created_idx",
),
]
def __str__(self):
@ -2375,9 +2418,9 @@ class Notification(models.Model):
ordering = ["-created"]
indexes = [
models.Index(fields=['user'], name='notification_user_idx'),
models.Index(fields=['is_read'], name='notification_is_read_idx'),
models.Index(fields=['created'], name='notification_created_date_idx'),
models.Index(fields=["user"], name="notification_user_idx"),
models.Index(fields=["is_read"], name="notification_is_read_idx"),
models.Index(fields=["created"], name="notification_created_date_idx"),
]
def __str__(self):
@ -2423,7 +2466,9 @@ class Vendor(models.Model, LocalizedNameMixin):
)
def get_absolute_url(self):
return reverse("vendor_detail", kwargs={"dealer_slug":self.dealer.slug,"slug": self.slug})
return reverse(
"vendor_detail", kwargs={"dealer_slug": self.dealer.slug, "slug": self.slug}
)
def save(self, *args, **kwargs):
if not self.slug:
@ -2444,10 +2489,10 @@ class Vendor(models.Model, LocalizedNameMixin):
verbose_name = _("Vendor")
verbose_name_plural = _("Vendors")
indexes = [
models.Index(fields=['slug'], name='vendor_slug_idx'),
models.Index(fields=['active'], name='vendor_active_idx'),
models.Index(fields=['crn'], name='vendor_crn_idx'),
models.Index(fields=['vrn'], name='vendor_vrn_idx'),
models.Index(fields=["slug"], name="vendor_slug_idx"),
models.Index(fields=["active"], name="vendor_active_idx"),
models.Index(fields=["crn"], name="vendor_crn_idx"),
models.Index(fields=["vrn"], name="vendor_vrn_idx"),
]
def __str__(self):
@ -2762,6 +2807,7 @@ class CustomGroup(models.Model):
group = models.OneToOneField(
"auth.Group", verbose_name=_("Group"), on_delete=models.CASCADE
)
class Meta:
verbose_name = _("Custom Group")
verbose_name_plural = _("Custom Groups")
@ -2808,7 +2854,7 @@ class CustomGroup(models.Model):
######################################
######################################
#MANAGER
# MANAGER
######################################
######################################
if self.name == "Manager":
@ -2855,14 +2901,21 @@ class CustomGroup(models.Model):
"journalentrymodel",
"purchaseordermodel",
"ledgermodel",
"transactionmodel"
"transactionmodel",
],
other_perms=[
"can_approve_estimatemodel",
"can_approve_billmodel",
"can_view_inventory",
"can_view_sales",
"can_view_crm",
"can_view_financials",
"can_view_reports",
],
other_perms=["can_approve_estimatemodel","can_approve_billmodel","can_view_inventory","can_view_sales","can_view_crm","can_view_financials","can_view_reports"],
)
######################################
######################################
#Inventory
# Inventory
######################################
######################################
elif self.name == "Inventory":
@ -2880,7 +2933,7 @@ class CustomGroup(models.Model):
"notes",
"tasks",
"activity",
"poitemsuploaded"
"poitemsuploaded",
],
)
self.set_permissions(
@ -2888,12 +2941,11 @@ class CustomGroup(models.Model):
allowed_models=[],
other_perms=[
"view_purchaseordermodel",
]
],
)
######################################
######################################
#Sales
# Sales
######################################
######################################
elif self.name == "Sales":
@ -2915,8 +2967,7 @@ class CustomGroup(models.Model):
"organization",
"notes",
"tasks",
"lead"
"activity",
"leadactivity",
],
other_perms=[
"view_car",
@ -2935,7 +2986,7 @@ class CustomGroup(models.Model):
)
######################################
######################################
#Accountant
# Accountant
######################################
######################################
elif self.name == "Accountant":
@ -2948,7 +2999,7 @@ class CustomGroup(models.Model):
"activity",
"payment",
"vendor",
],
],
other_perms=[
"view_car",
"view_carlocation",
@ -2959,7 +3010,6 @@ class CustomGroup(models.Model):
"view_leads",
"view_opportunity",
"view_customers",
],
)
self.set_permissions(
@ -2971,18 +3021,28 @@ class CustomGroup(models.Model):
"itemmodel",
"invoicemodel",
"vendormodel",
"journalentrymodel",
"purchaseordermodel",
"estimatemodel",
"customermodel",
"ledgermodel",
"transactionmodel"
"transactionmodel",
],
other_perms=[
"view_billmodel",
"add_billmodel",
"change_billmodel",
"delete_billmodel",
"view_customermodel",
"view_estimatemodel",
"can_view_inventory",
"can_view_sales",
"can_view_crm",
"can_view_financials",
"can_view_reports",
],
other_perms=["view_billmodel","add_billmodel","change_billmodel","delete_billmodel","view_customermodel", "view_estimatemodel","can_view_inventory","can_view_sales","can_view_crm","can_view_financials","can_view_reports"],
)
def set_permissions(self, app="inventory", allowed_models=[], other_perms=[]):
try:
for perm in Permission.objects.filter(
@ -3162,7 +3222,11 @@ class PaymentHistory(models.Model):
class PoItemsUploaded(models.Model):
dealer = models.ForeignKey(Dealer, on_delete=models.CASCADE, null=True, blank=True)
po = models.ForeignKey(
PurchaseOrderModel, on_delete=models.CASCADE, null=True, blank=True, related_name="items"
PurchaseOrderModel,
on_delete=models.CASCADE,
null=True,
blank=True,
related_name="items",
)
item = models.ForeignKey(
ItemTransactionModel,
@ -3182,8 +3246,11 @@ class PoItemsUploaded(models.Model):
models.Index(fields=["po"]),
models.Index(fields=["item"]),
]
def get_name(self):
return self.item.item.name.split('||')
return self.item.item.name.split("||")
class ExtraInfo(models.Model):
"""
Stores additional information for any model with:
@ -3191,20 +3258,19 @@ class ExtraInfo(models.Model):
- JSON data storage
- Tracking fields
"""
dealer = models.ForeignKey(
Dealer,
on_delete=models.SET_NULL,
null=True,
blank=True,
related_name="extra_info"
related_name="extra_info",
)
content_type = models.ForeignKey(
ContentType,
on_delete=models.CASCADE,
related_name="extra_info_primary"
ContentType, on_delete=models.CASCADE, related_name="extra_info_primary"
)
object_id = models.CharField(max_length=255, null=True, blank=True)
content_object = GenericForeignKey('content_type', 'object_id')
content_object = GenericForeignKey("content_type", "object_id")
# Secondary GenericForeignKey (optional additional link)
related_content_type = models.ForeignKey(
@ -3212,41 +3278,32 @@ class ExtraInfo(models.Model):
on_delete=models.SET_NULL,
null=True,
blank=True,
related_name="extra_info_secondary"
related_name="extra_info_secondary",
)
related_object_id = models.CharField(max_length=255, null=True, blank=True)
related_object = GenericForeignKey('related_content_type', 'related_object_id')
related_object = GenericForeignKey("related_content_type", "related_object_id")
# JSON Data Storage
data = models.JSONField(
encoder=DjangoJSONEncoder,
default=dict,
blank=True
)
data = models.JSONField(encoder=DjangoJSONEncoder, default=dict, blank=True)
# Metadata
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(
User,
on_delete=models.SET_NULL,
null=True,
related_name="created_extra_info"
User, on_delete=models.SET_NULL, null=True, related_name="created_extra_info"
)
class Meta:
indexes = [
models.Index(fields=['content_type', 'object_id']),
models.Index(fields=['related_content_type', 'related_object_id']),
models.Index(fields=["content_type", "object_id"]),
models.Index(fields=["related_content_type", "related_object_id"]),
]
verbose_name_plural = _("Extra Info")
verbose_name = _("Extra Info")
def __str__(self):
return f"ExtraInfo for {self.content_object} ({self.content_type})"
@classmethod
def get_sale_orders(cls, staff=None, is_dealer=False):
if not staff and not is_dealer:
@ -3259,16 +3316,23 @@ class ExtraInfo(models.Model):
qs = cls.objects.filter(
content_type=content_type,
related_content_type=related_content_type,
related_object_id__isnull=False
related_object_id__isnull=False,
)
else:
qs = cls.objects.filter(
content_type=content_type,
related_content_type=related_content_type,
related_object_id=staff.pk
related_object_id=staff.pk,
)
# qs = qs.select_related("customer","estimate","invoice")
return [x.content_object.sale_orders.select_related("customer","estimate","invoice").first() for x in qs if x.content_object.sale_orders.first()]
return [
x.content_object.sale_orders.select_related(
"customer", "estimate", "invoice"
).first()
for x in qs
if x.content_object.sale_orders.first()
]
@classmethod
def get_invoices(cls, staff=None, is_dealer=False):
if not staff and not is_dealer:
@ -3281,13 +3345,17 @@ class ExtraInfo(models.Model):
qs = cls.objects.filter(
content_type=content_type,
related_content_type=related_content_type,
related_object_id__isnull=False
related_object_id__isnull=False,
)
else:
qs = cls.objects.filter(
content_type=content_type,
related_content_type=related_content_type,
related_object_id=staff.pk
related_object_id=staff.pk,
)
print(qs[0].content_object.invoicemodel_set.first())
return [x.content_object.invoicemodel_set.first() for x in qs if x.content_object.invoicemodel_set.first()]
return [
x.content_object.invoicemodel_set.first()
for x in qs
if x.content_object.invoicemodel_set.first()
]

View File

@ -1,7 +1,7 @@
import logging
from .models import Dealer
from django.core.exceptions import ImproperlyConfigured,ValidationError
from django.contrib.auth.mixins import LoginRequiredMixin,PermissionRequiredMixin
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin
from django_ledger.forms.bill import (
BillModelCreateForm,
BaseBillModelUpdateForm,
@ -11,7 +11,7 @@ from django_ledger.forms.bill import (
InReviewBillModelUpdateForm,
ApprovedBillModelUpdateForm,
AccruedAndApprovedBillModelUpdateForm,
PaidBillModelUpdateForm
PaidBillModelUpdateForm,
)
from django.http import HttpResponseForbidden
from django.utils.html import format_html
@ -21,13 +21,15 @@ from django.shortcuts import get_object_or_404
from django.urls import reverse
from django_ledger.models import ItemTransactionModel
from django.views.generic.detail import DetailView
from django_ledger.forms.purchase_order import (ApprovedPurchaseOrderModelUpdateForm,
BasePurchaseOrderModelUpdateForm,
DraftPurchaseOrderModelUpdateForm,
ReviewPurchaseOrderModelUpdateForm,
get_po_itemtxs_formset_class)
from django_ledger.forms.purchase_order import (
ApprovedPurchaseOrderModelUpdateForm,
BasePurchaseOrderModelUpdateForm,
DraftPurchaseOrderModelUpdateForm,
ReviewPurchaseOrderModelUpdateForm,
get_po_itemtxs_formset_class,
)
from django_ledger.views.purchase_order import PurchaseOrderModelModelViewQuerySetMixIn
from django_ledger.models import PurchaseOrderModel,EstimateModel,BillModel
from django_ledger.models import PurchaseOrderModel, EstimateModel, BillModel
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.edit import UpdateView
from django.views.generic.base import RedirectView
@ -38,18 +40,17 @@ from django.utils.translation import gettext_lazy as _
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
class PurchaseOrderModelUpdateView(LoginRequiredMixin,
PermissionRequiredMixin,
UpdateView):
slug_url_kwarg = 'po_pk'
slug_field = 'uuid'
context_object_name = 'po_model'
class PurchaseOrderModelUpdateView(
LoginRequiredMixin, PermissionRequiredMixin, UpdateView
):
slug_url_kwarg = "po_pk"
slug_field = "uuid"
context_object_name = "po_model"
template_name = "purchase_orders/po_update.html"
context_object_name = "po_model"
permission_required = "django_ledger.change_purchaseordermodel"
extra_context = {
'header_subtitle_icon': 'uil:bill'
}
extra_context = {"header_subtitle_icon": "uil:bill"}
action_update_items = False
queryset = None
@ -79,10 +80,10 @@ class PurchaseOrderModelUpdateView(LoginRequiredMixin,
dealer = get_object_or_404(Dealer, slug=self.kwargs["dealer_slug"])
if self.queryset is None:
self.queryset = PurchaseOrderModel.objects.for_entity(
entity_slug=self.kwargs['entity_slug'],
user_model=dealer.entity.admin
).select_related('entity', 'ce_model')
entity_slug=self.kwargs["entity_slug"], user_model=dealer.entity.admin
).select_related("entity", "ce_model")
return super().get_queryset()
def get_success_url(self):
return reverse(
"purchase_order_update",
@ -92,6 +93,7 @@ class PurchaseOrderModelUpdateView(LoginRequiredMixin,
"po_pk": self.kwargs["po_pk"],
},
)
def get(self, request, dealer_slug, entity_slug, po_pk, *args, **kwargs):
if self.action_update_items:
return HttpResponseRedirect(
@ -106,7 +108,7 @@ class PurchaseOrderModelUpdateView(LoginRequiredMixin,
)
return super(PurchaseOrderModelUpdateView, self).get(
request, dealer_slug, entity_slug, po_pk, *args, **kwargs
)
)
def post(self, request, dealer_slug, entity_slug, *args, **kwargs):
if self.action_update_items:
@ -199,78 +201,87 @@ class PurchaseOrderModelUpdateView(LoginRequiredMixin,
def get_form_kwargs(self):
if self.action_update_items:
return {
'initial': self.get_initial(),
'prefix': self.get_prefix(),
'instance': self.object
"initial": self.get_initial(),
"prefix": self.get_prefix(),
"instance": self.object,
}
return super(PurchaseOrderModelUpdateView, self).get_form_kwargs()
def get_po_itemtxs_qs(self, po_model: PurchaseOrderModel):
return po_model.itemtransactionmodel_set.select_related('bill_model', 'po_model').order_by('created')
return po_model.itemtransactionmodel_set.select_related(
"bill_model", "po_model"
).order_by("created")
def form_valid(self, form: BasePurchaseOrderModelUpdateForm):
po_model: PurchaseOrderModel = form.save(commit=False)
if form.has_changed():
po_items_qs = ItemTransactionModel.objects.for_po(
entity_slug=self.kwargs['entity_slug'],
entity_slug=self.kwargs["entity_slug"],
user_model=self.request.admin,
po_pk=po_model.uuid,
).select_related('bill_model')
).select_related("bill_model")
if all(['po_status' in form.changed_data,
po_model.po_status == po_model.PO_STATUS_APPROVED]):
po_items_qs.update(po_item_status=ItemTransactionModel.STATUS_NOT_ORDERED)
if 'fulfilled' in form.changed_data:
if all(
[
"po_status" in form.changed_data,
po_model.po_status == po_model.PO_STATUS_APPROVED,
]
):
po_items_qs.update(
po_item_status=ItemTransactionModel.STATUS_NOT_ORDERED
)
if "fulfilled" in form.changed_data:
if not all([i.bill_model for i in po_items_qs]):
messages.add_message(self.request,
messages.ERROR,
f'All PO items must be billed before marking'
f' PO: {po_model.po_number} as fulfilled.',
extra_tags='is-danger')
messages.add_message(
self.request,
messages.ERROR,
f"All PO items must be billed before marking"
f" PO: {po_model.po_number} as fulfilled.",
extra_tags="is-danger",
)
return self.get(self.request)
else:
if not all([i.bill_model.is_paid() for i in po_items_qs]):
messages.add_message(self.request,
messages.SUCCESS,
f'All bills must be paid before marking'
f' PO: {po_model.po_number} as fulfilled.',
extra_tags='is-success')
messages.add_message(
self.request,
messages.SUCCESS,
f"All bills must be paid before marking"
f" PO: {po_model.po_number} as fulfilled.",
extra_tags="is-success",
)
return self.get(self.request)
po_items_qs.update(po_item_status=ItemTransactionModel.STATUS_RECEIVED)
messages.add_message(self.request,
messages.SUCCESS,
f'{self.object.po_number} successfully updated.',
extra_tags='is-success')
messages.add_message(
self.request,
messages.SUCCESS,
f"{self.object.po_number} successfully updated.",
extra_tags="is-success",
)
return super().form_valid(form)
class BasePurchaseOrderActionActionView(LoginRequiredMixin,
PermissionRequiredMixin,
RedirectView,
SingleObjectMixin):
http_method_names = ['get']
pk_url_kwarg = 'po_pk'
class BasePurchaseOrderActionActionView(
LoginRequiredMixin, PermissionRequiredMixin, RedirectView, SingleObjectMixin
):
http_method_names = ["get"]
pk_url_kwarg = "po_pk"
action_name = None
commit = True
permission_required = None
queryset = None
def get_queryset(self):
dealer = get_object_or_404(Dealer, slug=self.kwargs['dealer_slug'])
dealer = get_object_or_404(Dealer, slug=self.kwargs["dealer_slug"])
if self.queryset is None:
self.queryset = PurchaseOrderModel.objects.for_entity(
entity_slug=self.kwargs['entity_slug'],
user_model=dealer.entity.admin
).select_related('entity', 'ce_model')
entity_slug=self.kwargs["entity_slug"], user_model=dealer.entity.admin
).select_related("entity", "ce_model")
return super().get_queryset()
def get_redirect_url(self, dealer_slug, entity_slug, po_pk, *args, **kwargs):
@ -286,7 +297,9 @@ class BasePurchaseOrderActionActionView(LoginRequiredMixin,
def get(self, request, dealer_slug, entity_slug, po_pk, *args, **kwargs):
# kwargs["user_model"] = dealer.entity.admin
# Get user information for logging
user_username = request.user.username if request.user.is_authenticated else 'anonymous'
user_username = (
request.user.username if request.user.is_authenticated else "anonymous"
)
dealer = get_object_or_404(Dealer, slug=dealer_slug)
kwargs["user_model"] = dealer.entity.admin
@ -297,7 +310,7 @@ class BasePurchaseOrderActionActionView(LoginRequiredMixin,
)
po_model: PurchaseOrderModel = self.get_object()
# Log the attempt to perform the action
# Log the attempt to perform the action
logger.debug(
f"User {user_username} attempting to call action '{self.action_name}' "
f"on Purchase Order ID: {po_model.pk} (Entity: {entity_slug})."
@ -315,19 +328,23 @@ class BasePurchaseOrderActionActionView(LoginRequiredMixin,
level=messages.SUCCESS,
)
except ValidationError as e:
# --- Single-line log for ValidationError ---
print(f"User {user_username} encountered a validation error "
# --- Single-line log for ValidationError ---
print(
f"User {user_username} encountered a validation error "
f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. "
f"Error: {e}")
f"Error: {e}"
)
logger.warning(
f"User {user_username} encountered a validation error "
f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. "
f"Error: {e}"
)
except AttributeError as e:
print(f"User {user_username} encountered an AttributeError "
print(
f"User {user_username} encountered an AttributeError "
f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. "
f"Error: {e}")
f"Error: {e}"
)
logger.warning(
f"User {user_username} encountered an AttributeError "
f"while performing action '{self.action_name}' on Purchase Order ID: {po_model.pk}. "
@ -335,48 +352,54 @@ class BasePurchaseOrderActionActionView(LoginRequiredMixin,
)
return response
class BillModelDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailView):
slug_url_kwarg = 'bill_pk'
slug_field = 'uuid'
context_object_name = 'bill'
slug_url_kwarg = "bill_pk"
slug_field = "uuid"
context_object_name = "bill"
template_name = "bill/bill_detail.html"
extra_context = {
'header_subtitle_icon': 'uil:bill',
'hide_menu': True
}
extra_context = {"header_subtitle_icon": "uil:bill", "hide_menu": True}
def get_context_data(self, *, object_list=None, **kwargs):
context = super().get_context_data(object_list=object_list, **kwargs)
context["dealer"] = self.request.dealer
bill_model: BillModel = self.object
title = f'Bill {bill_model.bill_number}'
context['page_title'] = title
context['header_title'] = title
title = f"Bill {bill_model.bill_number}"
context["page_title"] = title
context["header_title"] = title
bill_model: BillModel = self.object
bill_items_qs, item_data = bill_model.get_itemtxs_data()
context['itemtxs_qs'] = bill_items_qs
context['total_amount__sum'] = item_data['total_amount__sum']
context["itemtxs_qs"] = bill_items_qs
context["total_amount__sum"] = item_data["total_amount__sum"]
if not bill_model.is_configured():
link = format_html(f"""
<a href="{reverse("bill-update", kwargs={
'dealer_slug': self.kwargs['dealer_slug'],
'entity_slug': self.kwargs['entity_slug'],
'bill_pk': bill_model.uuid
})}">here</a>
<a href="{
reverse(
"bill-update",
kwargs={
"dealer_slug": self.kwargs["dealer_slug"],
"entity_slug": self.kwargs["entity_slug"],
"bill_pk": bill_model.uuid,
},
)
}">here</a>
""")
msg = f'Bill {bill_model.bill_number} has not been fully set up. ' + \
f'Please update or assign associated accounts {link}.'
messages.add_message(self.request,
message=msg,
level=messages.WARNING,
extra_tags='is-danger')
msg = (
f"Bill {bill_model.bill_number} has not been fully set up. "
+ f"Please update or assign associated accounts {link}."
)
messages.add_message(
self.request,
message=msg,
level=messages.WARNING,
extra_tags="is-danger",
)
return context
def get_queryset(self):
dealer = get_object_or_404(Dealer,slug=self.kwargs['dealer_slug'])
dealer = get_object_or_404(Dealer, slug=self.kwargs["dealer_slug"])
if self.queryset is None:
entity_model = dealer.entity
qs = entity_model.get_bills()
@ -385,54 +408,59 @@ class BillModelDetailView(LoginRequiredMixin, PermissionRequiredMixin, DetailVie
######################################################3
#BILL
# BILL
class BillModelUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateView):
slug_url_kwarg = 'bill_pk'
slug_field = 'uuid'
context_object_name = 'bill_model'
slug_url_kwarg = "bill_pk"
slug_field = "uuid"
context_object_name = "bill_model"
template_name = "bill/bill_update.html"
extra_context = {
'header_subtitle_icon': 'uil:bill'
}
http_method_names = ['get', 'post']
extra_context = {"header_subtitle_icon": "uil:bill"}
http_method_names = ["get", "post"]
action_update_items = False
queryset = None
def get_queryset(self):
dealer = get_object_or_404(Dealer,slug=self.kwargs['dealer_slug'])
dealer = get_object_or_404(Dealer, slug=self.kwargs["dealer_slug"])
if self.queryset is None:
entity_model = dealer.entity
qs = entity_model.get_bills()
self.queryset = qs
return super().get_queryset().select_related(
'ledger',
'ledger__entity',
'vendor',
'cash_account',
'prepaid_account',
'unearned_account',
'cash_account__coa_model',
'prepaid_account__coa_model',
'unearned_account__coa_model'
return (
super()
.get_queryset()
.select_related(
"ledger",
"ledger__entity",
"vendor",
"cash_account",
"prepaid_account",
"unearned_account",
"cash_account__coa_model",
"prepaid_account__coa_model",
"unearned_account__coa_model",
)
)
def get_form(self, form_class=None):
form_class = self.get_form_class()
entity_model = self.request.dealer.entity
if self.request.method == 'POST' and self.action_update_items:
if self.request.method == "POST" and self.action_update_items:
return form_class(
entity_model=entity_model,
user_model=self.request.admin,
instance=self.object
instance=self.object,
)
form = form_class(
entity_model=entity_model,
user_model=self.request.admin,
**self.get_form_kwargs()
**self.get_form_kwargs(),
)
try:
form.initial['amount_paid'] = self.object.get_itemtxs_data()[1]["total_amount__sum"]
form.initial["amount_paid"] = self.object.get_itemtxs_data()[1][
"total_amount__sum"
]
except Exception as e:
print(e)
return form
@ -453,54 +481,57 @@ class BillModelUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateVie
return PaidBillModelUpdateForm
return BaseBillModelUpdateForm
def get_context_data(self,
*,
object_list=None,
itemtxs_formset=None,
**kwargs):
def get_context_data(self, *, object_list=None, itemtxs_formset=None, **kwargs):
context = super().get_context_data(object_list=object_list, **kwargs)
dealer = get_object_or_404(Dealer,slug=self.kwargs['dealer_slug'])
dealer = get_object_or_404(Dealer, slug=self.kwargs["dealer_slug"])
entity_model = dealer.entity
bill_model: BillModel = self.object
ledger_model = bill_model.ledger
title = f'Bill {bill_model.bill_number}'
context['page_title'] = title
context['header_title'] = title
context['header_subtitle'] = bill_model.get_bill_status_display()
title = f"Bill {bill_model.bill_number}"
context["page_title"] = title
context["header_title"] = title
context["header_subtitle"] = bill_model.get_bill_status_display()
if not bill_model.is_configured():
messages.add_message(
request=self.request,
message=f'Bill {bill_model.bill_number} must have all accounts configured.',
message=f"Bill {bill_model.bill_number} must have all accounts configured.",
level=messages.ERROR,
extra_tags='is-danger'
extra_tags="is-danger",
)
if not bill_model.is_paid():
if ledger_model.locked:
messages.add_message(self.request,
messages.ERROR,
f'Warning! This bill is locked. Must unlock before making any changes.',
extra_tags='is-danger')
messages.add_message(
self.request,
messages.ERROR,
f"Warning! This bill is locked. Must unlock before making any changes.",
extra_tags="is-danger",
)
if ledger_model.locked:
messages.add_message(self.request,
messages.ERROR,
f'Warning! This bill is locked. Must unlock before making any changes.',
extra_tags='is-danger')
messages.add_message(
self.request,
messages.ERROR,
f"Warning! This bill is locked. Must unlock before making any changes.",
extra_tags="is-danger",
)
if not ledger_model.is_posted():
messages.add_message(self.request,
messages.INFO,
f'This bill has not been posted. Must post to see ledger changes.',
extra_tags='is-info')
messages.add_message(
self.request,
messages.INFO,
f"This bill has not been posted. Must post to see ledger changes.",
extra_tags="is-info",
)
itemtxs_qs = itemtxs_formset.get_queryset() if itemtxs_formset else None
if not itemtxs_formset:
itemtxs_formset_class = get_bill_itemtxs_formset_class(bill_model)
itemtxs_formset = itemtxs_formset_class(entity_model=entity_model, bill_model=bill_model)
itemtxs_formset = itemtxs_formset_class(
entity_model=entity_model, bill_model=bill_model
)
itemtxs_qs, itemtxs_agg = bill_model.get_itemtxs_data(queryset=itemtxs_qs)
has_po = any(i.po_model_id for i in itemtxs_qs)
@ -509,9 +540,9 @@ class BillModelUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateVie
itemtxs_formset.can_delete = False
itemtxs_formset.has_po = has_po
context['itemtxs_formset'] = itemtxs_formset
context['total_amount__sum'] = itemtxs_agg['total_amount__sum']
context['has_po'] = has_po
context["itemtxs_formset"] = itemtxs_formset
context["total_amount__sum"] = itemtxs_agg["total_amount__sum"]
context["has_po"] = has_po
return context
def get_success_url(self):
@ -523,23 +554,28 @@ class BillModelUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateVie
"bill_pk": self.kwargs["bill_pk"],
},
)
def form_valid(self, form):
form.save(commit=False)
messages.add_message(self.request,
messages.SUCCESS,
f'Bill {self.object.bill_number} successfully updated.',
extra_tags='is-success')
messages.add_message(
self.request,
messages.SUCCESS,
f"Bill {self.object.bill_number} successfully updated.",
extra_tags="is-success",
)
return super().form_valid(form)
def get(self, request,dealer_slug,entity_slug,bill_pk, *args, **kwargs):
def get(self, request, dealer_slug, entity_slug, bill_pk, *args, **kwargs):
if self.action_update_items:
return HttpResponseRedirect(
redirect_to=reverse('bill-update',
kwargs={
'dealer_slug': dealer_slug,
'entity_slug': entity_slug,
'bill_pk': bill_pk
})
redirect_to=reverse(
"bill-update",
kwargs={
"dealer_slug": dealer_slug,
"entity_slug": entity_slug,
"bill_pk": bill_pk,
},
)
)
return super(BillModelUpdateView, self).get(request, *args, **kwargs)
@ -614,10 +650,11 @@ class BillModelUpdateView(LoginRequiredMixin, PermissionRequiredMixin, UpdateVie
)
class BaseBillActionView(LoginRequiredMixin,PermissionRequiredMixin, RedirectView, SingleObjectMixin):
http_method_names = ['get']
pk_url_kwarg = 'bill_pk'
class BaseBillActionView(
LoginRequiredMixin, PermissionRequiredMixin, RedirectView, SingleObjectMixin
):
http_method_names = ["get"]
pk_url_kwarg = "bill_pk"
action_name = None
commit = True
permission_required = "django_ledger.change_billmodel"
@ -631,7 +668,6 @@ class BaseBillActionView(LoginRequiredMixin,PermissionRequiredMixin, RedirectVie
self.queryset = qs
return super().get_queryset()
def get_redirect_url(self, dealer_slug, entity_slug, bill_pk, *args, **kwargs):
return reverse(
"bill-update",
@ -642,58 +678,56 @@ class BaseBillActionView(LoginRequiredMixin,PermissionRequiredMixin, RedirectVie
},
)
def get(self, request, *args, **kwargs):
dealer = get_object_or_404(Dealer, slug=self.kwargs["dealer_slug"])
kwargs['user_model'] = dealer.entity.admin
kwargs["user_model"] = dealer.entity.admin
if not self.action_name:
raise ImproperlyConfigured('View attribute action_name is required.')
raise ImproperlyConfigured("View attribute action_name is required.")
response = super(BaseBillActionView, self).get(request, *args, **kwargs)
bill_model: BillModel = self.get_object()
try:
getattr(bill_model, self.action_name)(commit=self.commit, **kwargs)
except ValidationError as e:
messages.add_message(request,
message=e.message,
level=messages.ERROR,
extra_tags='is-danger')
messages.add_message(
request, message=e.message, level=messages.ERROR, extra_tags="is-danger"
)
return response
class InventoryListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
template_name = 'django_ledger/inventory/inventory_list.html'
context_object_name = 'inventory_list'
http_method_names = ['get']
template_name = "django_ledger/inventory/inventory_list.html"
context_object_name = "inventory_list"
http_method_names = ["get"]
def get_context_data(self, *, object_list=None, **kwargs):
context = super(InventoryListView, self).get_context_data(**kwargs)
qs = self.get_queryset()
# evaluates the queryset...
context['qs_count'] = qs.count()
context["qs_count"] = qs.count()
# ordered inventory...
ordered_qs = qs.is_ordered()
context['inventory_ordered'] = ordered_qs
context["inventory_ordered"] = ordered_qs
# in transit inventory...
in_transit_qs = qs.in_transit()
context['inventory_in_transit'] = in_transit_qs
context["inventory_in_transit"] = in_transit_qs
# on hand inventory...
received_qs = qs.is_received()
context['inventory_received'] = received_qs
context["inventory_received"] = received_qs
context['page_title'] = _('Inventory')
context['header_title'] = _('Inventory Status')
context['header_subtitle'] = _('Ordered/In Transit/On Hand')
context['header_subtitle_icon'] = 'ic:round-inventory'
context["page_title"] = _("Inventory")
context["header_title"] = _("Inventory Status")
context["header_subtitle"] = _("Ordered/In Transit/On Hand")
context["header_subtitle_icon"] = "ic:round-inventory"
return context
def get_queryset(self):
if self.queryset is None:
self.queryset = ItemTransactionModel.objects.inventory_pipeline_aggregate(
entity_slug=self.kwargs['entity_slug'],
entity_slug=self.kwargs["entity_slug"],
)
return super().get_queryset()
return super().get_queryset()

View File

@ -18,16 +18,17 @@ from django_ledger.models import (
AccountModel,
PurchaseOrderModel,
EstimateModel,
BillModel
BillModel,
)
from . import models
from django.utils.timezone import now
from django.db import transaction
from django_q.tasks import async_task
#logging
# logging
import logging
logger=logging.getLogger(__name__)
logger = logging.getLogger(__name__)
User = get_user_model()
@ -94,7 +95,9 @@ def create_car_location(sender, instance, created, **kwargs):
try:
if created:
# Log that the signal was triggered for a new car
logger.debug(f"Post-save signal triggered for new Car (VIN: {instance.vin}). Attempting to create CarLocation.")
logger.debug(
f"Post-save signal triggered for new Car (VIN: {instance.vin}). Attempting to create CarLocation."
)
if instance.dealer is None:
# Log the critical data integrity error before raising
@ -122,7 +125,7 @@ def create_car_location(sender, instance, created, **kwargs):
logger.error(
f"Failed to create CarLocation for car (VIN: {instance.vin}). "
f"An unexpected error occurred: {e}",
exc_info=True
exc_info=True,
)
print(f"Failed to create CarLocation for car {instance.vin}: {e}")
@ -171,7 +174,7 @@ def create_ledger_entity(sender, instance, created, **kwargs):
entity.create_uom(name=u[1], unit_abbr=u[0])
# Create COA accounts, background task
async_task(create_coa_accounts,instance)
async_task(create_coa_accounts, instance)
# create_settings(instance.pk)
# create_accounts_for_make(instance.pk)
@ -195,10 +198,8 @@ def create_dealer_groups(sender, instance, created, **kwargs):
if created:
# async_task("inventory.tasks.create_groups",instance.slug)
def create_groups():
for group_name in ["Inventory", "Accountant", "Sales","Manager"]:
group= Group.objects.create(
name=f"{instance.slug}_{group_name}"
)
for group_name in ["Inventory", "Accountant", "Sales", "Manager"]:
group = Group.objects.create(name=f"{instance.slug}_{group_name}")
group_manager = models.CustomGroup.objects.create(
name=group_name, dealer=instance, group=group
)
@ -553,13 +554,13 @@ def track_lead_status_change(sender, instance, **kwargs):
new_status=instance.status,
changed_by=instance.staff, # Assuming the assigned staff made the change
)
# --- Single-line log for successful status change and history creation ---
# --- Single-line log for successful status change and history creation ---
logger.info(
f"Lead ID: {instance.pk} status changed from '{old_lead.status}' to '{instance.status}'. "
f"LeadStatusHistory recorded by Staff: {instance.staff.username if instance.staff else 'N/A'}."
)
except models.Lead.DoesNotExist:
# --- Single-line log for expected Lead.DoesNotExist (e.g., during initial object creation) ---
# --- Single-line log for expected Lead.DoesNotExist (e.g., during initial object creation) ---
logger.debug(
f"Lead ID: {instance.pk} not found in database when checking for status change. "
f"This might occur during initial object creation. Skipping status history tracking."
@ -760,20 +761,20 @@ def create_dealer_settings(sender, instance, created, **kwargs):
# entity = instance.entity
# coa = entity.get_default_coa()
# for make in models.CarMake.objects.all():
# last_account = entity.get_all_accounts().filter(role=roles.ASSET_CA_RECEIVABLES).order_by('-created').first()
# if len(last_account.code) == 4:
# code = f"{int(last_account.code)}{1:03d}"
# elif len(last_account.code) > 4:
# code = f"{int(last_account.code)+1}"
# entity.create_account(
# name=make.name,
# code=code,
# role=roles.ASSET_CA_RECEIVABLES,
# coa_model=coa,
# balance_type="credit",
# active=True
# )
# for make in models.CarMake.objects.all():
# last_account = entity.get_all_accounts().filter(role=roles.ASSET_CA_RECEIVABLES).order_by('-created').first()
# if len(last_account.code) == 4:
# code = f"{int(last_account.code)}{1:03d}"
# elif len(last_account.code) > 4:
# code = f"{int(last_account.code)+1}"
# entity.create_account(
# name=make.name,
# code=code,
# role=roles.ASSET_CA_RECEIVABLES,
# coa_model=coa,
# balance_type="credit",
# active=True
# )
# @receiver(post_save, sender=VendorModel)
@ -936,28 +937,39 @@ def update_finance_cost(sender, instance, created, **kwargs):
# else:
# save_journal(instance,ledger,vendor)
@receiver(post_save, sender=PurchaseOrderModel)
def create_po_item_upload(sender,instance,created,**kwargs):
def create_po_item_upload(sender, instance, created, **kwargs):
if instance.po_status == "fulfilled":
for item in instance.get_itemtxs_data()[0]:
dealer = models.Dealer.objects.get(entity=instance.entity)
models.PoItemsUploaded.objects.create(dealer=dealer,po=instance, item=item, status="fulfilled")
models.PoItemsUploaded.objects.create(
dealer=dealer, po=instance, item=item, status="fulfilled"
)
@receiver(post_save, sender=models.Staff)
def add_service_to_staff(sender,instance,created,**kwargs):
def add_service_to_staff(sender, instance, created, **kwargs):
if created:
for service in Service.objects.all():
instance.staff_member.services_offered.add(service)
##########################################################
######################Notification########################
##########################################################
@receiver(post_save, sender=PurchaseOrderModel)
def create_po_fulfilled_notification(sender,instance,created,**kwargs):
def create_po_fulfilled_notification(sender, instance, created, **kwargs):
if instance.po_status == "fulfilled":
dealer = models.Dealer.objects.get(entity=instance.entity)
accountants = models.CustomGroup.objects.filter(dealer=dealer,name="Inventory").first().group.user_set.exclude(email=dealer.user.email).distinct()
accountants = (
models.CustomGroup.objects.filter(dealer=dealer, name="Inventory")
.first()
.group.user_set.exclude(email=dealer.user.email)
.distinct()
)
for accountant in accountants:
models.Notification.objects.create(
user=accountant,
@ -967,11 +979,18 @@ def create_po_fulfilled_notification(sender,instance,created,**kwargs):
""",
)
@receiver(post_save, sender=models.Car)
def car_created_notification(sender, instance, created, **kwargs):
if created:
accountants = models.CustomGroup.objects.filter(dealer=instance.dealer,name__in=["Manager","Accountant"]).first().group.user_set.all().distinct()
accountants = (
models.CustomGroup.objects.filter(
dealer=instance.dealer, name__in=["Manager", "Accountant"]
)
.first()
.group.user_set.all()
.distinct()
)
for accountant in accountants:
models.Notification.objects.create(
user=accountant,
@ -982,29 +1001,30 @@ def car_created_notification(sender, instance, created, **kwargs):
)
@receiver(post_save, sender=PurchaseOrderModel)
def po_fullfilled_notification(sender, instance, created, **kwargs):
if instance.is_fulfilled():
dealer = models.Dealer.objects.get(entity=instance.entity)
recipients = User.objects.filter(
groups__customgroup__dealer=instance.dealer,
groups__customgroup__name__in=["Manager", "Inventory"]
groups__customgroup__name__in=["Manager", "Inventory"],
).distinct()
for recipient in recipients:
models.Notification.objects.create(
user=recipient,
message=f"""
New Purchase Order has been added.
<a href="{reverse('purchase_order_detail',kwargs={'dealer_slug':dealer.slug,'pk':instance.pk})}" target="_blank">View</a>
<a href="{reverse("purchase_order_detail", kwargs={"dealer_slug": dealer.slug, "pk": instance.pk})}" target="_blank">View</a>
""",
)
@receiver(post_save, sender=models.Vendor)
def vendor_created_notification(sender, instance, created, **kwargs):
if created:
recipients = User.objects.filter(
groups__customgroup__dealer=instance.dealer,
groups__customgroup__name__in=["Manager", "Inventory"]
groups__customgroup__name__in=["Manager", "Inventory"],
).distinct()
for recipient in recipients:
@ -1015,19 +1035,27 @@ def vendor_created_notification(sender, instance, created, **kwargs):
""",
)
@receiver(post_save, sender=models.SaleOrder)
def sale_order_created_notification(sender, instance, created, **kwargs):
if created:
recipients = models.CustomGroup.objects.filter(dealer=instance.dealer,name="Accountant").first().group.user_set.exclude(email=instance.dealer.user.email).distinct()
recipients = (
models.CustomGroup.objects.filter(dealer=instance.dealer, name="Accountant")
.first()
.group.user_set.exclude(email=instance.dealer.user.email)
.distinct()
)
for recipient in recipients:
models.Notification.objects.create(
user=recipient,
message=f"""
New Sale Order has been added for estimate:{instance.estimate}.
<a href="{reverse('estimate_detail',kwargs={'dealer_slug':instance.dealer.slug,'pk':instance.estimate.pk})}" target="_blank">View</a>
<a href="{reverse("estimate_detail", kwargs={"dealer_slug": instance.dealer.slug, "pk": instance.estimate.pk})}" target="_blank">View</a>
""",
)
@receiver(post_save, sender=models.Lead)
def lead_created_notification(sender, instance, created, **kwargs):
if created:
@ -1036,22 +1064,31 @@ def lead_created_notification(sender, instance, created, **kwargs):
user=instance.staff.user,
message=f"""
New Lead has been added.
<a href="{reverse('lead_detail',kwargs={'dealer_slug':instance.dealer.slug,'slug':instance.slug})}" target="_blank">View</a>
<a href="{reverse("lead_detail", kwargs={"dealer_slug": instance.dealer.slug, "slug": instance.slug})}" target="_blank">View</a>
""",
)
@receiver(post_save, sender=EstimateModel)
def estimate_in_review_notification(sender, instance, created, **kwargs):
if instance.is_review():
dealer = models.Dealer.objects.get(entity=instance.entity)
recipients = models.CustomGroup.objects.filter(dealer=dealer,name="Manager").first().group.user_set.exclude(email=dealer.user.email).distinct()
recipients = (
models.CustomGroup.objects.filter(dealer=dealer, name="Manager")
.first()
.group.user_set.exclude(email=dealer.user.email)
.distinct()
)
for recipient in recipients:
models.Notification.objects.create(
user=recipient,
message=f"""
Estimate {instance.estimate_number} is in review.
Please review and approve it at your earliest convenience.
<a href="{reverse('estimate_detail', kwargs={'dealer_slug': dealer.slug, 'pk': instance.pk})}" target="_blank">View</a>
""")
<a href="{reverse("estimate_detail", kwargs={"dealer_slug": dealer.slug, "pk": instance.pk})}" target="_blank">View</a>
""",
)
@receiver(post_save, sender=EstimateModel)
def estimate_in_approve_notification(sender, instance, created, **kwargs):
@ -1059,46 +1096,58 @@ def estimate_in_approve_notification(sender, instance, created, **kwargs):
dealer = models.Dealer.objects.get(entity=instance.entity)
recipient = models.ExtraInfo.objects.filter(
content_type=ContentType.objects.get_for_model(EstimateModel),
related_content_type=ContentType.objects.get_for_model(models.Staff),
object_id=instance.pk,
).first()
content_type=ContentType.objects.get_for_model(EstimateModel),
related_content_type=ContentType.objects.get_for_model(models.Staff),
object_id=instance.pk,
).first()
models.Notification.objects.create(
user=recipient.related_object.user,
message=f"""
Estimate {instance.estimate_number} has been approved.
<a href="{reverse('estimate_detail', kwargs={'dealer_slug': dealer.slug, 'pk': instance.pk})}" target="_blank">View</a>
"""
)
<a href="{reverse("estimate_detail", kwargs={"dealer_slug": dealer.slug, "pk": instance.pk})}" target="_blank">View</a>
""",
)
@receiver(post_save, sender=BillModel)
def bill_model_in_approve_notification(sender, instance, created, **kwargs):
if instance.is_review():
dealer = models.Dealer.objects.get(entity=instance.ledger.entity)
recipients = models.CustomGroup.objects.filter(dealer=dealer,name="Manager").first().group.user_set.exclude(email=dealer.user.email).distinct()
recipients = (
models.CustomGroup.objects.filter(dealer=dealer, name="Manager")
.first()
.group.user_set.exclude(email=dealer.user.email)
.distinct()
)
for recipient in recipients:
models.Notification.objects.create(
user=recipient,
message=f"""
Bill {instance.bill_number} is in review,please review and approve it
<a href="{reverse('bill-detail', kwargs={'dealer_slug': dealer.slug, 'entity_slug':dealer.entity.slug, 'bill_pk': instance.pk})}" target="_blank">View</a>.
"""
)
<a href="{reverse("bill-detail", kwargs={"dealer_slug": dealer.slug, "entity_slug": dealer.entity.slug, "bill_pk": instance.pk})}" target="_blank">View</a>.
""",
)
@receiver(post_save, sender=BillModel)
def bill_model_after_approve_notification(sender, instance, created, **kwargs):
if instance.is_approved():
dealer = models.Dealer.objects.get(entity=instance.ledger.entity)
recipients = models.CustomGroup.objects.filter(dealer=dealer,name="Accountant").first().group.user_set.exclude(email=dealer.user.email).distinct()
recipients = (
models.CustomGroup.objects.filter(dealer=dealer, name="Accountant")
.first()
.group.user_set.exclude(email=dealer.user.email)
.distinct()
)
for recipient in recipients:
models.Notification.objects.create(
user=recipient,
message=f"""
Bill {instance.bill_number} has been approved.
<a href="{reverse('bill-detail', kwargs={'dealer_slug': dealer.slug, 'entity_slug':dealer.entity.slug, 'bill_pk': instance.pk})}" target="_blank">View</a>.
<a href="{reverse("bill-detail", kwargs={"dealer_slug": dealer.slug, "entity_slug": dealer.entity.slug, "bill_pk": instance.pk})}" target="_blank">View</a>.
please complete the bill payment.
"""
)
""",
)

View File

@ -4,13 +4,14 @@ from django_ledger.io import roles
from django_q.tasks import async_task
from django.core.mail import send_mail
from appointment.models import StaffMember
from django.contrib.auth.models import User,Group, Permission
from django.contrib.auth.models import User, Group, Permission
from inventory.models import DealerSettings, Dealer
from django.utils.translation import gettext_lazy as _
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def create_settings(pk):
instance = Dealer.objects.get(pk=pk)
@ -1126,12 +1127,13 @@ def create_make_accounts(entity, coa, makes, name, role, balance_type):
)
return acc
def send_email(from_, to_, subject, message):
subject = subject
message = message
from_email = from_
recipient_list = [to_]
async_task(send_mail,subject, message, from_email, recipient_list)
async_task(send_mail, subject, message, from_email, recipient_list)
def create_user_dealer(email, password, name, arabic_name, phone, crn, vrn, address):
@ -1174,4 +1176,3 @@ def create_user_dealer(email, password, name, arabic_name, phone, crn, vrn, addr
# instance.user.groups.add(group)
# transaction.on_commit(run)

View File

@ -54,7 +54,6 @@ def period_navigation(context, base_url: str):
kwargs["dealer_slug"] = dealer_slug
kwargs["entity_slug"] = entity_slug
if context["view"].kwargs.get("ledger_pk"):
kwargs["ledger_pk"] = context["view"].kwargs.get("ledger_pk")
@ -103,7 +102,7 @@ def period_navigation(context, base_url: str):
if "coa_slug" in kwargs:
KWARGS_CURRENT_MONTH["coa_slug"] = kwargs["coa_slug"]
ctx["current_month_url"] = reverse(f"{base_url}-month" ,kwargs=KWARGS_CURRENT_MONTH)
ctx["current_month_url"] = reverse(f"{base_url}-month", kwargs=KWARGS_CURRENT_MONTH)
quarter_urls = list()
ctx["quarter"] = context.get("quarter")
@ -454,7 +453,7 @@ def po_item_table1(context, queryset):
@register.inclusion_tag(
"purchase_orders/includes/po_item_formset.html", takes_context=True
)
def po_item_formset_table(context, po_model, itemtxs_formset,user):
def po_item_formset_table(context, po_model, itemtxs_formset, user):
# print(len(itemtxs_formset.forms))
for form in itemtxs_formset.forms:
form.fields["item_model"].queryset = form.fields["item_model"].queryset.filter(
@ -475,8 +474,8 @@ def po_item_formset_table(context, po_model, itemtxs_formset,user):
def bill_item_formset_table(context, item_formset):
for item in item_formset:
if item:
item.initial['quantity'] = item.instance.po_quantity
item.initial['unit_cost'] = item.instance.po_unit_cost
item.initial["quantity"] = item.instance.po_quantity
item.initial["unit_cost"] = item.instance.po_unit_cost
# print(item.instance.po_quantity)
# print(item.instance.po_unit_cost)
# print(item.instance.po_total_amount)
@ -661,7 +660,6 @@ def inventory_table(context, queryset):
return ctx
@register.filter
def count_checked(permissions, group_permission_ids):
"""Count how many permissions are checked from the allowed list"""
@ -669,10 +667,8 @@ def count_checked(permissions, group_permission_ids):
return 0
return sum(1 for perm in permissions if perm.id in group_permission_ids)
# @register.filter
# def count_checked(permissions, group_permission_ids):
# """Count how many permissions are checked from the allowed list"""
# return sum(1 for perm in permissions if perm.id in group_permission_ids)

View File

@ -472,5 +472,3 @@ class AuthenticationTest(TestCase):
# self.assertEqual(finance_data["total_additionals"], Decimal("180"))
# self.assertEqual(finance_data["additionals"][0]["name"], "Service")
# self.assertEqual(finance_data["vat"], Decimal("0.20"))

View File

@ -12,7 +12,6 @@ urlpatterns = [
path("signup/", views.dealer_signup, name="account_signup"),
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'),
@ -20,7 +19,11 @@ urlpatterns = [
# path("user/<int:pk>/settings/", views.UserSettingsView.as_view(), name="user_settings"),
path("<slug:dealer_slug>/pricing/", views.pricing_page, name="pricing_page"),
path("<slug:dealer_slug>/submit_plan/", views.submit_plan, name="submit_plan"),
path("<slug:dealer_slug>/payment-callback/", views.payment_callback, name="payment_callback"),
path(
"<slug:dealer_slug>/payment-callback/",
views.payment_callback,
name="payment_callback",
),
#
path(
"<slug:dealer_slug>/dealers/activity/",
@ -32,7 +35,11 @@ urlpatterns = [
views.DealerSettingsView,
name="dealer_settings",
),
path("<slug:dealer_slug>/dealers/assign-car-makes/", views.assign_car_makes, name="assign_car_makes"),
path(
"<slug:dealer_slug>/dealers/assign-car-makes/",
views.assign_car_makes,
name="assign_car_makes",
),
path(
"dashboards/manager/",
views.ManagerDashboard.as_view(),
@ -59,9 +66,15 @@ urlpatterns = [
# path('dealers/<int:pk>/delete/', views.DealerDeleteView.as_view(), name='dealer_delete'),
# CRM URLs
path(
"<slug:dealer_slug>/customers/create/", views.CustomerCreateView.as_view(), name="customer_create"
"<slug:dealer_slug>/customers/create/",
views.CustomerCreateView.as_view(),
name="customer_create",
),
path(
"<slug:dealer_slug>/customers/",
views.CustomerListView.as_view(),
name="customer_list",
),
path("<slug:dealer_slug>/customers/", views.CustomerListView.as_view(), name="customer_list"),
path(
"<slug:dealer_slug>/customers/<slug:slug>/",
views.CustomerDetailView.as_view(),
@ -78,7 +91,9 @@ urlpatterns = [
name="customer_update",
),
path(
"<slug:dealer_slug>/customers/<slug:slug>/delete/", views.delete_customer, name="customer_delete"
"<slug:dealer_slug>/customers/<slug:slug>/delete/",
views.delete_customer,
name="customer_delete",
),
path(
"<slug:dealer_slug>/customers/<slug:slug>/opportunities/create/",
@ -94,21 +109,39 @@ urlpatterns = [
views.LeadDetailView.as_view(),
name="lead_detail",
),
path("<slug:dealer_slug>/update-lead-actions/", views.update_lead_actions, name="update_lead_actions"),
path("<slug:dealer_slug>/crm/leads/lead_tracking/", views.lead_tracking, name="lead_tracking"),
path(
"<slug:dealer_slug>/update-lead-actions/",
views.update_lead_actions,
name="update_lead_actions",
),
path(
"<slug:dealer_slug>/crm/leads/lead_tracking/",
views.lead_tracking,
name="lead_tracking",
),
path("<slug:dealer_slug>/crm/leads/lead_view/", views.lead_view, name="lead_view"),
path("<slug:dealer_slug>/crm/leads/", views.LeadListView.as_view(), name="lead_list"),
path(
"<slug:dealer_slug>/crm/leads/", views.LeadListView.as_view(), name="lead_list"
),
path(
"<slug:dealer_slug>/crm/leads/<slug:slug>/update/",
views.LeadUpdateView.as_view(),
name="lead_update",
),
path("<slug:dealer_slug>/crm/leads/<slug:slug>/delete/", views.LeadDeleteView, name="lead_delete"),
path(
"<slug:dealer_slug>/crm/leads/<slug:slug>/lead-convert/", views.lead_convert, name="lead_convert"
"<slug:dealer_slug>/crm/leads/<slug:slug>/delete/",
views.LeadDeleteView,
name="lead_delete",
),
path(
"<slug:dealer_slug>/crm/leads/<int:pk>/delete-note/", views.delete_note, name="delete_note_to_lead"
"<slug:dealer_slug>/crm/leads/<slug:slug>/lead-convert/",
views.lead_convert,
name="lead_convert",
),
path(
"<slug:dealer_slug>/crm/leads/<int:pk>/delete-note/",
views.delete_note,
name="delete_note_to_lead",
),
path(
"<slug:dealer_slug>/crm/<int:pk>/update-note/",
@ -216,9 +249,11 @@ urlpatterns = [
# Notifications
path("notifications/stream/", views.sse_stream, name="sse_stream"),
path("notifications/fetch/", views.fetch_notifications, name="fetch_notifications"),
path("notifications/list/", views.NotificationListView.as_view(), name="notifications_history"),
path(
"notifications/list/",
views.NotificationListView.as_view(),
name="notifications_history",
),
path(
"notifications/<int:notification_id>/mark_as_read/",
views.mark_notification_as_read,
@ -235,9 +270,19 @@ urlpatterns = [
#######################################################
# Vendor URLs
#######################################################
path("<slug:dealer_slug>/vendors/create/", views.VendorCreateView.as_view(), name="vendor_create"),
path("<slug:dealer_slug>/vendors", views.VendorListView.as_view(), name="vendor_list"),
path("<slug:dealer_slug>/vendors/<slug:slug>/", views.vendorDetailView, name="vendor_detail"),
path(
"<slug:dealer_slug>/vendors/create/",
views.VendorCreateView.as_view(),
name="vendor_create",
),
path(
"<slug:dealer_slug>/vendors", views.VendorListView.as_view(), name="vendor_list"
),
path(
"<slug:dealer_slug>/vendors/<slug:slug>/",
views.vendorDetailView,
name="vendor_detail",
),
path(
"<slug:dealer_slug>/vendors/<slug:slug>/update/",
views.VendorUpdateView.as_view(),
@ -447,26 +492,99 @@ urlpatterns = [
# ),
# Users URLs
path("<slug:dealer_slug>/user/", views.UserListView.as_view(), name="user_list"),
path("<slug:dealer_slug>/user/create/", views.UserCreateView.as_view(), name="user_create"),
path("<slug:dealer_slug>/user/<slug:slug>/", views.UserDetailView.as_view(), name="user_detail"),
path("<slug:dealer_slug>/user/<slug:slug>/groups/", views.UserGroupView, name="user_groups"),
path("<slug:dealer_slug>/user/<slug:slug>/update/", views.UserUpdateView.as_view(), name="user_update"),
path("<slug:dealer_slug>/user/<slug:slug>/confirm/", views.UserDeleteview, name="user_delete"),
path("<slug:dealer_slug>/group/create/", views.GroupCreateView.as_view(), name="group_create"),
path("<slug:dealer_slug>/group/<int:pk>/update/", views.GroupUpdateView.as_view(), name="group_update"),
path("<slug:dealer_slug>/group/<int:pk>/", views.GroupDetailView.as_view(), name="group_detail"),
path(
"<slug:dealer_slug>/user/create/",
views.UserCreateView.as_view(),
name="user_create",
),
path(
"<slug:dealer_slug>/user/<slug:slug>/",
views.UserDetailView.as_view(),
name="user_detail",
),
path(
"<slug:dealer_slug>/user/<slug:slug>/groups/",
views.UserGroupView,
name="user_groups",
),
path(
"<slug:dealer_slug>/user/<slug:slug>/update/",
views.UserUpdateView.as_view(),
name="user_update",
),
path(
"<slug:dealer_slug>/user/<slug:slug>/confirm/",
views.UserDeleteview,
name="user_delete",
),
path(
"<slug:dealer_slug>/group/create/",
views.GroupCreateView.as_view(),
name="group_create",
),
path(
"<slug:dealer_slug>/group/<int:pk>/update/",
views.GroupUpdateView.as_view(),
name="group_update",
),
path(
"<slug:dealer_slug>/group/<int:pk>/",
views.GroupDetailView.as_view(),
name="group_detail",
),
path("<slug:dealer_slug>/group/", views.GroupListView.as_view(), name="group_list"),
path("<slug:dealer_slug>/group/<int:pk>/confirm/", views.GroupDeleteview, name="group_delete"),
path("<slug:dealer_slug>/group/<int:pk>/permission/", views.GroupPermissionView, name="group_permission"),
path("<slug:dealer_slug>/organizations/create/", views.OrganizationCreateView.as_view(), name="organization_create"),
path("<slug:dealer_slug>/organizations/", views.OrganizationListView.as_view(), name="organization_list"),
path("<slug:dealer_slug>/organizations/<slug:slug>/", views.OrganizationDetailView.as_view(), name="organization_detail"),
path("<slug:dealer_slug>/organizations/<slug:slug>/update/", views.OrganizationUpdateView.as_view(), name="organization_update"),
path("<slug:dealer_slug>/organizations/<slug:slug>/delete/", views.OrganizationDeleteView, name="organization_delete"),
path("representatives/", views.RepresentativeListView.as_view(), name="representative_list"),
path("representatives/<int:pk>/", views.RepresentativeDetailView.as_view(), name="representative_detail"),
path("representatives/create/", views.RepresentativeCreateView.as_view(),name="representative_create"),
path("representatives/<int:pk>/update/",
path(
"<slug:dealer_slug>/group/<int:pk>/confirm/",
views.GroupDeleteview,
name="group_delete",
),
path(
"<slug:dealer_slug>/group/<int:pk>/permission/",
views.GroupPermissionView,
name="group_permission",
),
path(
"<slug:dealer_slug>/organizations/create/",
views.OrganizationCreateView.as_view(),
name="organization_create",
),
path(
"<slug:dealer_slug>/organizations/",
views.OrganizationListView.as_view(),
name="organization_list",
),
path(
"<slug:dealer_slug>/organizations/<slug:slug>/",
views.OrganizationDetailView.as_view(),
name="organization_detail",
),
path(
"<slug:dealer_slug>/organizations/<slug:slug>/update/",
views.OrganizationUpdateView.as_view(),
name="organization_update",
),
path(
"<slug:dealer_slug>/organizations/<slug:slug>/delete/",
views.OrganizationDeleteView,
name="organization_delete",
),
path(
"representatives/",
views.RepresentativeListView.as_view(),
name="representative_list",
),
path(
"representatives/<int:pk>/",
views.RepresentativeDetailView.as_view(),
name="representative_detail",
),
path(
"representatives/create/",
views.RepresentativeCreateView.as_view(),
name="representative_create",
),
path(
"representatives/<int:pk>/update/",
views.RepresentativeUpdateView.as_view(),
name="representative_update",
),
@ -475,9 +593,15 @@ urlpatterns = [
views.RepresentativeDeleteView.as_view(),
name="representative_delete",
),
path("<slug:dealer_slug>/ledgers/<slug:entity_slug>/", views.LedgerModelListView.as_view(), name="ledger_list"),
path(
"<slug:dealer_slug>/ledgers/<slug:entity_slug>/create/", views.LedgerModelCreateView.as_view(), name="ledger_create"
"<slug:dealer_slug>/ledgers/<slug:entity_slug>/",
views.LedgerModelListView.as_view(),
name="ledger_list",
),
path(
"<slug:dealer_slug>/ledgers/<slug:entity_slug>/create/",
views.LedgerModelCreateView.as_view(),
name="ledger_create",
),
path(
"<slug:dealer_slug>/ledgers/<slug:entity_slug>/detail/<uuid:pk>/",
@ -698,7 +822,6 @@ urlpatterns = [
views.update_estimate_additionals,
name="update_estimate_additionals",
),
###############################################
# Invoice
###############################################
@ -771,7 +894,9 @@ urlpatterns = [
# path('sales/journal/<uuid:pk>/create/', views.JournalEntryCreateView.as_view(), name='journal_create'),
# Items
path(
"<slug:dealer_slug>/items/services/", views.ItemServiceListView.as_view(), name="item_service_list"
"<slug:dealer_slug>/items/services/",
views.ItemServiceListView.as_view(),
name="item_service_list",
),
path(
"<slug:dealer_slug>/items/services/create/",
@ -838,7 +963,7 @@ urlpatterns = [
),
############################################################
############################################################
#BILL MARK AS
# BILL MARK AS
path(
"<slug:dealer_slug>/items/bills/<slug:entity_slug>/actions/<uuid:bill_pk>/mark-as-draft/",
views.BillModelActionMarkAsDraftView.as_view(),
@ -884,7 +1009,6 @@ urlpatterns = [
views.BillModelActionForceMigrateView.as_view(),
name="bill-action-force-migrate",
),
# orders
path("orders/", views.OrderListView.as_view(), name="order_list_view"),
# BALANCE SHEET Reports...
@ -1013,7 +1137,11 @@ urlpatterns = [
),
# Admin Management...
path("<slug:dealer_slug>/management/", views.management_view, name="management"),
path("<slug:dealer_slug>/management/user_management/", views.user_management, name="user_management"),
path(
"<slug:dealer_slug>/management/user_management/",
views.user_management,
name="user_management",
),
path(
"<slug:dealer_slug>/management/<str:content_type>/<slug:slug>/activate_account/",
views.activate_account,

View File

@ -27,7 +27,9 @@ from django_ledger.models.transactions import TransactionModel
from django_ledger.models.journal_entry import JournalEntryModel
import logging
logger=logging.getLogger(__name__)
logger = logging.getLogger(__name__)
def make_random_password(
length=10, allowed_chars="abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"
@ -63,15 +65,12 @@ def get_jwt_token():
try:
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
#logging for success
# logging for success
logger.info("Successfully fetched JWT token.")
return response.text
except requests.exceptions.RequestException as e:
#logging for error
logger.error(
f"HTTP error fetching JWT token from {url}: ",
exc_info=True
)
# logging for error
logger.error(f"HTTP error fetching JWT token from {url}: ", exc_info=True)
print(f"Error obtaining JWT token: {e}")
return None
@ -159,7 +158,7 @@ def send_email(from_, to_, subject, message):
message = message
from_email = from_
recipient_list = [to_]
async_task(send_mail,subject, message, from_email, recipient_list)
async_task(send_mail, subject, message, from_email, recipient_list)
def get_user_type(request):
@ -225,7 +224,7 @@ def reserve_car(car, request):
)
car.status = models.CarStatusChoices.RESERVED
car.save()
# --- Logging for Success ---
# --- Logging for Success ---
logger.info(
f"Car {car.pk} ('{car.id_car_make} {car.id_car_model}') reserved successfully "
f"by user {request.user}. "
@ -239,7 +238,7 @@ def reserve_car(car, request):
f"Error reserving car {car.pk} ('{car.id_car_make} {car.id_car_model}') "
f"for user {request.user} . "
f"Error: {e}",
exc_info=True
exc_info=True,
)
messages.error(request, f"Error reserving car: {e}")
@ -1002,10 +1001,14 @@ class CarFinanceCalculator:
self.vat_rate = self._get_vat_rate()
self.item_transactions = self._get_item_transactions()
self.additional_services = self._get_additional_services()
self.extra_info = models.ExtraInfo.objects.get(dealer=self.dealer,content_type=ContentType.objects.get_for_model(model),object_id=model.pk)
self.extra_info = models.ExtraInfo.objects.get(
dealer=self.dealer,
content_type=ContentType.objects.get_for_model(model),
object_id=model.pk,
)
def _get_vat_rate(self):
vat = models.VatRate.objects.filter(dealer=self.dealer,is_active=True).first()
vat = models.VatRate.objects.filter(dealer=self.dealer, is_active=True).first()
if not vat:
raise ObjectDoesNotExist("No active VAT rate found")
return vat.rate
@ -1073,7 +1076,7 @@ class CarFinanceCalculator:
Decimal(x.get("price_")) for x in self._get_additional_services()
)
total_discount = self.extra_info.data.get("discount",0)
total_discount = self.extra_info.data.get("discount", 0)
# total_discount = sum(
# Decimal(
@ -1293,10 +1296,9 @@ def handle_account_process(invoice, amount, finance_data):
logger.debug(f"Set item_model.for_inventory to False for car {car.vin}.")
except Exception as e:
logger.error(
f"Error updating item_model.for_inventory for car {car.vin} (Invoice {invoice.invoice_number}): {e}",
exc_info=True
)
f"Error updating item_model.for_inventory for car {car.vin} (Invoice {invoice.invoice_number}): {e}",
exc_info=True,
)
car.finances.is_sold = True
car.finances.save()
@ -1372,6 +1374,7 @@ def create_make_accounts(dealer):
active=True,
)
def handle_payment(request, order):
url = "https://api.moyasar.com/v1/payments"
callback_url = request.build_absolute_uri(

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,51 @@
// static/js/formSubmitHandler.js
document.addEventListener('DOMContentLoaded', function() {
// Initialize all forms with submit buttons
const forms = document.querySelectorAll('form');
forms.forEach(form => {
const submitBtn = form.querySelector('button[type="submit"]');
if (submitBtn) {
// Store original button HTML
if (!submitBtn.dataset.originalHtml) {
submitBtn.dataset.originalHtml = submitBtn.innerHTML;
}
form.addEventListener('submit', function(e) {
// Only proceed if form is valid
if (form.checkValidity()) {
disableSubmitButton(submitBtn);
}
});
}
});
});
/**
* Disable and show loading state on submit button
* @param {HTMLElement} button - The submit button element
*/
function disableSubmitButton(button) {
button.disabled = true;
button.innerHTML = `
<span class="submit-spinner">
<i class="fas fa-spinner fa-spin me-1"></i>
</span>
<span class="submit-text">${button.dataset.savingText || 'Processing...'}</span>
`;
button.classList.add('submitting');
}
/**
* Reset submit button to original state
* @param {HTMLElement} button - The submit button element
*/
function resetSubmitButton(button) {
if (button.dataset.originalHtml) {
button.innerHTML = button.dataset.originalHtml;
}
button.disabled = false;
button.classList.remove('submitting');
}

View File

@ -45,7 +45,7 @@
}
.form-control, .form-select {
/* text-align: center; */
text-align: center;
display: flex;
align-items: center;
justify-content: center;

2
t1.py
View File

@ -19,4 +19,4 @@ def get_models_for_make():
models = get_models_for_make()
for model in models:
print(model["Model_Name"])
print(model["Model_Name"])

View File

@ -1,35 +1,60 @@
{% load static i18n %}
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Access Forbidden</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'assets/img/favicons/apple-touch-icon.png' %}" />
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'assets/img/favicons/favicon-32x32.png' %}" />
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'assets/img/favicons/favicon-16x16.png' %}" />
<link rel="shortcut icon" type="image/x-icon" href="{% static 'assets/img/favicons/favicon.ico' %}" />
<link rel="manifest" href="{% static 'assets/img/favicons/manifest.json' %}" />
<meta name="msapplication-TileImage" content="{% static 'assets/img/favicons/mstile-150x150.png' %}" />
<meta name="theme-color" content="#ffffff" />
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
<script src="{% static 'assets/js/config.js' %}"></script>
<!-- =============================================== -->
<!-- Stylesheets -->
<!-- =============================================== -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap" rel="stylesheet" />
<link href="{% static 'vendors/simplebar/simplebar.min.css' %}" rel="stylesheet" />
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css" />
<link href="{% static 'assets/css/theme-rtl.min.css' %}" type="text/css" rel="stylesheet" id="style-rtl" />
<link href="{% static 'assets/css/theme.min.css' %}" type="text/css" rel="stylesheet" id="style-default" />
<link href="{% static 'assets/css/user-rtl.min.css' %}" type="text/css" rel="stylesheet" id="user-style-rtl" />
<link href="{% static 'assets/css/user.min.css' %}" type="text/css" rel="stylesheet" id="user-style-default" />
<style>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Access Forbidden</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon"
sizes="180x180"
href="{% static 'assets/img/favicons/apple-touch-icon.png' %}" />
<link rel="icon"
type="image/png"
sizes="32x32"
href="{% static 'assets/img/favicons/favicon-32x32.png' %}" />
<link rel="icon"
type="image/png"
sizes="16x16"
href="{% static 'assets/img/favicons/favicon-16x16.png' %}" />
<link rel="shortcut icon"
type="image/x-icon"
href="{% static 'assets/img/favicons/favicon.ico' %}" />
<link rel="manifest"
href="{% static 'assets/img/favicons/manifest.json' %}" />
<meta name="msapplication-TileImage"
content="{% static 'assets/img/favicons/mstile-150x150.png' %}" />
<meta name="theme-color" content="#ffffff" />
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
<script src="{% static 'assets/js/config.js' %}"></script>
<!-- =============================================== -->
<!-- Stylesheets -->
<!-- =============================================== -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap"
rel="stylesheet" />
<link href="{% static 'vendors/simplebar/simplebar.min.css' %}"
rel="stylesheet" />
<link rel="stylesheet"
href="https://unicons.iconscout.com/release/v4.0.8/css/line.css" />
<link href="{% static 'assets/css/theme-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-rtl" />
<link href="{% static 'assets/css/theme.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-default" />
<link href="{% static 'assets/css/user-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-rtl" />
<link href="{% static 'assets/css/user.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-default" />
<style>
body, html {
height: 100%;
margin: 0;
@ -51,42 +76,48 @@
.text-center {
text-align: center;
}
</style>
</head>
<body>
<main class="main" id="top">
<div class="px-3">
<div class="row min-vh-100 flex-center p-5">
<div class="col-12 col-xl-10 col-xxl-8">
<div class="row justify-content-center align-items-center g-5">
<div class="col-12 col-lg-6 text-center order-lg-1">
<img class="img-fluid w-md-50 w-lg-100 d-light-none" src="{% static 'images/spot-illustrations/dark_403-illustration.png' %}" alt="" width="540" />
</div>
<div class="col-12 col-lg-6 text-center text-lg-start">
<img class="img-fluid mb-6 w-50 w-lg-75 d-dark-none" src="{% static 'images/spot-illustrations/403.png' %}" alt="" />
<h2 class="text-body-secondary fw-bolder mb-3">Access Forbidden!</h2>
<p class="text-body mb-5">
Halt! Thou art endeavouring to trespass upon a realm not granted unto thee.<br class="d-none d-md-block d-lg-none" />granted unto thee.
</p><a class="btn btn-lg btn-phoenix-primary" href="{% url 'home' %}">Go Home</a>
</div>
</style>
</head>
<body>
<main class="main" id="top">
<div class="px-3">
<div class="row min-vh-100 flex-center p-5">
<div class="col-12 col-xl-10 col-xxl-8">
<div class="row justify-content-center align-items-center g-5">
<div class="col-12 col-lg-6 text-center order-lg-1">
<img class="img-fluid w-md-50 w-lg-100 d-light-none"
src="{% static 'images/spot-illustrations/dark_403-illustration.png' %}"
alt=""
width="540" />
</div>
<div class="col-12 col-lg-6 text-center text-lg-start">
<img class="img-fluid mb-6 w-50 w-lg-75 d-dark-none"
src="{% static 'images/spot-illustrations/403.png' %}"
alt="" />
<h2 class="text-body-secondary fw-bolder mb-3">Access Forbidden!</h2>
<p class="text-body mb-5">
Halt! Thou art endeavouring to trespass upon a realm not granted unto thee.
<br class="d-none d-md-block d-lg-none" />
granted unto thee.
</p>
<a class="btn btn-lg btn-phoenix-primary" href="{% url 'home' %}">Go Home</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'js/phoenix.js' %}"></script>
<script src="{% static 'vendors/popper/popper.min.js' %}"></script>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'vendors/anchorjs/anchor.min.js' %}"></script>
<script src="{% static 'vendors/is/is.min.js' %}"></script>
<script src="{% static 'vendors/fontawesome/all.min.js' %}"></script>
<script src="{% static 'vendors/lodash/lodash.min.js' %}"></script>
<script src="{% static 'vendors/list.js/list.min.js' %}"></script>
<script src="{% static 'vendors/feather-icons/feather.min.js' %}"></script>
<script src="{% static 'vendors/dayjs/dayjs.min.js' %}"></script>
<script src="{% static 'assets/js/phoenix.js' %}"></script>
</body>
</html>
</main>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'js/phoenix.js' %}"></script>
<script src="{% static 'vendors/popper/popper.min.js' %}"></script>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'vendors/anchorjs/anchor.min.js' %}"></script>
<script src="{% static 'vendors/is/is.min.js' %}"></script>
<script src="{% static 'vendors/fontawesome/all.min.js' %}"></script>
<script src="{% static 'vendors/lodash/lodash.min.js' %}"></script>
<script src="{% static 'vendors/list.js/list.min.js' %}"></script>
<script src="{% static 'vendors/feather-icons/feather.min.js' %}"></script>
<script src="{% static 'vendors/dayjs/dayjs.min.js' %}"></script>
<script src="{% static 'assets/js/phoenix.js' %}"></script>
</body>
</html>

View File

@ -1,35 +1,60 @@
{% load static i18n %}
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Access Forbidden</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'assets/img/favicons/apple-touch-icon.png' %}" />
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'assets/img/favicons/favicon-32x32.png' %}" />
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'assets/img/favicons/favicon-16x16.png' %}" />
<link rel="shortcut icon" type="image/x-icon" href="{% static 'assets/img/favicons/favicon.ico' %}" />
<link rel="manifest" href="{% static 'assets/img/favicons/manifest.json' %}" />
<meta name="msapplication-TileImage" content="{% static 'assets/img/favicons/mstile-150x150.png' %}" />
<meta name="theme-color" content="#ffffff" />
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
<script src="{% static 'assets/js/config.js' %}"></script>
<!-- =============================================== -->
<!-- Stylesheets -->
<!-- =============================================== -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap" rel="stylesheet" />
<link href="{% static 'vendors/simplebar/simplebar.min.css' %}" rel="stylesheet" />
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css" />
<link href="{% static 'assets/css/theme-rtl.min.css' %}" type="text/css" rel="stylesheet" id="style-rtl" />
<link href="{% static 'assets/css/theme.min.css' %}" type="text/css" rel="stylesheet" id="style-default" />
<link href="{% static 'assets/css/user-rtl.min.css' %}" type="text/css" rel="stylesheet" id="user-style-rtl" />
<link href="{% static 'assets/css/user.min.css' %}" type="text/css" rel="stylesheet" id="user-style-default" />
<style>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Access Forbidden</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon"
sizes="180x180"
href="{% static 'assets/img/favicons/apple-touch-icon.png' %}" />
<link rel="icon"
type="image/png"
sizes="32x32"
href="{% static 'assets/img/favicons/favicon-32x32.png' %}" />
<link rel="icon"
type="image/png"
sizes="16x16"
href="{% static 'assets/img/favicons/favicon-16x16.png' %}" />
<link rel="shortcut icon"
type="image/x-icon"
href="{% static 'assets/img/favicons/favicon.ico' %}" />
<link rel="manifest"
href="{% static 'assets/img/favicons/manifest.json' %}" />
<meta name="msapplication-TileImage"
content="{% static 'assets/img/favicons/mstile-150x150.png' %}" />
<meta name="theme-color" content="#ffffff" />
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
<script src="{% static 'assets/js/config.js' %}"></script>
<!-- =============================================== -->
<!-- Stylesheets -->
<!-- =============================================== -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap"
rel="stylesheet" />
<link href="{% static 'vendors/simplebar/simplebar.min.css' %}"
rel="stylesheet" />
<link rel="stylesheet"
href="https://unicons.iconscout.com/release/v4.0.8/css/line.css" />
<link href="{% static 'assets/css/theme-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-rtl" />
<link href="{% static 'assets/css/theme.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-default" />
<link href="{% static 'assets/css/user-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-rtl" />
<link href="{% static 'assets/css/user.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-default" />
<style>
body, html {
height: 100%;
margin: 0;
@ -51,40 +76,48 @@
.text-center {
text-align: center;
}
</style>
</head>
<body>
<main class="main" id="top">
<div class="px-3">
<div class="row min-vh-100 flex-center p-5">
<div class="col-12 col-xl-10 col-xxl-8">
<div class="row justify-content-center align-items-center g-5">
<div class="col-12 col-lg-6 text-center order-lg-1">
<img class="img-fluid w-md-50 w-lg-100 d-light-none" src="{% static 'images/spot-illustrations/dark_500-illustration.png' %}" alt="" width="540" />
</div>
<div class="col-12 col-lg-6 text-center text-lg-start">
<img class="img-fluid mb-6 w-50 w-lg-75 d-dark-none" src="{% static 'images/spot-illustrations/500.png' %}" alt="" />
<h2 class="text-body-secondary fw-bolder mb-3">Page Missing!</h2>
<p class="text-body mb-5">But no worries! Our ostrich is looking everywhere <br class="d-none d-sm-block" />while you wait safely. </p><a class="btn btn-lg btn-phoenix-primary" href="{% url 'home' %}">Go Home</a>
</div>
</style>
</head>
<body>
<main class="main" id="top">
<div class="px-3">
<div class="row min-vh-100 flex-center p-5">
<div class="col-12 col-xl-10 col-xxl-8">
<div class="row justify-content-center align-items-center g-5">
<div class="col-12 col-lg-6 text-center order-lg-1">
<img class="img-fluid w-md-50 w-lg-100 d-light-none"
src="{% static 'images/spot-illustrations/dark_500-illustration.png' %}"
alt=""
width="540" />
</div>
<div class="col-12 col-lg-6 text-center text-lg-start">
<img class="img-fluid mb-6 w-50 w-lg-75 d-dark-none"
src="{% static 'images/spot-illustrations/500.png' %}"
alt="" />
<h2 class="text-body-secondary fw-bolder mb-3">Page Missing!</h2>
<p class="text-body mb-5">
But no worries! Our ostrich is looking everywhere
<br class="d-none d-sm-block" />
while you wait safely.
</p>
<a class="btn btn-lg btn-phoenix-primary" href="{% url 'home' %}">Go Home</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'js/phoenix.js' %}"></script>
<script src="{% static 'vendors/popper/popper.min.js' %}"></script>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'vendors/anchorjs/anchor.min.js' %}"></script>
<script src="{% static 'vendors/is/is.min.js' %}"></script>
<script src="{% static 'vendors/fontawesome/all.min.js' %}"></script>
<script src="{% static 'vendors/lodash/lodash.min.js' %}"></script>
<script src="{% static 'vendors/list.js/list.min.js' %}"></script>
<script src="{% static 'vendors/feather-icons/feather.min.js' %}"></script>
<script src="{% static 'vendors/dayjs/dayjs.min.js' %}"></script>
<script src="{% static 'assets/js/phoenix.js' %}"></script>
</body>
</html>
</main>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'js/phoenix.js' %}"></script>
<script src="{% static 'vendors/popper/popper.min.js' %}"></script>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'vendors/anchorjs/anchor.min.js' %}"></script>
<script src="{% static 'vendors/is/is.min.js' %}"></script>
<script src="{% static 'vendors/fontawesome/all.min.js' %}"></script>
<script src="{% static 'vendors/lodash/lodash.min.js' %}"></script>
<script src="{% static 'vendors/list.js/list.min.js' %}"></script>
<script src="{% static 'vendors/feather-icons/feather.min.js' %}"></script>
<script src="{% static 'vendors/dayjs/dayjs.min.js' %}"></script>
<script src="{% static 'assets/js/phoenix.js' %}"></script>
</body>
</html>

View File

@ -1,35 +1,60 @@
{% load static i18n %}
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Access Forbidden</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'assets/img/favicons/apple-touch-icon.png' %}" />
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'assets/img/favicons/favicon-32x32.png' %}" />
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'assets/img/favicons/favicon-16x16.png' %}" />
<link rel="shortcut icon" type="image/x-icon" href="{% static 'assets/img/favicons/favicon.ico' %}" />
<link rel="manifest" href="{% static 'assets/img/favicons/manifest.json' %}" />
<meta name="msapplication-TileImage" content="{% static 'assets/img/favicons/mstile-150x150.png' %}" />
<meta name="theme-color" content="#ffffff" />
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
<script src="{% static 'assets/js/config.js' %}"></script>
<!-- =============================================== -->
<!-- Stylesheets -->
<!-- =============================================== -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap" rel="stylesheet" />
<link href="{% static 'vendors/simplebar/simplebar.min.css' %}" rel="stylesheet" />
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css" />
<link href="{% static 'assets/css/theme-rtl.min.css' %}" type="text/css" rel="stylesheet" id="style-rtl" />
<link href="{% static 'assets/css/theme.min.css' %}" type="text/css" rel="stylesheet" id="style-default" />
<link href="{% static 'assets/css/user-rtl.min.css' %}" type="text/css" rel="stylesheet" id="user-style-rtl" />
<link href="{% static 'assets/css/user.min.css' %}" type="text/css" rel="stylesheet" id="user-style-default" />
<style>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Access Forbidden</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon"
sizes="180x180"
href="{% static 'assets/img/favicons/apple-touch-icon.png' %}" />
<link rel="icon"
type="image/png"
sizes="32x32"
href="{% static 'assets/img/favicons/favicon-32x32.png' %}" />
<link rel="icon"
type="image/png"
sizes="16x16"
href="{% static 'assets/img/favicons/favicon-16x16.png' %}" />
<link rel="shortcut icon"
type="image/x-icon"
href="{% static 'assets/img/favicons/favicon.ico' %}" />
<link rel="manifest"
href="{% static 'assets/img/favicons/manifest.json' %}" />
<meta name="msapplication-TileImage"
content="{% static 'assets/img/favicons/mstile-150x150.png' %}" />
<meta name="theme-color" content="#ffffff" />
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
<script src="{% static 'assets/js/config.js' %}"></script>
<!-- =============================================== -->
<!-- Stylesheets -->
<!-- =============================================== -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="" />
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap"
rel="stylesheet" />
<link href="{% static 'vendors/simplebar/simplebar.min.css' %}"
rel="stylesheet" />
<link rel="stylesheet"
href="https://unicons.iconscout.com/release/v4.0.8/css/line.css" />
<link href="{% static 'assets/css/theme-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-rtl" />
<link href="{% static 'assets/css/theme.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-default" />
<link href="{% static 'assets/css/user-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-rtl" />
<link href="{% static 'assets/css/user.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-default" />
<style>
body, html {
height: 100%;
margin: 0;
@ -51,40 +76,44 @@
.text-center {
text-align: center;
}
</style>
</head>
<body>
<main class="main" id="top">
<div class="px-3">
<div class="row min-vh-100 flex-center p-5">
<div class="col-12 col-xl-10 col-xxl-8">
<div class="row justify-content-center align-items-center g-5">
<div class="col-12 col-lg-6 text-center order-lg-1">
<img class="img-fluid w-md-50 w-lg-100 d-light-none" src="{% static 'images/spot-illustrations/dark_404-illustration.png' %}" alt="" width="540" />
</div>
<div class="col-12 col-lg-6 text-center text-lg-start">
<img class="img-fluid mb-6 w-50 w-lg-75 d-dark-none" src="{% static 'images/spot-illustrations/404.png' %}" alt="" />
<h2 class="text-body-secondary fw-bolder mb-3">Unknow error!</h2>
<p class="text-body mb-5">But relax! Our cat is here to play you some music.</p><a class="btn btn-lg btn-phoenix-primary" href="{% url 'home' %}">Go Home</a>
</div>
</style>
</head>
<body>
<main class="main" id="top">
<div class="px-3">
<div class="row min-vh-100 flex-center p-5">
<div class="col-12 col-xl-10 col-xxl-8">
<div class="row justify-content-center align-items-center g-5">
<div class="col-12 col-lg-6 text-center order-lg-1">
<img class="img-fluid w-md-50 w-lg-100 d-light-none"
src="{% static 'images/spot-illustrations/dark_404-illustration.png' %}"
alt=""
width="540" />
</div>
<div class="col-12 col-lg-6 text-center text-lg-start">
<img class="img-fluid mb-6 w-50 w-lg-75 d-dark-none"
src="{% static 'images/spot-illustrations/404.png' %}"
alt="" />
<h2 class="text-body-secondary fw-bolder mb-3">Unknow error!</h2>
<p class="text-body mb-5">But relax! Our cat is here to play you some music.</p>
<a class="btn btn-lg btn-phoenix-primary" href="{% url 'home' %}">Go Home</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'js/phoenix.js' %}"></script>
<script src="{% static 'vendors/popper/popper.min.js' %}"></script>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'vendors/anchorjs/anchor.min.js' %}"></script>
<script src="{% static 'vendors/is/is.min.js' %}"></script>
<script src="{% static 'vendors/fontawesome/all.min.js' %}"></script>
<script src="{% static 'vendors/lodash/lodash.min.js' %}"></script>
<script src="{% static 'vendors/list.js/list.min.js' %}"></script>
<script src="{% static 'vendors/feather-icons/feather.min.js' %}"></script>
<script src="{% static 'vendors/dayjs/dayjs.min.js' %}"></script>
<script src="{% static 'assets/js/phoenix.js' %}"></script>
</body>
</html>
</main>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'js/phoenix.js' %}"></script>
<script src="{% static 'vendors/popper/popper.min.js' %}"></script>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'vendors/anchorjs/anchor.min.js' %}"></script>
<script src="{% static 'vendors/is/is.min.js' %}"></script>
<script src="{% static 'vendors/fontawesome/all.min.js' %}"></script>
<script src="{% static 'vendors/lodash/lodash.min.js' %}"></script>
<script src="{% static 'vendors/list.js/list.min.js' %}"></script>
<script src="{% static 'vendors/feather-icons/feather.min.js' %}"></script>
<script src="{% static 'vendors/dayjs/dayjs.min.js' %}"></script>
<script src="{% static 'assets/js/phoenix.js' %}"></script>
</body>
</html>

View File

@ -6,9 +6,9 @@
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% translate "Account Inactive" %}
{% endelement %}
{% element p %}
{% translate "This account is inactive." %}
{% endelement %}
{% translate "Account Inactive" %}
{% endelement %}
{% element p %}
{% translate "This account is inactive." %}
{% endelement %}
{% endblock content %}

View File

@ -6,43 +6,43 @@
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% translate "Enter Email Verification Code" %}
{% endelement %}
{% setvar email_link %}
<a href="mailto:{{ email }}">{{ email }}</a>
{% endsetvar %}
{% element p %}
{% blocktranslate %}Weve sent a code to {{ email_link }}. The code expires shortly, so please enter it soon.{% endblocktranslate %}
{% endelement %}
{% url 'account_email_verification_sent' as action_url %}
{% element form form=form method="post" action=action_url tags="entrance,email,verification" %}
{% slot body %}
{% csrf_token %}
{% element fields form=form unlabeled=True %}
{% endelement %}
{{ redirect_field }}
{% endslot %}
{% slot actions %}
{% element button type="submit" tags="prominent,confirm" %}
{% translate "Confirm" %}
{% endelement %}
{% if cancel_url %}
{% element button href=cancel_url tags="link,cancel" %}
{% translate "Cancel" %}
{% endelement %}
{% else %}
{% element button type="submit" form="logout-from-stage" tags="link,cancel" %}
{% translate "Cancel" %}
{% endelement %}
{% endif %}
{% endslot %}
{% endelement %}
{% if not cancel_url %}
<form id="logout-from-stage"
method="post"
action="{% url 'account_logout' %}">
<input type="hidden" name="next" value="{% url 'account_login' %}">
{% csrf_token %}
</form>
{% endif %}
{% translate "Enter Email Verification Code" %}
{% endelement %}
{% setvar email_link %}
<a href="mailto:{{ email }}">{{ email }}</a>
{% endsetvar %}
{% element p %}
{% blocktranslate %}Weve sent a code to {{ email_link }}. The code expires shortly, so please enter it soon.{% endblocktranslate %}
{% endelement %}
{% url 'account_email_verification_sent' as action_url %}
{% element form form=form method="post" action=action_url tags="entrance,email,verification" %}
{% slot body %}
{% csrf_token %}
{% element fields form=form unlabeled=True %}
{% endelement %}
{{ redirect_field }}
{% endslot %}
{% slot actions %}
{% element button type="submit" tags="prominent,confirm" %}
{% translate "Confirm" %}
{% endelement %}
{% if cancel_url %}
{% element button href=cancel_url tags="link,cancel" %}
{% translate "Cancel" %}
{% endelement %}
{% else %}
{% element button type="submit" form="logout-from-stage" tags="link,cancel" %}
{% translate "Cancel" %}
{% endelement %}
{% endif %}
{% endslot %}
{% endelement %}
{% if not cancel_url %}
<form id="logout-from-stage"
method="post"
action="{% url 'account_logout' %}">
<input type="hidden" name="next" value="{% url 'account_login' %}">
{% csrf_token %}
</form>
{% endif %}
{% endblock content %}

View File

@ -1,6 +1,5 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load i18n %}
{% load allauth account %}
{% block head_title %}
@ -10,40 +9,49 @@
<div class="row ">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
<div class="text-center">
<h3 class="mb-4">{% translate "Enter Sign-In Code" %}</h3>
</div>
{% setvar email_link %}
<a href="mailto:{{ email }}">{{ email }}</a>
{% endsetvar %}
<p>
{% blocktranslate %}Weve sent a code to {{ email_link }}. The code expires shortly, so please enter it soon.{% endblocktranslate %}
</p>
<form method="post" action="{% url 'account_confirm_login_code' %}" class="form needs-validation" novalidate>
{% csrf_token %}
{{ redirect_field }}
{{ form|crispy }}
<button type="submit" class="btn btn-phoenix-primary btn-sm w-100">{% trans "Sign In" %}</button>
</form>
{% element button type="submit" form="logout-from-stage" tags="link" %}
{% translate "Cancel" %}
{% endelement %}
<form id="logout-from-stage"
method="post"
action="{% url 'account_logout' %}">
<input type="hidden" name="next" value="{% url 'account_login' %}">
{% csrf_token %}
</form>
</div>
</div>
<a href="mailto:{{ email }}">{{ email }}</a>
{% endsetvar %}
<p>
{% blocktranslate %}Weve sent a code to {{ email_link }}. The code expires shortly, so please enter it soon.{% endblocktranslate %}
</p>
<form method="post"
action="{% url 'account_confirm_login_code' %}"
class="form needs-validation"
novalidate>
{% csrf_token %}
{{ redirect_field }}
{{ form|crispy }}
<button type="submit" class="btn btn-phoenix-primary btn-sm w-100">{% trans "Sign In" %}</button>
</form>
{% element button type="submit" form="logout-from-stage" tags="link" %}
{% translate "Cancel" %}
{% endelement %}
<form id="logout-from-stage"
method="post"
action="{% url 'account_logout' %}">
<input type="hidden" name="next" value="{% url 'account_login' %}">
{% csrf_token %}
</form>
</div>
</div>
</div>
{% endblock content %}

View File

@ -8,22 +8,26 @@
<div class="row ">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
<div class="text-center">
<h3 class="mb-4">{% trans "Email Addresses" %}</h3>
</div>
{% if emailaddresses %}
<p>
{% trans 'The following email addresses are associated with your account:' %}
</p>
<p>{% trans 'The following email addresses are associated with your account:' %}</p>
{% url 'account_email' as email_url %}
<form action="{{ email_url }}" method="POST" class="form email list">
{% csrf_token %}
@ -31,7 +35,12 @@
{% for radio in emailaddress_radios %}
{% with emailaddress=radio.emailaddress %}
<label for="{{ radio.id }}">
<input type="radio" name="email" checked="{{ radio.checked }}" value="{{ emailaddress.email }}" id="{{ radio.id }}" class="form-check-input mb-3" />
<input type="radio"
name="email"
checked="{{ radio.checked }}"
value="{{ emailaddress.email }}"
id="{{ radio.id }}"
class="form-check-input mb-3" />
{{ emailaddress.email }}
{% if emailaddress.verified %}
<span class="badge badge-phoenix badge-phoenix-success verified">{% translate "Verified" %}</span>
@ -41,36 +50,38 @@
{% if emailaddress.primary %}
<span class="badge badge-phoenix badge-phoenix-primary email">{% translate "Primary" %}</span>
{% endif %}
{% endwith %}
{% endwith %}
</label>
{% endfor %}
</div>
<div class="mt-2 mb-6">
<button type="submit" name="action_primary" class="btn btn-sm btn-phoenix-primary">{% trans 'Make Primary' %}</button>
<button type="submit" name="action_send" class="btn btn-sm btn-phoenix-secondary">{% trans 'Re-send Verification' %}</button>
<button type="submit" name="action_remove" class="btn btn-sm btn-phoenix-danger delete">{% trans 'Remove' %}</button>
<button type="submit"
name="action_primary"
class="btn btn-sm btn-phoenix-primary">{% trans 'Make Primary' %}</button>
<button type="submit"
name="action_send"
class="btn btn-sm btn-phoenix-secondary">
{% trans 'Re-send Verification' %}
</button>
<button type="submit"
name="action_remove"
class="btn btn-sm btn-phoenix-danger delete">{% trans 'Remove' %}</button>
</div>
</form>
{% else %}
{% include "account/snippets/warn_no_email.html" %}
{% endif %}
{% if can_add_email %}
<p class="fs-8 fw-bold text-start">
{% trans "Add Email Address" %}
</p>
<p class="fs-8 fw-bold text-start">{% trans "Add Email Address" %}</p>
{% url 'account_email' as action_url %}
<form action="{{ action_url }}" method="POST" class="form email add">
{% csrf_token %}
{{ form|crispy }}
<button class="btn btn-sm btn-phoenix-success w-100" type="submit" name="action_add">
{% trans "Add Email" %}
</button>
<button class="btn btn-sm btn-phoenix-success w-100"
type="submit"
name="action_add">{% trans "Add Email" %}</button>
</form>
{% endif %}
<script>
(function() {
var message = "{% trans 'Do you really want to remove the selected email address?' %}";

View File

@ -6,63 +6,63 @@
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Email Address" %}
{% endelement %}
{% if not emailaddresses %}
{% include "account/snippets/warn_no_email.html" %}
{% endif %}
{% url 'account_email' as action_url %}
{% element form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{% if current_emailaddress %}
{% element field id="current_email" disabled=True type="email" value=current_emailaddress.email %}
{% slot label %}
{% translate "Current email" %}:
{% endslot %}
{% endelement %}
{% endif %}
{% if new_emailaddress %}
{% element field id="new_email" value=new_emailaddress.email disabled=True type="email" %}
{% slot label %}
{% if not current_emailaddress %}
{% translate "Current email" %}:
{% else %}
{% translate "Changing to" %}:
{% endif %}
{% endslot %}
{% slot help_text %}
{% blocktranslate %}Your email address is still pending verification.{% endblocktranslate %}
{% element button form="pending-email" type="submit" name="action_send" tags="minor,secondary" %}
{% trans 'Re-send Verification' %}
{% endelement %}
{% if current_emailaddress %}
{% element button form="pending-email" type="submit" name="action_remove" tags="danger,minor" %}
{% trans 'Cancel Change' %}
{% endelement %}
{% endif %}
{% endslot %}
{% endelement %}
{% endif %}
{% element field id=form.email.auto_id name="email" value=form.email.value errors=form.email.errors type="email" %}
{% slot label %}
{% translate "Change to" %}:
{% endslot %}
{% endelement %}
{% endslot %}
{% slot actions %}
{% element button name="action_add" type="submit" %}
{% trans "Change Email" %}
{% endelement %}
{% endslot %}
{% endelement %}
{% if new_emailaddress %}
<form style="display: none"
id="pending-email"
method="post"
action="{% url 'account_email' %}">
{% csrf_token %}
<input type="hidden" name="email" value="{{ new_emailaddress.email }}">
</form>
{% trans "Email Address" %}
{% endelement %}
{% if not emailaddresses %}
{% include "account/snippets/warn_no_email.html" %}
{% endif %}
{% url 'account_email' as action_url %}
{% element form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{% if current_emailaddress %}
{% element field id="current_email" disabled=True type="email" value=current_emailaddress.email %}
{% slot label %}
{% translate "Current email" %}:
{% endslot %}
{% endelement %}
{% endif %}
{% if new_emailaddress %}
{% element field id="new_email" value=new_emailaddress.email disabled=True type="email" %}
{% slot label %}
{% if not current_emailaddress %}
{% translate "Current email" %}:
{% else %}
{% translate "Changing to" %}:
{% endif %}
{% endslot %}
{% slot help_text %}
{% blocktranslate %}Your email address is still pending verification.{% endblocktranslate %}
{% element button form="pending-email" type="submit" name="action_send" tags="minor,secondary" %}
{% trans 'Re-send Verification' %}
{% endelement %}
{% if current_emailaddress %}
{% element button form="pending-email" type="submit" name="action_remove" tags="danger,minor" %}
{% trans 'Cancel Change' %}
{% endelement %}
{% endif %}
{% endslot %}
{% endelement %}
{% endif %}
{% element field id=form.email.auto_id name="email" value=form.email.value errors=form.email.errors type="email" %}
{% slot label %}
{% translate "Change to" %}:
{% endslot %}
{% endelement %}
{% endslot %}
{% slot actions %}
{% element button name="action_add" type="submit" %}
{% trans "Change Email" %}
{% endelement %}
{% endslot %}
{% endelement %}
{% if new_emailaddress %}
<form style="display: none"
id="pending-email"
method="post"
action="{% url 'account_email' %}">
{% csrf_token %}
<input type="hidden" name="email" value="{{ new_emailaddress.email }}">
</form>
{% endif %}
{% endblock content %}

View File

@ -9,18 +9,24 @@
<div class="row ">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
<div class="text-center">
<h3 class="mb-4">{% trans "Confirm Email Address" %}</h3>
</div>
{% if confirmation %}
{% user_display confirmation.email_address.user as user_display %}
{% if can_confirm %}
@ -31,11 +37,8 @@
<form class="form" action="{{ action_url }}" method="post">
{% csrf_token %}
{{ redirect_field }}
<button class="btn btn-sm btn-phoenix-primary" type="submit">
{% trans 'Confirm' %}
</button>
<button class="btn btn-sm btn-phoenix-primary" type="submit">{% trans 'Confirm' %}</button>
</form>
{% else %}
<p>
{% blocktrans %}Unable to confirm {{ email }} because it is already confirmed by a different account.{% endblocktrans %}

View File

@ -1,45 +1,66 @@
<!DOCTYPE html>
<html lang="en-US" dir="ltr" data-navigation-type="default" data-navbar-horizontal-shape="default">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- ===============================================-->
<!-- Document Title-->
<!-- ===============================================-->
<title>Phoenix</title>
<!-- ===============================================-->
<!-- Favicons-->
<!-- ===============================================-->
<link rel="apple-touch-icon" sizes="180x180" href="../../../assets/img/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="../../../assets/img/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../../../assets/img/favicons/favicon-16x16.png">
<link rel="shortcut icon" type="image/x-icon" href="../../../assets/img/favicons/favicon.ico">
<link rel="manifest" href="../../../assets/img/favicons/manifest.json">
<meta name="msapplication-TileImage" content="../../../assets/img/favicons/mstile-150x150.png">
<meta name="theme-color" content="#ffffff">
<script src="../../../vendors/simplebar/simplebar.min.js"></script>
<script src="../../../assets/js/config.js"></script>
<!-- ===============================================-->
<!-- Stylesheets-->
<!-- ===============================================-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap" rel="stylesheet">
<link href="../../../vendors/simplebar/simplebar.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css">
<link href="../../../assets/css/theme-rtl.min.css" type="text/css" rel="stylesheet" id="style-rtl">
<link href="../../../assets/css/theme.min.css" type="text/css" rel="stylesheet" id="style-default">
<link href="../../../assets/css/user-rtl.min.css" type="text/css" rel="stylesheet" id="user-style-rtl">
<link href="../../../assets/css/user.min.css" type="text/css" rel="stylesheet" id="user-style-default">
<script>
<html lang="en-US"
dir="ltr"
data-navigation-type="default"
data-navbar-horizontal-shape="default">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- ===============================================-->
<!-- Document Title-->
<!-- ===============================================-->
<title>Phoenix</title>
<!-- ===============================================-->
<!-- Favicons-->
<!-- ===============================================-->
<link rel="apple-touch-icon"
sizes="180x180"
href="../../../assets/img/favicons/apple-touch-icon.png">
<link rel="icon"
type="image/png"
sizes="32x32"
href="../../../assets/img/favicons/favicon-32x32.png">
<link rel="icon"
type="image/png"
sizes="16x16"
href="../../../assets/img/favicons/favicon-16x16.png">
<link rel="shortcut icon"
type="image/x-icon"
href="../../../assets/img/favicons/favicon.ico">
<link rel="manifest" href="../../../assets/img/favicons/manifest.json">
<meta name="msapplication-TileImage"
content="../../../assets/img/favicons/mstile-150x150.png">
<meta name="theme-color" content="#ffffff">
<script src="../../../vendors/simplebar/simplebar.min.js"></script>
<script src="../../../assets/js/config.js"></script>
<!-- ===============================================-->
<!-- Stylesheets-->
<!-- ===============================================-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap"
rel="stylesheet">
<link href="../../../vendors/simplebar/simplebar.min.css" rel="stylesheet">
<link rel="stylesheet"
href="https://unicons.iconscout.com/release/v4.0.8/css/line.css">
<link href="../../../assets/css/theme-rtl.min.css"
type="text/css"
rel="stylesheet"
id="style-rtl">
<link href="../../../assets/css/theme.min.css"
type="text/css"
rel="stylesheet"
id="style-default">
<link href="../../../assets/css/user-rtl.min.css"
type="text/css"
rel="stylesheet"
id="user-style-rtl">
<link href="../../../assets/css/user.min.css"
type="text/css"
rel="stylesheet"
id="user-style-default">
<script>
var phoenixIsRTL = window.config.config.phoenixIsRTL;
if (phoenixIsRTL) {
var linkDefault = document.getElementById('style-default');
@ -53,32 +74,41 @@
linkRTL.setAttribute('disabled', true);
userLinkRTL.setAttribute('disabled', true);
}
</script>
</head>
<body>
<!-- ===============================================-->
<!-- Main Content-->
<!-- ===============================================-->
<main class="main" id="top">
<div class="row">
<div class="row flex-center min-vh-100 py-5">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<div class="text-center mb-5">
<div class="avatar avatar-4xl mb-4"><img class="rounded-circle" src="../../../assets/img/team/30.webp" alt="" /></div>
<h2 class="text-body-highlight"> <span class="fw-normal">Hello </span>John Smith</h2>
<p class="text-body-tertiary">Enter your password to access the admin</p>
</script>
</head>
<body>
<!-- ===============================================-->
<!-- Main Content-->
<!-- ===============================================-->
<main class="main" id="top">
<div class="row">
<div class="row flex-center min-vh-100 py-5">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<div class="text-center mb-5">
<div class="avatar avatar-4xl mb-4">
<img class="rounded-circle" src="../../../assets/img/team/30.webp" alt="" />
</div>
<h2 class="text-body-highlight">
<span class="fw-normal">Hello</span>John Smith
</h2>
<p class="text-body-tertiary">Enter your password to access the admin</p>
</div>
<div class="position-relative" data-password="data-password">
<input class="form-control mb-3"
id="password"
type="password"
placeholder="Enter Password"
data-password-input="data-password-input" />
<button class="btn px-3 py-0 h-100 position-absolute top-0 end-0 fs-7 text-body-tertiary"
data-password-toggle="data-password-toggle">
<span class="uil uil-eye show"></span><span class="uil uil-eye-slash hide"></span>
</button>
</div>
<a class="btn btn-phoenix-primary w-100" href="../../../index.html">Sign In</a>
</div>
</div>
</div>
<div class="position-relative" data-password="data-password">
<input class="form-control mb-3" id="password" type="password" placeholder="Enter Password" data-password-input="data-password-input" />
<button class="btn px-3 py-0 h-100 position-absolute top-0 end-0 fs-7 text-body-tertiary" data-password-toggle="data-password-toggle"><span class="uil uil-eye show"></span><span class="uil uil-eye-slash hide"></span></button>
</div><a class="btn btn-phoenix-primary w-100" href="../../../index.html">Sign In</a>
</div>
</div>
</div>
<script>
<script>
var navbarTopStyle = window.config.config.phoenixNavbarTopStyle;
var navbarTop = document.querySelector('.navbar-top');
if (navbarTopStyle === 'darker') {
@ -90,194 +120,470 @@
if (navbarVertical && navbarVerticalStyle === 'darker') {
navbarVertical.setAttribute('data-navbar-appearance', 'darker');
}
</script>
<div class="support-chat-row">
<div class="row-fluid support-chat">
<div class="card bg-body-emphasis">
<div class="card-header d-flex flex-between-center px-4 py-3 border-bottom border-translucent">
<h5 class="mb-0 d-flex align-items-center gap-2">Demo widget<span class="fa-solid fa-circle text-success fs-11"></span></h5>
<div class="btn-reveal-trigger">
<button class="btn btn-link p-0 dropdown-toggle dropdown-caret-none transition-none d-flex" type="button" id="support-chat-dropdown" data-bs-toggle="dropdown" data-boundary="window" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"><span class="fas fa-ellipsis-h text-body"></span></button>
<div class="dropdown-menu dropdown-menu-end py-2" aria-labelledby="support-chat-dropdown"><a class="dropdown-item" href="#!">Request a callback</a><a class="dropdown-item" href="#!">Search in chat</a><a class="dropdown-item" href="#!">Show history</a><a class="dropdown-item" href="#!">Report to Admin</a><a class="dropdown-item btn-support-chat" href="#!">Close Support</a></div>
</div>
</div>
<div class="card-body chat p-0">
<div class="d-flex flex-column-reverse scrollbar h-100 p-3">
<div class="text-end mt-6"><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3" href="#!">
<p class="mb-0 fw-semibold fs-9">I need help with something</p><span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3" href="#!">
<p class="mb-0 fw-semibold fs-9">I cant reorder a product I previously ordered</p><span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3" href="#!">
<p class="mb-0 fw-semibold fs-9">How do I place an order?</p><span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="false d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3" href="#!">
<p class="mb-0 fw-semibold fs-9">My payment method not working</p><span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a>
</script>
<div class="support-chat-row">
<div class="row-fluid support-chat">
<div class="card bg-body-emphasis">
<div class="card-header d-flex flex-between-center px-4 py-3 border-bottom border-translucent">
<h5 class="mb-0 d-flex align-items-center gap-2">
Demo widget<span class="fa-solid fa-circle text-success fs-11"></span>
</h5>
<div class="btn-reveal-trigger">
<button class="btn btn-link p-0 dropdown-toggle dropdown-caret-none transition-none d-flex"
type="button"
id="support-chat-dropdown"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h text-body"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2"
aria-labelledby="support-chat-dropdown">
<a class="dropdown-item" href="#!">Request a callback</a><a class="dropdown-item" href="#!">Search in chat</a><a class="dropdown-item" href="#!">Show history</a><a class="dropdown-item" href="#!">Report to Admin</a><a class="dropdown-item btn-support-chat" href="#!">Close Support</a>
</div>
</div>
</div>
<div class="card-body chat p-0">
<div class="d-flex flex-column-reverse scrollbar h-100 p-3">
<div class="text-end mt-6">
<a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3"
href="#!">
<p class="mb-0 fw-semibold fs-9">I need help with something</p>
<span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3"
href="#!">
<p class="mb-0 fw-semibold fs-9">I cant reorder a product I previously ordered</p>
<span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3"
href="#!">
<p class="mb-0 fw-semibold fs-9">How do I place an order?</p>
<span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="false d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3"
href="#!">
<p class="mb-0 fw-semibold fs-9">My payment method not working</p>
<span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a>
</div>
<div class="text-center mt-auto">
<div class="avatar avatar-3xl status-online">
<img class="rounded-circle border border-3 border-light-subtle"
src="../../../assets/img/team/30.webp"
alt="" />
</div>
<h5 class="mt-2 mb-3">Eric</h5>
<p class="text-center text-body-emphasis mb-0">
Ask us anything well get back to you here or by email within 24 hours.
</p>
</div>
</div>
<div class="text-center mt-auto">
<div class="avatar avatar-3xl status-online"><img class="rounded-circle border border-3 border-light-subtle" src="../../../assets/img/team/30.webp" alt="" /></div>
<h5 class="mt-2 mb-3">Eric</h5>
<p class="text-center text-body-emphasis mb-0">Ask us anything well get back to you here or by email within 24 hours.</p>
</div>
</div>
</div>
<div class="card-footer d-flex align-items-center gap-2 border-top border-translucent ps-3 pe-4 py-3">
<div class="d-flex align-items-center flex-1 gap-3 border border-translucent rounded-pill px-4">
<input class="form-control outline-none border-0 flex-1 fs-9 px-0" type="text" placeholder="Write message" />
<label class="btn btn-link d-flex p-0 text-body-quaternary fs-9 border-0" for="supportChatPhotos"><span class="fa-solid fa-image"></span></label>
<input class="d-none" type="file" accept="image/*" id="supportChatPhotos" />
<label class="btn btn-link d-flex p-0 text-body-quaternary fs-9 border-0" for="supportChatAttachment"> <span class="fa-solid fa-paperclip"></span></label>
<input class="d-none" type="file" id="supportChatAttachment" />
</div>
<button class="btn p-0 border-0 send-btn"><span class="fa-solid fa-paper-plane fs-9"></span></button>
<div class="d-flex align-items-center flex-1 gap-3 border border-translucent rounded-pill px-4">
<input class="form-control outline-none border-0 flex-1 fs-9 px-0"
type="text"
placeholder="Write message" />
<label class="btn btn-link d-flex p-0 text-body-quaternary fs-9 border-0"
for="supportChatPhotos">
<span class="fa-solid fa-image"></span>
</label>
<input class="d-none" type="file" accept="image/*" id="supportChatPhotos" />
<label class="btn btn-link d-flex p-0 text-body-quaternary fs-9 border-0"
for="supportChatAttachment">
<span class="fa-solid fa-paperclip"></span>
</label>
<input class="d-none" type="file" id="supportChatAttachment" />
</div>
<button class="btn p-0 border-0 send-btn">
<span class="fa-solid fa-paper-plane fs-9"></span>
</button>
</div>
</div>
</div>
<button class="btn btn-support-chat p-0 border border-translucent"><span class="fs-8 btn-text text-primary text-nowrap">Chat demo</span><span class="ping-icon-wrapper mt-n4 ms-n6 mt-sm-0 ms-sm-2 position-absolute position-sm-relative"><span class="ping-icon-bg"></span><span class="fa-solid fa-circle ping-icon"></span></span><span class="fa-solid fa-headset text-primary fs-8 d-sm-none"></span><span class="fa-solid fa-chevron-down text-primary fs-7"></span></button>
</div>
</main>
<!-- ===============================================-->
<!-- End of Main Content-->
<!-- ===============================================-->
<div class="offcanvas offcanvas-end settings-panel border-0" id="settings-offcanvas" tabindex="-1" aria-labelledby="settings-offcanvas">
<div class="offcanvas-header align-items-start border-bottom flex-column border-translucent">
</div>
<button class="btn btn-support-chat p-0 border border-translucent">
<span class="fs-8 btn-text text-primary text-nowrap">Chat demo</span><span class="ping-icon-wrapper mt-n4 ms-n6 mt-sm-0 ms-sm-2 position-absolute position-sm-relative"><span class="ping-icon-bg"></span><span class="fa-solid fa-circle ping-icon"></span></span><span class="fa-solid fa-headset text-primary fs-8 d-sm-none"></span><span class="fa-solid fa-chevron-down text-primary fs-7"></span>
</button>
</div>
</main>
<!-- ===============================================-->
<!-- End of Main Content-->
<!-- ===============================================-->
<div class="offcanvas offcanvas-end settings-panel border-0"
id="settings-offcanvas"
tabindex="-1"
aria-labelledby="settings-offcanvas">
<div class="offcanvas-header align-items-start border-bottom flex-column border-translucent">
<div class="pt-1 w-100 mb-6 d-flex justify-content-between align-items-start">
<div>
<h5 class="mb-2 me-2 lh-sm"><span class="fas fa-palette me-2 fs-8"></span>Theme Customizer</h5>
<p class="mb-0 fs-9">Explore different styles according to your preferences</p>
</div>
<button class="btn p-1 fw-bolder" type="button" data-bs-dismiss="offcanvas" aria-label="Close"><span class="fas fa-times fs-8"> </span></button>
<div>
<h5 class="mb-2 me-2 lh-sm">
<span class="fas fa-palette me-2 fs-8"></span>Theme Customizer
</h5>
<p class="mb-0 fs-9">Explore different styles according to your preferences</p>
</div>
<button class="btn p-1 fw-bolder"
type="button"
data-bs-dismiss="offcanvas"
aria-label="Close">
<span class="fas fa-times fs-8"></span>
</button>
</div>
<button class="btn btn-phoenix-secondary w-100" data-theme-control="reset"><span class="fas fa-arrows-rotate me-2 fs-10"></span>Reset to default</button>
</div>
<div class="offcanvas-body scrollbar px-card" id="themeController">
<button class="btn btn-phoenix-secondary w-100" data-theme-control="reset">
<span class="fas fa-arrows-rotate me-2 fs-10"></span>Reset to default
</button>
</div>
<div class="offcanvas-body scrollbar px-card" id="themeController">
<div class="setting-panel-item mt-0">
<h5 class="setting-panel-item-title">Color Scheme</h5>
<div class="row gx-2">
<div class="col-4">
<input class="btn-check" id="themeSwitcherLight" name="theme-color" type="radio" value="light" data-theme-control="phoenixTheme" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="themeSwitcherLight"> <span class="mb-2 rounded d-block"><img class="img-fluid img-prototype mb-0" src="../../../assets/img/generic/default-light.png" alt=""/></span><span class="label-text">Light</span></label>
<h5 class="setting-panel-item-title">Color Scheme</h5>
<div class="row gx-2">
<div class="col-4">
<input class="btn-check"
id="themeSwitcherLight"
name="theme-color"
type="radio"
value="light"
data-theme-control="phoenixTheme" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="themeSwitcherLight">
<span class="mb-2 rounded d-block">
<img class="img-fluid img-prototype mb-0"
src="../../../assets/img/generic/default-light.png"
alt="" />
</span><span class="label-text">Light</span>
</label>
</div>
<div class="col-4">
<input class="btn-check"
id="themeSwitcherDark"
name="theme-color"
type="radio"
value="dark"
data-theme-control="phoenixTheme" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="themeSwitcherDark">
<span class="mb-2 rounded d-block">
<img class="img-fluid img-prototype mb-0"
src="../../../assets/img/generic/default-dark.png"
alt="" />
</span><span class="label-text">Dark</span>
</label>
</div>
<div class="col-4">
<input class="btn-check"
id="themeSwitcherAuto"
name="theme-color"
type="radio"
value="auto"
data-theme-control="phoenixTheme" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="themeSwitcherAuto">
<span class="mb-2 rounded d-block">
<img class="img-fluid img-prototype mb-0"
src="../../../assets/img/generic/auto.png"
alt="" />
</span><span class="label-text">Auto</span>
</label>
</div>
</div>
<div class="col-4">
<input class="btn-check" id="themeSwitcherDark" name="theme-color" type="radio" value="dark" data-theme-control="phoenixTheme" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="themeSwitcherDark"> <span class="mb-2 rounded d-block"><img class="img-fluid img-prototype mb-0" src="../../../assets/img/generic/default-dark.png" alt=""/></span><span class="label-text"> Dark</span></label>
</div>
<div class="col-4">
<input class="btn-check" id="themeSwitcherAuto" name="theme-color" type="radio" value="auto" data-theme-control="phoenixTheme" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="themeSwitcherAuto"> <span class="mb-2 rounded d-block"><img class="img-fluid img-prototype mb-0" src="../../../assets/img/generic/auto.png" alt=""/></span><span class="label-text"> Auto</span></label>
</div>
</div>
</div>
<div class="border border-translucent rounded-3 p-4 setting-panel-item bg-body-emphasis">
<div class="d-flex justify-content-between align-items-center">
<h5 class="setting-panel-item-title mb-1">RTL </h5>
<div class="form-check form-switch mb-0">
<input class="form-check-input ms-auto" type="checkbox" data-theme-control="phoenixIsRTL" />
<div class="d-flex justify-content-between align-items-center">
<h5 class="setting-panel-item-title mb-1">RTL</h5>
<div class="form-check form-switch mb-0">
<input class="form-check-input ms-auto"
type="checkbox"
data-theme-control="phoenixIsRTL" />
</div>
</div>
</div>
<p class="mb-0 text-body-tertiary">Change text direction</p>
<p class="mb-0 text-body-tertiary">Change text direction</p>
</div>
<div class="border border-translucent rounded-3 p-4 setting-panel-item bg-body-emphasis">
<div class="d-flex justify-content-between align-items-center">
<h5 class="setting-panel-item-title mb-1">Support Chat </h5>
<div class="form-check form-switch mb-0">
<input class="form-check-input ms-auto" type="checkbox" data-theme-control="phoenixSupportChat" />
<div class="d-flex justify-content-between align-items-center">
<h5 class="setting-panel-item-title mb-1">Support Chat</h5>
<div class="form-check form-switch mb-0">
<input class="form-check-input ms-auto"
type="checkbox"
data-theme-control="phoenixSupportChat" />
</div>
</div>
</div>
<p class="mb-0 text-body-tertiary">Toggle support chat</p>
<p class="mb-0 text-body-tertiary">Toggle support chat</p>
</div>
<div class="setting-panel-item">
<h5 class="setting-panel-item-title">Navigation Type</h5>
<div class="row gx-2">
<div class="col-6">
<input class="btn-check" id="navbarPositionVertical" name="navigation-type" type="radio" value="vertical" data-theme-control="phoenixNavbarPosition" data-page-url="../../../documentation/layouts/vertical-navbar.html" disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="navbarPositionVertical"> <span class="rounded d-block"><img class="img-fluid img-prototype d-dark-none" src="../../../assets/img/generic/default-light.png" alt=""/><img class="img-fluid img-prototype d-light-none" src="../../../assets/img/generic/default-dark.png" alt=""/></span><span class="label-text">Vertical</span></label>
<h5 class="setting-panel-item-title">Navigation Type</h5>
<div class="row gx-2">
<div class="col-6">
<input class="btn-check"
id="navbarPositionVertical"
name="navigation-type"
type="radio"
value="vertical"
data-theme-control="phoenixNavbarPosition"
data-page-url="../../../documentation/layouts/vertical-navbar.html"
disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="navbarPositionVertical">
<span class="rounded d-block">
<img class="img-fluid img-prototype d-dark-none"
src="../../../assets/img/generic/default-light.png"
alt="" />
<img class="img-fluid img-prototype d-light-none"
src="../../../assets/img/generic/default-dark.png"
alt="" />
</span><span class="label-text">Vertical</span>
</label>
</div>
<div class="col-6">
<input class="btn-check"
id="navbarPositionHorizontal"
name="navigation-type"
type="radio"
value="horizontal"
data-theme-control="phoenixNavbarPosition"
data-page-url="../../../documentation/layouts/horizontal-navbar.html"
disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="navbarPositionHorizontal">
<span class="rounded d-block">
<img class="img-fluid img-prototype d-dark-none"
src="../../../assets/img/generic/top-default.png"
alt="" />
<img class="img-fluid img-prototype d-light-none"
src="../../../assets/img/generic/top-default-dark.png"
alt="" />
</span><span class="label-text">Horizontal</span>
</label>
</div>
<div class="col-6">
<input class="btn-check"
id="navbarPositionCombo"
name="navigation-type"
type="radio"
value="combo"
data-theme-control="phoenixNavbarPosition"
disabled="disabled"
data-page-url="../../../documentation/layouts/combo-navbar.html" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="navbarPositionCombo">
<span class="rounded d-block">
<img class="img-fluid img-prototype d-dark-none"
src="../../../assets/img/generic/nav-combo-light.png"
alt="" />
<img class="img-fluid img-prototype d-light-none"
src="../../../assets/img/generic/nav-combo-dark.png"
alt="" />
</span><span class="label-text">Combo</span>
</label>
</div>
<div class="col-6">
<input class="btn-check"
id="navbarPositionTopDouble"
name="navigation-type"
type="radio"
value="dual-nav"
data-theme-control="phoenixNavbarPosition"
disabled="disabled"
data-page-url="../../../documentation/layouts/dual-nav.html" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="navbarPositionTopDouble">
<span class="rounded d-block">
<img class="img-fluid img-prototype d-dark-none"
src="../../../assets/img/generic/dual-light.png"
alt="" />
<img class="img-fluid img-prototype d-light-none"
src="../../../assets/img/generic/dual-dark.png"
alt="" />
</span><span class="label-text">Dual nav</span>
</label>
</div>
</div>
<div class="col-6">
<input class="btn-check" id="navbarPositionHorizontal" name="navigation-type" type="radio" value="horizontal" data-theme-control="phoenixNavbarPosition" data-page-url="../../../documentation/layouts/horizontal-navbar.html" disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="navbarPositionHorizontal"> <span class="rounded d-block"><img class="img-fluid img-prototype d-dark-none" src="../../../assets/img/generic/top-default.png" alt=""/><img class="img-fluid img-prototype d-light-none" src="../../../assets/img/generic/top-default-dark.png" alt=""/></span><span class="label-text"> Horizontal</span></label>
</div>
<div class="col-6">
<input class="btn-check" id="navbarPositionCombo" name="navigation-type" type="radio" value="combo" data-theme-control="phoenixNavbarPosition" disabled="disabled" data-page-url="../../../documentation/layouts/combo-navbar.html" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="navbarPositionCombo"> <span class="rounded d-block"><img class="img-fluid img-prototype d-dark-none" src="../../../assets/img/generic/nav-combo-light.png" alt=""/><img class="img-fluid img-prototype d-light-none" src="../../../assets/img/generic/nav-combo-dark.png" alt=""/></span><span class="label-text"> Combo</span></label>
</div>
<div class="col-6">
<input class="btn-check" id="navbarPositionTopDouble" name="navigation-type" type="radio" value="dual-nav" data-theme-control="phoenixNavbarPosition" disabled="disabled" data-page-url="../../../documentation/layouts/dual-nav.html" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="navbarPositionTopDouble"> <span class="rounded d-block"><img class="img-fluid img-prototype d-dark-none" src="../../../assets/img/generic/dual-light.png" alt=""/><img class="img-fluid img-prototype d-light-none" src="../../../assets/img/generic/dual-dark.png" alt=""/></span><span class="label-text"> Dual nav</span></label>
</div>
</div>
<p class="text-warning-dark font-medium"> <span class="fa-solid fa-triangle-exclamation me-2 text-warning"></span>You can't update navigation type in this page</p>
<p class="text-warning-dark font-medium">
<span class="fa-solid fa-triangle-exclamation me-2 text-warning"></span>You can't update navigation type in this page
</p>
</div>
<div class="setting-panel-item">
<h5 class="setting-panel-item-title">Vertical Navbar Appearance</h5>
<div class="row gx-2">
<div class="col-6">
<input class="btn-check" id="navbar-style-default" type="radio" name="config.name" value="default" data-theme-control="phoenixNavbarVerticalStyle" disabled="disabled" />
<label class="btn d-block w-100 btn-navbar-style fs-9" for="navbar-style-default"> <img class="img-fluid img-prototype d-dark-none" src="../../../assets/img/generic/default-light.png" alt="" /><img class="img-fluid img-prototype d-light-none" src="../../../assets/img/generic/default-dark.png" alt="" /><span class="label-text d-dark-none"> Default</span><span class="label-text d-light-none">Default</span></label>
<h5 class="setting-panel-item-title">Vertical Navbar Appearance</h5>
<div class="row gx-2">
<div class="col-6">
<input class="btn-check"
id="navbar-style-default"
type="radio"
name="config.name"
value="default"
data-theme-control="phoenixNavbarVerticalStyle"
disabled="disabled" />
<label class="btn d-block w-100 btn-navbar-style fs-9"
for="navbar-style-default">
<img class="img-fluid img-prototype d-dark-none"
src="../../../assets/img/generic/default-light.png"
alt="" />
<img class="img-fluid img-prototype d-light-none"
src="../../../assets/img/generic/default-dark.png"
alt="" />
<span class="label-text d-dark-none">Default</span><span class="label-text d-light-none">Default</span>
</label>
</div>
<div class="col-6">
<input class="btn-check"
id="navbar-style-dark"
type="radio"
name="config.name"
value="darker"
data-theme-control="phoenixNavbarVerticalStyle"
disabled="disabled" />
<label class="btn d-block w-100 btn-navbar-style fs-9"
for="navbar-style-dark">
<img class="img-fluid img-prototype d-dark-none"
src="../../../assets/img/generic/vertical-darker.png"
alt="" />
<img class="img-fluid img-prototype d-light-none"
src="../../../assets/img/generic/vertical-lighter.png"
alt="" />
<span class="label-text d-dark-none">Darker</span><span class="label-text d-light-none">Lighter</span>
</label>
</div>
</div>
<div class="col-6">
<input class="btn-check" id="navbar-style-dark" type="radio" name="config.name" value="darker" data-theme-control="phoenixNavbarVerticalStyle" disabled="disabled" />
<label class="btn d-block w-100 btn-navbar-style fs-9" for="navbar-style-dark"> <img class="img-fluid img-prototype d-dark-none" src="../../../assets/img/generic/vertical-darker.png" alt="" /><img class="img-fluid img-prototype d-light-none" src="../../../assets/img/generic/vertical-lighter.png" alt="" /><span class="label-text d-dark-none"> Darker</span><span class="label-text d-light-none">Lighter</span></label>
</div>
</div>
<p class="text-warning-dark font-medium"> <span class="fa-solid fa-triangle-exclamation me-2 text-warning"></span>You can't update vertical navbar appearance in this page</p>
<p class="text-warning-dark font-medium">
<span class="fa-solid fa-triangle-exclamation me-2 text-warning"></span>You can't update vertical navbar appearance in this page
</p>
</div>
<div class="setting-panel-item">
<h5 class="setting-panel-item-title">Horizontal Navbar Shape</h5>
<div class="row gx-2">
<div class="col-6">
<input class="btn-check" id="navbarShapeDefault" name="navbar-shape" type="radio" value="default" data-theme-control="phoenixNavbarTopShape" data-page-url="../../../documentation/layouts/horizontal-navbar.html" disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="navbarShapeDefault"> <span class="mb-2 rounded d-block"><img class="img-fluid img-prototype d-dark-none mb-0" src="../../../assets/img/generic/top-default.png" alt=""/><img class="img-fluid img-prototype d-light-none mb-0" src="../../../assets/img/generic/top-default-dark.png" alt=""/></span><span class="label-text">Default</span></label>
<h5 class="setting-panel-item-title">Horizontal Navbar Shape</h5>
<div class="row gx-2">
<div class="col-6">
<input class="btn-check"
id="navbarShapeDefault"
name="navbar-shape"
type="radio"
value="default"
data-theme-control="phoenixNavbarTopShape"
data-page-url="../../../documentation/layouts/horizontal-navbar.html"
disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="navbarShapeDefault">
<span class="mb-2 rounded d-block">
<img class="img-fluid img-prototype d-dark-none mb-0"
src="../../../assets/img/generic/top-default.png"
alt="" />
<img class="img-fluid img-prototype d-light-none mb-0"
src="../../../assets/img/generic/top-default-dark.png"
alt="" />
</span><span class="label-text">Default</span>
</label>
</div>
<div class="col-6">
<input class="btn-check"
id="navbarShapeSlim"
name="navbar-shape"
type="radio"
value="slim"
data-theme-control="phoenixNavbarTopShape"
data-page-url="../../../documentation/layouts/horizontal-navbar.html#horizontal-navbar-slim"
disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="navbarShapeSlim">
<span class="mb-2 rounded d-block">
<img class="img-fluid img-prototype d-dark-none mb-0"
src="../../../assets/img/generic/top-slim.png"
alt="" />
<img class="img-fluid img-prototype d-light-none mb-0"
src="../../../assets/img/generic/top-slim-dark.png"
alt="" />
</span><span class="label-text">Slim</span>
</label>
</div>
</div>
<div class="col-6">
<input class="btn-check" id="navbarShapeSlim" name="navbar-shape" type="radio" value="slim" data-theme-control="phoenixNavbarTopShape" data-page-url="../../../documentation/layouts/horizontal-navbar.html#horizontal-navbar-slim" disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="navbarShapeSlim"> <span class="mb-2 rounded d-block"><img class="img-fluid img-prototype d-dark-none mb-0" src="../../../assets/img/generic/top-slim.png" alt=""/><img class="img-fluid img-prototype d-light-none mb-0" src="../../../assets/img/generic/top-slim-dark.png" alt=""/></span><span class="label-text"> Slim</span></label>
</div>
</div>
<p class="text-warning-dark font-medium"> <span class="fa-solid fa-triangle-exclamation me-2 text-warning"></span>You can't update horizontal navbar shape in this page</p>
<p class="text-warning-dark font-medium">
<span class="fa-solid fa-triangle-exclamation me-2 text-warning"></span>You can't update horizontal navbar shape in this page
</p>
</div>
<div class="setting-panel-item">
<h5 class="setting-panel-item-title">Horizontal Navbar Appearance</h5>
<div class="row gx-2">
<div class="col-6">
<input class="btn-check" id="navbarTopDefault" name="navbar-top-style" type="radio" value="default" data-theme-control="phoenixNavbarTopStyle" disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="navbarTopDefault"> <span class="mb-2 rounded d-block"><img class="img-fluid img-prototype d-dark-none mb-0" src="../../../assets/img/generic/top-default.png" alt=""/><img class="img-fluid img-prototype d-light-none mb-0" src="../../../assets/img/generic/top-style-darker.png" alt=""/></span><span class="label-text">Default</span></label>
<h5 class="setting-panel-item-title">Horizontal Navbar Appearance</h5>
<div class="row gx-2">
<div class="col-6">
<input class="btn-check"
id="navbarTopDefault"
name="navbar-top-style"
type="radio"
value="default"
data-theme-control="phoenixNavbarTopStyle"
disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="navbarTopDefault">
<span class="mb-2 rounded d-block">
<img class="img-fluid img-prototype d-dark-none mb-0"
src="../../../assets/img/generic/top-default.png"
alt="" />
<img class="img-fluid img-prototype d-light-none mb-0"
src="../../../assets/img/generic/top-style-darker.png"
alt="" />
</span><span class="label-text">Default</span>
</label>
</div>
<div class="col-6">
<input class="btn-check"
id="navbarTopDarker"
name="navbar-top-style"
type="radio"
value="darker"
data-theme-control="phoenixNavbarTopStyle"
disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9"
for="navbarTopDarker">
<span class="mb-2 rounded d-block">
<img class="img-fluid img-prototype d-dark-none mb-0"
src="../../../assets/img/generic/navbar-top-style-light.png"
alt="" />
<img class="img-fluid img-prototype d-light-none mb-0"
src="../../../assets/img/generic/top-style-lighter.png"
alt="" />
</span><span class="label-text d-dark-none">Darker</span><span class="label-text d-light-none">Lighter</span>
</label>
</div>
</div>
<div class="col-6">
<input class="btn-check" id="navbarTopDarker" name="navbar-top-style" type="radio" value="darker" data-theme-control="phoenixNavbarTopStyle" disabled="disabled" />
<label class="btn d-inline-block btn-navbar-style fs-9" for="navbarTopDarker"> <span class="mb-2 rounded d-block"><img class="img-fluid img-prototype d-dark-none mb-0" src="../../../assets/img/generic/navbar-top-style-light.png" alt=""/><img class="img-fluid img-prototype d-light-none mb-0" src="../../../assets/img/generic/top-style-lighter.png" alt=""/></span><span class="label-text d-dark-none">Darker</span><span class="label-text d-light-none">Lighter</span></label>
<p class="text-warning-dark font-medium">
<span class="fa-solid fa-triangle-exclamation me-2 text-warning"></span>You can't update horizontal navbar appearance in this page
</p>
</div>
<a class="bun btn-primary d-grid mb-3 text-white mt-5 btn btn-primary"
href="https://themes.getbootstrap.com/product/phoenix-admin-dashboard-webapp-template/"
target="_blank">Purchase template</a>
</div>
</div>
<a class="card setting-toggle"
href="#settings-offcanvas"
data-bs-toggle="offcanvas">
<div class="card-body d-flex align-items-center px-2 py-1">
<div class="position-relative rounded-start"
style="height:34px;
width:28px">
<div class="settings-popover">
<span class="ripple"><span class="fa-spin position-absolute all-0 d-flex flex-center"><span class="icon-spin position-absolute all-0 d-flex flex-center">
<svg width="20"
height="20"
viewBox="0 0 20 20"
fill="#ffffff"
xmlns="http://www.w3.org/2000/svg">
<path d="M19.7369 12.3941L19.1989 12.1065C18.4459 11.7041 18.0843 10.8487 18.0843 9.99495C18.0843 9.14118 18.4459 8.28582 19.1989 7.88336L19.7369 7.59581C19.9474 7.47484 20.0316 7.23291 19.9474 7.03131C19.4842 5.57973 18.6843 4.28943 17.6738 3.20075C17.5053 3.03946 17.2527 2.99914 17.0422 3.12011L16.393 3.46714C15.6883 3.84379 14.8377 3.74529 14.1476 3.3427C14.0988 3.31422 14.0496 3.28621 14.0002 3.25868C13.2568 2.84453 12.7055 2.10629 12.7055 1.25525V0.70081C12.7055 0.499202 12.5371 0.297594 12.2845 0.257272C10.7266 -0.105622 9.16879 -0.0653007 7.69516 0.257272C7.44254 0.297594 7.31623 0.499202 7.31623 0.70081V1.23474C7.31623 2.09575 6.74999 2.8362 5.99824 3.25599C5.95774 3.27861 5.91747 3.30159 5.87744 3.32493C5.15643 3.74527 4.26453 3.85902 3.53534 3.45302L2.93743 3.12011C2.72691 2.99914 2.47429 3.03946 2.30587 3.20075C1.29538 4.28943 0.495411 5.57973 0.0322686 7.03131C-0.051939 7.23291 0.0322686 7.47484 0.242788 7.59581L0.784376 7.8853C1.54166 8.29007 1.92694 9.13627 1.92694 9.99495C1.92694 10.8536 1.54166 11.6998 0.784375 12.1046L0.242788 12.3941C0.0322686 12.515 -0.051939 12.757 0.0322686 12.9586C0.495411 14.4102 1.29538 15.7005 2.30587 16.7891C2.47429 16.9504 2.72691 16.9907 2.93743 16.8698L3.58669 16.5227C4.29133 16.1461 5.14131 16.2457 5.8331 16.6455C5.88713 16.6767 5.94159 16.7074 5.99648 16.7375C6.75162 17.1511 7.31623 17.8941 7.31623 18.7552V19.2891C7.31623 19.4425 7.41373 19.5959 7.55309 19.696C7.64066 19.7589 7.74815 19.7843 7.85406 19.8046C9.35884 20.0925 10.8609 20.0456 12.2845 19.7729C12.5371 19.6923 12.7055 19.4907 12.7055 19.2891V18.7346C12.7055 17.8836 13.2568 17.1454 14.0002 16.7312C14.0496 16.7037 14.0988 16.6757 14.1476 16.6472C14.8377 16.2446 15.6883 16.1461 16.393 16.5227L17.0422 16.8698C17.2527 16.9907 17.5053 16.9504 17.6738 16.7891C18.7264 15.7005 19.4842 14.4102 19.9895 12.9586C20.0316 12.757 19.9474 12.515 19.7369 12.3941ZM10.0109 13.2005C8.1162 13.2005 6.64257 11.7893 6.64257 9.97478C6.64257 8.20063 8.1162 6.74905 10.0109 6.74905C11.8634 6.74905 13.3792 8.20063 13.3792 9.97478C13.3792 11.7893 11.8634 13.2005 10.0109 13.2005Z" fill="#2A7BE4">
</path>
</svg>
</span></span></span>
</div>
</div>
<p class="text-warning-dark font-medium"> <span class="fa-solid fa-triangle-exclamation me-2 text-warning"></span>You can't update horizontal navbar appearance in this page</p>
</div><a class="bun btn-primary d-grid mb-3 text-white mt-5 btn btn-primary" href="https://themes.getbootstrap.com/product/phoenix-admin-dashboard-webapp-template/" target="_blank">Purchase template</a>
</div>
</div><a class="card setting-toggle" href="#settings-offcanvas" data-bs-toggle="offcanvas">
<div class="card-body d-flex align-items-center px-2 py-1">
<div class="position-relative rounded-start" style="height:34px;width:28px">
<div class="settings-popover"><span class="ripple"><span class="fa-spin position-absolute all-0 d-flex flex-center"><span class="icon-spin position-absolute all-0 d-flex flex-center">
<svg width="20" height="20" viewBox="0 0 20 20" fill="#ffffff" xmlns="http://www.w3.org/2000/svg">
<path d="M19.7369 12.3941L19.1989 12.1065C18.4459 11.7041 18.0843 10.8487 18.0843 9.99495C18.0843 9.14118 18.4459 8.28582 19.1989 7.88336L19.7369 7.59581C19.9474 7.47484 20.0316 7.23291 19.9474 7.03131C19.4842 5.57973 18.6843 4.28943 17.6738 3.20075C17.5053 3.03946 17.2527 2.99914 17.0422 3.12011L16.393 3.46714C15.6883 3.84379 14.8377 3.74529 14.1476 3.3427C14.0988 3.31422 14.0496 3.28621 14.0002 3.25868C13.2568 2.84453 12.7055 2.10629 12.7055 1.25525V0.70081C12.7055 0.499202 12.5371 0.297594 12.2845 0.257272C10.7266 -0.105622 9.16879 -0.0653007 7.69516 0.257272C7.44254 0.297594 7.31623 0.499202 7.31623 0.70081V1.23474C7.31623 2.09575 6.74999 2.8362 5.99824 3.25599C5.95774 3.27861 5.91747 3.30159 5.87744 3.32493C5.15643 3.74527 4.26453 3.85902 3.53534 3.45302L2.93743 3.12011C2.72691 2.99914 2.47429 3.03946 2.30587 3.20075C1.29538 4.28943 0.495411 5.57973 0.0322686 7.03131C-0.051939 7.23291 0.0322686 7.47484 0.242788 7.59581L0.784376 7.8853C1.54166 8.29007 1.92694 9.13627 1.92694 9.99495C1.92694 10.8536 1.54166 11.6998 0.784375 12.1046L0.242788 12.3941C0.0322686 12.515 -0.051939 12.757 0.0322686 12.9586C0.495411 14.4102 1.29538 15.7005 2.30587 16.7891C2.47429 16.9504 2.72691 16.9907 2.93743 16.8698L3.58669 16.5227C4.29133 16.1461 5.14131 16.2457 5.8331 16.6455C5.88713 16.6767 5.94159 16.7074 5.99648 16.7375C6.75162 17.1511 7.31623 17.8941 7.31623 18.7552V19.2891C7.31623 19.4425 7.41373 19.5959 7.55309 19.696C7.64066 19.7589 7.74815 19.7843 7.85406 19.8046C9.35884 20.0925 10.8609 20.0456 12.2845 19.7729C12.5371 19.6923 12.7055 19.4907 12.7055 19.2891V18.7346C12.7055 17.8836 13.2568 17.1454 14.0002 16.7312C14.0496 16.7037 14.0988 16.6757 14.1476 16.6472C14.8377 16.2446 15.6883 16.1461 16.393 16.5227L17.0422 16.8698C17.2527 16.9907 17.5053 16.9504 17.6738 16.7891C18.7264 15.7005 19.4842 14.4102 19.9895 12.9586C20.0316 12.757 19.9474 12.515 19.7369 12.3941ZM10.0109 13.2005C8.1162 13.2005 6.64257 11.7893 6.64257 9.97478C6.64257 8.20063 8.1162 6.74905 10.0109 6.74905C11.8634 6.74905 13.3792 8.20063 13.3792 9.97478C13.3792 11.7893 11.8634 13.2005 10.0109 13.2005Z" fill="#2A7BE4"></path>
</svg></span></span></span></div>
</div><small class="text-uppercase text-body-tertiary fw-bold py-2 pe-2 ps-1 rounded-end">customize</small>
</div>
</a>
<!-- ===============================================-->
<!-- JavaScripts-->
<!-- ===============================================-->
<script src="../../../vendors/popper/popper.min.js"></script>
<script src="../../../vendors/bootstrap/bootstrap.min.js"></script>
<script src="../../../vendors/anchorjs/anchor.min.js"></script>
<script src="../../../vendors/is/is.min.js"></script>
<script src="../../../vendors/fontawesome/all.min.js"></script>
<script src="../../../vendors/lodash/lodash.min.js"></script>
<script src="../../../vendors/list.js/list.min.js"></script>
<script src="../../../vendors/feather-icons/feather.min.js"></script>
<script src="../../../vendors/dayjs/dayjs.min.js"></script>
<script src="../../../assets/js/phoenix.js"></script>
</body>
</html>
</div>
<small class="text-uppercase text-body-tertiary fw-bold py-2 pe-2 ps-1 rounded-end">customize</small>
</div>
</a>
<!-- ===============================================-->
<!-- JavaScripts-->
<!-- ===============================================-->
<script src="../../../vendors/popper/popper.min.js"></script>
<script src="../../../vendors/bootstrap/bootstrap.min.js"></script>
<script src="../../../vendors/anchorjs/anchor.min.js"></script>
<script src="../../../vendors/is/is.min.js"></script>
<script src="../../../vendors/fontawesome/all.min.js"></script>
<script src="../../../vendors/lodash/lodash.min.js"></script>
<script src="../../../vendors/list.js/list.min.js"></script>
<script src="../../../vendors/feather-icons/feather.min.js"></script>
<script src="../../../vendors/dayjs/dayjs.min.js"></script>
<script src="../../../assets/js/phoenix.js"></script>
</body>
</html>

View File

@ -7,49 +7,67 @@
{% endblock head_title %}
{% block content %}
<section class="main mt-2">
<div class="row flex-center ">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
<div class="text-center">
<h3 class="mb-4">{% trans "Sign In" %}</h3>
{% if not SOCIALACCOUNT_ONLY %}
<form method="post" action="{% url 'account_login' %}" class="form needs-validation" novalidate >
<form method="post"
action="{% url 'account_login' %}"
class="form needs-validation"
novalidate>
{% csrf_token %}
<div class="mb-3 ">
<label class="form-label" for="id_login" >{{ _("Email") }}</label>
<label class="form-label" for="id_login">{{ _("Email") }}</label>
<div class="form-icon-container">
<input type="email" name="login" id="id_login" class="form-control form-icon-input placeholder-center" placeholder="{{ _("Email") }}" required >
<input type="email"
name="login"
id="id_login"
class="form-control form-icon-input placeholder-center"
placeholder="{{ _("Email") }}"
required>
<span class="fas fa-user text-body fs-9 form-icon"></span>
</div>
</div>
<div class="mb-3 ">
<label class="form-label" for="id_password">{{ _("Password") }}</label>
<div class="form-icon-container">
<input type="password" name="password" id="id_password" class="form-control form-icon-input placeholder-center" placeholder="{{ _("Password") }}" required >
<input type="password"
name="password"
id="id_password"
class="form-control form-icon-input placeholder-center"
placeholder="{{ _("Password") }}"
required>
<span class="fas fa-key text-body fs-9 form-icon"></span>
</div>
</div>
<div class="form-group form-check">
<input type="checkbox" name="remember" id="id_remember" class="form-check-input">
<label class="form-check-label mb-0 fs-9" for="id_remember">{{ _("Remember Me")}}</label>
<input type="checkbox"
name="remember"
id="id_remember"
class="form-check-input">
<label class="form-check-label mb-0 fs-9" for="id_remember">{{ _("Remember Me") }}</label>
</div>
<button type="submit" class="btn btn-phoenix-primary btn-sm w-100">{% trans "Sign In" %}</button>
<div class="text-start mt-1">
<a class="fs-9" href="{% url 'account_reset_password' %}">{{ _("Forgot Password?")}}</a>
<a class="fs-9" href="{% url 'account_reset_password' %}">{{ _("Forgot Password?") }}</a>
</div>
{% include 'partials/form_errors.html' %}
</form>
<div class="text-center my-3 fs-9">
{% trans 'If you have not created an account yet, then please' %}
@ -58,33 +76,29 @@
{% endif %}
</div>
</div>
</section>
<section class="pt-lg-0 pt-xl-8">
{% include 'footer.html' %}
</section>
{% if LOGIN_BY_CODE_ENABLED or PASSKEY_LOGIN_ENABLED %}
<hr>
{% element button_group vertical=True %}
{% if PASSKEY_LOGIN_ENABLED %}
{% element button type="submit" form="mfa_login" id="passkey_login" tags="prominent,login,outline,primary" %}
{% trans "Sign in with a passkey" %}
{% endelement %}
{% endif %}
{% if LOGIN_BY_CODE_ENABLED %}
{% element button href=request_login_code_url tags="prominent,login,outline,primary" %}
{% trans "Mail me a sign-in code" %}
{% endelement %}
{% endif %}
{% if PASSKEY_LOGIN_ENABLED %}
{% element button type="submit" form="mfa_login" id="passkey_login" tags="prominent,login,outline,primary" %}
{% trans "Sign in with a passkey" %}
{% endelement %}
{% endif %}
{% if SOCIALACCOUNT_ENABLED %}
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %}
{% endif %}
{% if LOGIN_BY_CODE_ENABLED %}
{% element button href=request_login_code_url tags="prominent,login,outline,primary" %}
{% trans "Mail me a sign-in code" %}
{% endelement %}
{% endif %}
{% endelement %}
{% endif %}
{% if SOCIALACCOUNT_ENABLED %}
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %}
{% endif %}
{% endblock content %}
{% block extra_body %}
{{ block.super }}
{% if PASSKEY_LOGIN_ENABLED %}

View File

@ -1,30 +1,30 @@
{% extends "base.html" %}
{% load i18n %}
{% block title %}{{ _("Sign Out") }}{% endblock title %}
{% block title %}
{{ _("Sign Out") }}
{% endblock title %}
{% block content %}
<div class="row">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-4 col-xxl-3">
<div class="text-center mb-6 mx-auto">
<div class="mb-6">
<h1 class="fw-bold">{{ _("Sign Out") }}</h1>
<p class="text-body-tertiary">{{ _("Are you sure you want to sign out?") }}</p>
</div>
<div class="d-grid">
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{{ redirect_field }}
<div class="d-grid gap-2 mt-3">
<button type="submit" class="btn btn-phoenix-danger">
<span data-feather="log-out"></span> {{ _("Sign Out") }}
</button>
</div>
</form>
</div>
<div class="row">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-4 col-xxl-3">
<div class="text-center mb-6 mx-auto">
<div class="mb-6">
<h1 class="fw-bold">{{ _("Sign Out") }}</h1>
<p class="text-body-tertiary">{{ _("Are you sure you want to sign out?") }}</p>
</div>
<div class="d-grid">
<form method="post" action="{% url 'account_logout' %}">
{% csrf_token %}
{{ redirect_field }}
<div class="d-grid gap-2 mt-3">
<button type="submit" class="btn btn-phoenix-danger">
<span data-feather="log-out"></span> {{ _("Sign Out") }}
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock content %}
{% endblock content %}

View File

@ -1,14 +1,20 @@
{% extends 'base.html' %}
{% load i18n static %}
{% block content %}
<div class="row">
<div class="row flex-center min-vh-50 py-5">
<div class="col-sm-10 col-md-8 col-lg-5 col-xxl-4">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</a>
<div class="px-xxl-5">
@ -17,17 +23,16 @@
<p class="text-body-tertiary mb-0">
{{ _("An email containing a 6-digit verification code has been sent to your email.") }}
</p>
<form class="verification-form" method="POST">
{% csrf_token %}
<div class="d-flex align-items-center gap-2 mb-3">
<input class="form-control px-2 text-center" type="number" name="otp_code" required maxlength="6" />
<input class="form-control px-2 text-center"
type="number"
name="otp_code"
required
maxlength="6" />
</div>
<button class="btn btn-phoenix-primary w-100 mb-5" type="submit">
{{ _("Verify") }}
</button>
<button class="btn btn-phoenix-primary w-100 mb-5" type="submit">{{ _("Verify") }}</button>
<a class="fs-9" href="">{{ _("Didnt receive the code") }}</a>
</form>
</div>
@ -35,4 +40,4 @@
</div>
</div>
</div>
{% endblock %}
{% endblock %}

View File

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load allauth i18n static%}
{% load allauth i18n static %}
{% block head_title %}
{% trans "Change Password" %}
{% endblock head_title %}
@ -8,24 +8,34 @@
<div class="row ">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
<div class="text-center">
<h3 class="mb-4">{% trans "Change Password" %}</h3>
</div>
<form method="post" action="{% url 'account_change_password' %}" class="form needs-validation" novalidate>
<form method="post"
action="{% url 'account_change_password' %}"
class="form needs-validation"
novalidate>
{% csrf_token %}
{{ redirect_field }}
{{ form|crispy }}
<button type="submit" class="btn btn-phoenix-primary btn-sm w-100">{% trans "Change Password" %}</button>
<div class="text-start mt-1">
<a class="fs-9" href="{% url 'account_reset_password' %}">{{ _("Forgot Password?")}}</a>
<a class="fs-9" href="{% url 'account_reset_password' %}">{{ _("Forgot Password?") }}</a>
</div>
</form>
</div>

View File

@ -8,26 +8,34 @@
<div class="row ">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
<div class="text-center">
<h3 class="mb-4">{% trans "Password Reset" %}</h3>
</div>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}
<p>
{% trans "Forgotten your password? Enter your email address below, and we'll send you an email allowing you to reset it." %}
</p>
<form method="post" action="{% url 'account_reset_password' %}" class="form needs-validation" novalidate>
<form method="post"
action="{% url 'account_reset_password' %}"
class="form needs-validation"
novalidate>
{% csrf_token %}
{{ form|crispy }}
<button type="submit" class="btn btn-phoenix-primary btn-sm w-100">{% trans 'Reset My Password' %}</button>

View File

@ -1,5 +1,5 @@
{% extends "base.html" %}
{% load i18n static%}
{% load i18n static %}
{% load allauth %}
{% load account %}
{% block head_title %}
@ -9,18 +9,24 @@
<div class="row ">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
<div class="text-center">
<h3 class="mb-4">{% trans "Password Reset" %}</h3>
</div>
{% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %}
{% endif %}

View File

@ -9,11 +9,18 @@
<div class="row ">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
@ -26,7 +33,6 @@
{% endif %}
</h3>
</div>
{% if token_fail %}
{% url 'account_reset_password' as passwd_reset_url %}
<p>

View File

@ -1,5 +1,5 @@
{% extends "base.html" %}
{% load i18n static%}
{% load i18n static %}
{% load allauth %}
{% block head_title %}
{% trans "Change Password" %}
@ -8,20 +8,27 @@
<div class="row ">
<div class="row flex-center min-vh-50">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
<div class="text-center">
<h3 class="mb-4">{% trans "Change Password" %}</h3>
<p class="fs-9 fw-bold text-success">{% trans 'Your password is now changed.' %} <span class="far fa-check-circle ms-1"></span></p>
<p class="fs-9 fw-bold text-success">
{% trans 'Your password is now changed.' %} <span class="far fa-check-circle ms-1"></span>
</p>
</div>
</div>
</div>
</div>

View File

@ -6,20 +6,20 @@
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% trans "Set Password" %}
{% endelement %}
{% url 'account_set_password' as action_url %}
{% element form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{{ redirect_field }}
{% element fields form=form %}
{% endelement %}
{% endslot %}
{% slot actions %}
{% element button type="submit" name="action" %}
{% trans 'Set Password' %}
{% endelement %}
{% endslot %}
{% endelement %}
{% trans "Set Password" %}
{% endelement %}
{% url 'account_set_password' as action_url %}
{% element form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{{ redirect_field }}
{% element fields form=form %}
{% endelement %}
{% endslot %}
{% slot actions %}
{% element button type="submit" name="action" %}
{% trans 'Set Password' %}
{% endelement %}
{% endslot %}
{% endelement %}
{% endblock content %}

View File

@ -3,20 +3,20 @@
{% load i18n %}
{% block reauthenticate_content %}
{% element p %}
{% blocktranslate %}Enter your password:{% endblocktranslate %}
{% endelement %}
{% url 'account_reauthenticate' as action_url %}
{% element form form=form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{% element fields form=form unlabeled=True %}
{% endelement %}
{{ redirect_field }}
{% endslot %}
{% slot actions %}
{% element button type="submit" tags="primary,reauthenticate" %}
{% trans "Confirm" %}
{% endelement %}
{% endslot %}
{% endelement %}
{% blocktranslate %}Enter your password:{% endblocktranslate %}
{% endelement %}
{% url 'account_reauthenticate' as action_url %}
{% element form form=form method="post" action=action_url %}
{% slot body %}
{% csrf_token %}
{% element fields form=form unlabeled=True %}
{% endelement %}
{{ redirect_field }}
{% endslot %}
{% slot actions %}
{% element button type="submit" tags="primary,reauthenticate" %}
{% trans "Confirm" %}
{% endelement %}
{% endslot %}
{% endelement %}
{% endblock %}

View File

@ -6,27 +6,27 @@
{% endblock head_title %}
{% block content %}
{% element h1 %}
{% translate "Mail me a sign-in code" %}
{% endelement %}
{% element p %}
{% blocktranslate %}You will receive an email containing a special code for a password-free sign-in.{% endblocktranslate %}
{% endelement %}
{% url 'account_request_login_code' as login_url %}
{% element form form=form method="post" action=login_url tags="entrance,login" %}
{% slot body %}
{% csrf_token %}
{% element fields form=form unlabeled=True %}
{% endelement %}
{{ redirect_field }}
{% endslot %}
{% slot actions %}
{% element button type="submit" tags="prominent,login" %}
{% translate "Request Code" %}
{% endelement %}
{% endslot %}
{% endelement %}
{% url 'account_login' as login_url %}
{% element button href=login_url tags="link" %}
{% translate "Other sign-in options" %}
{% endelement %}
{% translate "Mail me a sign-in code" %}
{% endelement %}
{% element p %}
{% blocktranslate %}You will receive an email containing a special code for a password-free sign-in.{% endblocktranslate %}
{% endelement %}
{% url 'account_request_login_code' as login_url %}
{% element form form=form method="post" action=login_url tags="entrance,login" %}
{% slot body %}
{% csrf_token %}
{% element fields form=form unlabeled=True %}
{% endelement %}
{{ redirect_field }}
{% endslot %}
{% slot actions %}
{% element button type="submit" tags="prominent,login" %}
{% translate "Request Code" %}
{% endelement %}
{% endslot %}
{% endelement %}
{% url 'account_login' as login_url %}
{% element button href=login_url tags="link" %}
{% translate "Other sign-in options" %}
{% endelement %}
{% endblock content %}

View File

@ -1,96 +1,184 @@
{% extends "welcome_base.html" %}
{% load crispy_forms_filters %}
{% load i18n static %}
{% block content %}
<section class="main my-2">
<div class="container-fluid">
<div class="row form-container" id="form-container">
<div class="col-12 "><a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
</div>
</a>
<div class="text-center">
<h3 class="text-body-highlight">{% trans 'Sign Up' %}</h3>
<p class="text-body-tertiary fs-9">{% trans 'Create your account today' %}</p>
</div>
<div class="card theme-wizard" data-theme-wizard="data-theme-wizard">
<div class="card-header pt-3 pb-2 ">
<ul class="nav justify-content-between nav-wizard nav-wizard-success" role="tablist">
<li class="nav-item" role="presentation"><a class="nav-link active fw-semibold" href="#bootstrap-wizard-validation-tab1" data-bs-toggle="tab" data-wizard-step="1" aria-selected="true" role="tab">
<div class="text-center d-inline-block"><span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-lock"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Access' %}</span></div>
</a></li>
<li class="nav-item" role="presentation"><a class="nav-link fw-semibold" href="#bootstrap-wizard-validation-tab2" data-bs-toggle="tab" data-wizard-step="2" aria-selected="false" tabindex="-1" role="tab">
<div class="text-center d-inline-block"><span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-user"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Account' %}</span></div>
</a></li>
<li class="nav-item" role="presentation"><a class="nav-link fw-semibold" href="#bootstrap-wizard-validation-tab3" data-bs-toggle="tab" data-wizard-step="3" aria-selected="false" tabindex="-1" role="tab">
<div class="text-center d-inline-block"><span class="nav-item-circle-parent"><span class="nav-item-circle"><svg class="fa fa-file-lines"></svg></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Extra' %}</span></div>
</a></li>
<li class="nav-item" role="presentation"><a class="nav-link fw-semibold" href="#bootstrap-wizard-validation-tab4" data-bs-toggle="tab" data-wizard-step="4" aria-selected="false" tabindex="-1" role="tab">
<div class="text-center d-inline-block"><span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-check"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Done' %}</span></div>
</a></li>
</ul>
</div>
<div class="card-body pt-4 pb-0">
<div class="tab-content">
<div class="tab-pane active" role="tabpanel" aria-labelledby="bootstrap-wizard-validation-tab1" id="bootstrap-wizard-validation-tab1">
<form class="needs-validation" id="wizardValidationForm1" novalidate="novalidate" data-wizard-form="1">
{{form1|crispy}}
<a class="fs-10 text-decoration-none" href="{% url 'terms_and_privacy' %}" target="_blank">{{ _("Read Terms of Service and Privacy Policy")}}</a>
</form>
</div>
<div class="tab-pane" role="tabpanel" aria-labelledby="bootstrap-wizard-validation-tab2" id="bootstrap-wizard-validation-tab2">
<form class="needs-validation" id="wizardValidationForm2" novalidate="novalidate" data-wizard-form="2">
{{form2|crispy}}
</form>
</div>
<div class="tab-pane" role="tabpanel" aria-labelledby="bootstrap-wizard-validation-tab3" id="bootstrap-wizard-validation-tab3">
<form class="needs-validation" id="wizardValidationForm3" novalidate="novalidate" data-wizard-form="3">
{{form3|crispy}}
</form>
</div>
<div class="tab-pane" role="tabpanel" aria-labelledby="bootstrap-wizard-validation-tab4" id="bootstrap-wizard-validation-tab4">
<div class="row flex-center pb-8 pt-4 gx-3 gy-4">
<div class="col-12 col-sm-auto">
<div class="text-center text-sm-start"><img class="d-dark-none" src="{% static 'images/spot-illustrations/38.webp' %}" alt="" width="220"><img class="d-light-none" src="{% static 'images/spot-illustrations/dark_38.webp' %}" alt="" width="220"></div>
<section class="main my-2">
<div class="container-fluid">
<div class="row form-container" id="form-container">
<div class="col-12 ">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</a>
<div class="text-center">
<h3 class="text-body-highlight">{% trans 'Sign Up' %}</h3>
<p class="text-body-tertiary fs-9">{% trans 'Create your account today' %}</p>
</div>
<div class="col-12 col-sm-auto">
<div class="text-center text-sm-start">
<h5 class="mb-3">{% trans 'You are all set!' %}</h5>
<p class="text-body-emphasis fs-9">{% trans 'Now you can access your account' %}<br>{% trans 'anytime' %} {% trans 'anywhere' %}</p><button class="btn btn-primary px-6" id='submit_btn'>{% trans 'Submit' %}</button>
</div>
<div class="card theme-wizard" data-theme-wizard="data-theme-wizard">
<div class="card-header pt-3 pb-2 ">
<ul class="nav justify-content-between nav-wizard nav-wizard-success"
role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active fw-semibold"
href="#bootstrap-wizard-validation-tab1"
data-bs-toggle="tab"
data-wizard-step="1"
aria-selected="true"
role="tab">
<div class="text-center d-inline-block">
<span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-lock"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Access' %}</span>
</div>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fw-semibold"
href="#bootstrap-wizard-validation-tab2"
data-bs-toggle="tab"
data-wizard-step="2"
aria-selected="false"
tabindex="-1"
role="tab">
<div class="text-center d-inline-block">
<span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-user"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Account' %}</span>
</div>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fw-semibold"
href="#bootstrap-wizard-validation-tab3"
data-bs-toggle="tab"
data-wizard-step="3"
aria-selected="false"
tabindex="-1"
role="tab">
<div class="text-center d-inline-block">
<span class="nav-item-circle-parent"><span class="nav-item-circle">
<svg class="fa fa-file-lines">
</svg>
</span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Extra' %}</span>
</div>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fw-semibold"
href="#bootstrap-wizard-validation-tab4"
data-bs-toggle="tab"
data-wizard-step="4"
aria-selected="false"
tabindex="-1"
role="tab">
<div class="text-center d-inline-block">
<span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-check"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Done' %}</span>
</div>
</a>
</li>
</ul>
</div>
<div class="card-body pt-4 pb-0">
<div class="tab-content">
<div class="tab-pane active"
role="tabpanel"
aria-labelledby="bootstrap-wizard-validation-tab1"
id="bootstrap-wizard-validation-tab1">
<form class="needs-validation"
id="wizardValidationForm1"
novalidate="novalidate"
data-wizard-form="1">
{{ form1|crispy }}
<a class="fs-10 text-decoration-none"
href="{% url 'terms_and_privacy' %}"
target="_blank">{{ _("Read Terms of Service and Privacy Policy") }}</a>
</form>
</div>
<div class="tab-pane"
role="tabpanel"
aria-labelledby="bootstrap-wizard-validation-tab2"
id="bootstrap-wizard-validation-tab2">
<form class="needs-validation"
id="wizardValidationForm2"
novalidate="novalidate"
data-wizard-form="2">
{{ form2|crispy }}
</form>
</div>
<div class="tab-pane"
role="tabpanel"
aria-labelledby="bootstrap-wizard-validation-tab3"
id="bootstrap-wizard-validation-tab3">
<form class="needs-validation"
id="wizardValidationForm3"
novalidate="novalidate"
data-wizard-form="3">
{{ form3|crispy }}
</form>
</div>
<div class="tab-pane"
role="tabpanel"
aria-labelledby="bootstrap-wizard-validation-tab4"
id="bootstrap-wizard-validation-tab4">
<div class="row flex-center pb-8 pt-4 gx-3 gy-4">
<div class="col-12 col-sm-auto">
<div class="text-center text-sm-start">
<img class="d-dark-none"
src="{% static 'images/spot-illustrations/38.webp' %}"
alt=""
width="220">
<img class="d-light-none"
src="{% static 'images/spot-illustrations/dark_38.webp' %}"
alt=""
width="220">
</div>
</div>
<div class="col-12 col-sm-auto">
<div class="text-center text-sm-start">
<h5 class="mb-3">{% trans 'You are all set!' %}</h5>
<p class="text-body-emphasis fs-9">
{% trans 'Now you can access your account' %}
<br>
{% trans 'anytime' %} {% trans 'anywhere' %}
</p>
<button class="btn btn-primary px-6" id='submit_btn'>{% trans 'Submit' %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-footer border-top-0"
data-wizard-footer="data-wizard-footer">
<div class="d-flex pager wizard list-inline mb-0">
<button class="d-none btn btn-link ps-0"
type="button"
data-wizard-prev-btn="data-wizard-prev-btn">{% trans 'Previous' %}</button>
<div class="flex-1 text-end">
<button class="btn btn-phoenix-primary px-6 px-sm-6 next"
type="submit"
data-wizard-next-btn="data-wizard-next-btn">{% trans 'Next' %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-footer border-top-0" data-wizard-footer="data-wizard-footer">
<div class="d-flex pager wizard list-inline mb-0">
<button class="d-none btn btn-link ps-0" type="button" data-wizard-prev-btn="data-wizard-prev-btn">{% trans 'Previous' %}</button>
<div class="flex-1 text-end">
<button class="btn btn-phoenix-primary px-6 px-sm-6 next" type="submit" data-wizard-next-btn="data-wizard-next-btn">{% trans 'Next' %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="pt-lg-0 pt-xl-8">
{% include 'footer.html' %}
</section>
<script src="{% static 'js/phoenix.js' %}"></script>
</section>
<section class="pt-lg-0 pt-xl-8">
{% include 'footer.html' %}
</section>
<script src="{% static 'js/phoenix.js' %}"></script>
{% endblock content %}
{% block customJS %}
<script src="https://unpkg.com/just-validate@latest/dist/just-validate.production.min.js"></script>
<script>
<script src="https://unpkg.com/just-validate@latest/dist/just-validate.production.min.js"></script>
<script>
const validator = new JustValidate('#wizardValidationForm1', {
validateBeforeSubmitting: true,
});
@ -282,6 +370,5 @@
}
return cookieValue;
}
</script>
{% endblock customJS %}
</script>
{% endblock customJS %}

View File

@ -1,219 +1,325 @@
{% extends "welcome_base.html" %}
{% load crispy_forms_filters %}
{% load i18n static %}
{% block content %}
<section class="main my-2">
<div class="container" style="max-width:60rem;">
<div class="row form-container" id="form-container">
<div class="col-12 "><a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
</div>
</a>
<div class="text-center">
<h3 class="text-body-highlight">{% trans 'Sign Up' %}</h3>
<p class="text-body-tertiary fs-9">{% trans 'Create your account today' %}</p>
</div>
<div
data-signals="{
form1:{email:'',password:'',confirm_password:''},
form2:{name:'',arabic_name:'',phone_number:''},
form3:{crn:'',vrn:'',address:''},
form1_valid:true,
form2_valid:true,
form3_valid:true,
email_valid:true,
password_valid:true,
phone_number_valid:true
}"
class="card theme-wizard" data-theme-wizard="data-theme-wizard">
<div class="card-header pt-3 pb-2 ">
<ul class="nav justify-content-between nav-wizard nav-wizard-success" role="tablist">
<li class="nav-item" role="presentation"><a class="nav-link active fw-semibold" href="#bootstrap-wizard-validation-tab1" data-bs-toggle="tab" data-wizard-step="1" aria-selected="true" role="tab">
<div class="text-center d-inline-block"><span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-lock"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Access' %}</span></div>
</a></li>
<li class="nav-item" role="presentation"><a class="nav-link fw-semibold" href="#bootstrap-wizard-validation-tab2" data-bs-toggle="tab" data-wizard-step="2" aria-selected="false" tabindex="-1" role="tab">
<div class="text-center d-inline-block"><span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-user"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Account' %}</span></div>
</a></li>
<li class="nav-item" role="presentation"><a class="nav-link fw-semibold" href="#bootstrap-wizard-validation-tab3" data-bs-toggle="tab" data-wizard-step="3" aria-selected="false" tabindex="-1" role="tab">
<div class="text-center d-inline-block"><span class="nav-item-circle-parent"><span class="nav-item-circle"><svg class="fa fa-file-lines"></svg></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Extra' %}</span></div>
</a></li>
<li class="nav-item" role="presentation"><a class="nav-link fw-semibold" href="#bootstrap-wizard-validation-tab4" data-bs-toggle="tab" data-wizard-step="4" aria-selected="false" tabindex="-1" role="tab">
<div class="text-center d-inline-block"><span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-check"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Done' %}</span></div>
</a></li>
</ul>
<section class="main my-2">
<div class="container" style="max-width:60rem;">
<div class="row form-container" id="form-container">
<div class="col-12 ">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</a>
<div class="text-center">
<h3 class="text-body-highlight">{% trans 'Sign Up' %}</h3>
<p class="text-body-tertiary fs-9">{% trans 'Create your account today' %}</p>
</div>
<div data-signals="{ form1:{email:'',password:'',confirm_password:''}, form2:{name:'',arabic_name:'',phone_number:''}, form3:{crn:'',vrn:'',address:''}, form1_valid:true, form2_valid:true, form3_valid:true, email_valid:true, password_valid:true, phone_number_valid:true }"
class="card theme-wizard"
data-theme-wizard="data-theme-wizard">
<div class="card-header pt-3 pb-2 ">
<ul class="nav justify-content-between nav-wizard nav-wizard-success"
role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active fw-semibold"
href="#bootstrap-wizard-validation-tab1"
data-bs-toggle="tab"
data-wizard-step="1"
aria-selected="true"
role="tab">
<div class="text-center d-inline-block">
<span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-lock"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Access' %}</span>
</div>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fw-semibold"
href="#bootstrap-wizard-validation-tab2"
data-bs-toggle="tab"
data-wizard-step="2"
aria-selected="false"
tabindex="-1"
role="tab">
<div class="text-center d-inline-block">
<span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-user"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Account' %}</span>
</div>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fw-semibold"
href="#bootstrap-wizard-validation-tab3"
data-bs-toggle="tab"
data-wizard-step="3"
aria-selected="false"
tabindex="-1"
role="tab">
<div class="text-center d-inline-block">
<span class="nav-item-circle-parent"><span class="nav-item-circle">
<svg class="fa fa-file-lines">
</svg>
</span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Extra' %}</span>
</div>
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link fw-semibold"
href="#bootstrap-wizard-validation-tab4"
data-bs-toggle="tab"
data-wizard-step="4"
aria-selected="false"
tabindex="-1"
role="tab">
<div class="text-center d-inline-block">
<span class="nav-item-circle-parent"><span class="nav-item-circle"><span class="fa fa-check"></span></span></span><span class="d-none d-md-block mt-1 fs-9">{% trans 'Done' %}</span>
</div>
</a>
</li>
</ul>
</div>
<div class="card-body pt-4 pb-0">
<div class="tab-content" data-signals-current_form="1">
<div class="tab-pane active"
role="tabpanel"
aria-labelledby="bootstrap-wizard-validation-tab1"
id="bootstrap-wizard-validation-tab1">
<form class="needs-validation"
id="wizardValidationForm1"
novalidate="novalidate"
data-wizard-form="1"
data-ref-f1>
<div class="mb-3">
<label for="email"
data-class="{'text-danger':!$email_valid}"
class="form-label">
{% trans "Email" %}
<span data-show="!$email_valid" class="text-danger">*</span>
</label>
<input data-on-input="$email_valid = validateEmail($form1.email)"
data-on-blur="$email_valid = validateEmail($form1.email)"
data-bind-form1.email
data-class="{'is-invalid': !$email_valid , 'is-valid': ($email_valid && $form1.email)}"
type="email"
class="form-control"
id="email"
name="email"
required>
<div class="invalid-feedback" data-show="!$email_valid">{% trans "Please enter a valid email address" %}</div>
</div>
<div class="mb-3">
<label for="password" class="form-label">{% trans "Password" %}</label>
<input data-bind-form1.password
type="password"
data-on-input="$password_valid = validatePassword($form1.password,$form1.confirm_password)"
data-on-blur="$password_valid = validatePassword($form1.password,$form1.confirm_password)"
class="form-control"
data-class="{'is-invalid':($form1.password.length && $form1.password.length < 8),'is-valid':$form1.password.length > 8 }"
id="password"
name="password"
required>
<div class="invalid-feedback" data-show="!$password_valid">
{% trans "Password does not match. or length is less than 8 characters." %}
</div>
</div>
<div class="mb-3">
<label for="confirm_password" class="form-label">{% trans "Confirm Password" %}</label>
<span class="text-danger" data-show="!$password_valid">*</span>
<input data-bind-form1.confirm_password
data-on-input="$password_valid = validatePassword($form1.password,$form1.confirm_password)"
data-on-blur="$password_valid = validatePassword($form1.password,$form1.confirm_password)"
type="password"
class="form-control"
data-class="{'is-invalid':!$password_valid,'is-valid':($password_valid&& $form1.confirm_password)}"
id="confirm_password"
name="confirm_password"
required>
<div class="invalid-feedback" data-show="!$password_valid">
{% trans "Password does not match. or length is less than 8 characters." %}
</div>
</div>
</form>
</div>
<div class="tab-pane"
role="tabpanel"
aria-labelledby="bootstrap-wizard-validation-tab2"
id="bootstrap-wizard-validation-tab2">
<form class="needs-validation"
id="wizardValidationForm2"
novalidate="novalidate"
data-wizard-form="2"
data-ref-f2>
<div class="mb-3">
<label for="name" class="form-label">{% trans "Name" %}</label>
<input data-bind-form2.name
type="text"
class="form-control"
id="name"
name="name"
required>
</div>
<div class="mb-3">
<label for="arabic_name" class="form-label">{% trans "Arabic Name" %}</label>
<input data-bind-form2.arabic_name
type="text"
class="form-control"
id="arabic_name"
name="arabic_name"
required>
</div>
<div class="mb-3">
<label for="phone_number" class="form-label">{% trans "Phone Number" %}</label>
<span data-show="!$phone_number_valid" class="text-danger">*</span>
<input data-bind-form2.phone_number
type="tel"
data-class="{'is-invalid':!$phone_number_valid}"
class="form-control"
id="phone_number"
name="phone_number"
required
data-on-input="$phone_number_valid = validate_sa_phone_number($form2.phone_number)">
<div class="invalid-feedback" data-show="!$phone_number_valid">{% trans "Please enter a valid phone number" %}</div>
</div>
</form>
</div>
<div class="tab-pane"
role="tabpanel"
aria-labelledby="bootstrap-wizard-validation-tab3"
id="bootstrap-wizard-validation-tab3">
<form class="needs-validation"
id="wizardValidationForm3"
novalidate="novalidate"
data-wizard-form="3"
data-ref-f3>
<div class="mb-3">
<label for="crn" class="form-label">{% trans "CRN" %}</label>
<input data-bind-form3.crn
type="text"
class="form-control"
id="crn"
name="crn"
required>
</div>
<div class="mb-3">
<label for="vrn" class="form-label">{% trans "VRN" %}</label>
<input data-bind-form3.vrn
type="text"
class="form-control"
id="vrn"
name="vrn"
required>
</div>
<div class="mb-3">
<label for="address" class="form-label">{% trans "Address" %}</label>
<textarea data-bind-form3.address
class="form-control"
id="address"
name="address"
required></textarea>
</div>
</form>
</div>
<div class="tab-pane"
role="tabpanel"
aria-labelledby="bootstrap-wizard-validation-tab4"
id="bootstrap-wizard-validation-tab4">
<div class="row flex-center pb-8 pt-4 gx-3 gy-4">
<div class="col-12 col-sm-auto">
<div class="text-center text-sm-start">
<img class="d-dark-none"
src="{% static 'images/spot-illustrations/38.webp' %}"
alt=""
width="220">
<img class="d-light-none"
src="{% static 'images/spot-illustrations/dark_38.webp' %}"
alt=""
width="220">
</div>
</div>
<div class="col-12 col-sm-auto">
<div class="text-center text-sm-start">
<h5 class="mb-3">{% trans 'You are all set!' %}</h5>
<p class="text-body-emphasis fs-9">
{% trans 'Now you can access your account' %}
<br>
{% trans 'anytime' %} {% trans 'anywhere' %}
</p>
<button data-on-click="sendFormData()"
class="btn btn-primary px-6"
id='submit_btn'>{% trans 'Submit' %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-computed-form1_valid="validatePassword($form1.password,$form1.confirm_password) && validateEmail($form1.email)"
class="card-footer border-top-0"
data-wizard-footer="data-wizard-footer">
<div class="d-flex pager wizard list-inline mb-0">
<button class="d-none btn btn-link ps-0"
type="button"
data-wizard-prev-btn="data-wizard-prev-btn">{% trans 'Previous' %}</button>
<div class="flex-1 text-end">
<button data-attr-disabled="!$form1_valid"
data-attr-disabled="!$phone_number_valid"
class="btn btn-phoenix-primary px-6 px-sm-6 next"
type="button"
id="next_btn"
data-wizard-next-btn="data-wizard-next-btn">{% trans 'Next' %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-body pt-4 pb-0">
<div class="tab-content" data-signals-current_form="1">
<div class="tab-pane active" role="tabpanel" aria-labelledby="bootstrap-wizard-validation-tab1" id="bootstrap-wizard-validation-tab1">
<form class="needs-validation" id="wizardValidationForm1" novalidate="novalidate" data-wizard-form="1" data-ref-f1>
<div class="mb-3">
<label
for="email"
data-class="{'text-danger':!$email_valid}"
class="form-label">{% trans "Email"%}
<span
data-show="!$email_valid"
class="text-danger">*</span>
</label>
<input
data-on-input="$email_valid = validateEmail($form1.email)"
data-on-blur="$email_valid = validateEmail($form1.email)"
data-bind-form1.email
data-class="{'is-invalid': !$email_valid , 'is-valid': ($email_valid && $form1.email)}"
type="email"
class="form-control"
id="email"
name="email"
required>
<div class="invalid-feedback" data-show="!$email_valid">
{% trans "Please enter a valid email address" %}
</div>
</div>
<div class="mb-3">
<label for="password" class="form-label">{% trans "Password" %}</label>
<input
data-bind-form1.password
type="password"
data-on-input="$password_valid = validatePassword($form1.password,$form1.confirm_password)"
data-on-blur="$password_valid = validatePassword($form1.password,$form1.confirm_password)"
class="form-control"
data-class="{'is-invalid':($form1.password.length && $form1.password.length < 8),'is-valid':$form1.password.length > 8 }"
id="password"
name="password"
required>
<div class="invalid-feedback" data-show="!$password_valid">
{% trans "Password does not match. or length is less than 8 characters." %}
</div>
</div>
<div class="mb-3">
<label for="confirm_password" class="form-label">{% trans "Confirm Password" %}</label><span class="text-danger" data-show="!$password_valid">*</span>
<input
data-bind-form1.confirm_password
data-on-input="$password_valid = validatePassword($form1.password,$form1.confirm_password)"
data-on-blur="$password_valid = validatePassword($form1.password,$form1.confirm_password)"
type="password"
class="form-control"
data-class="{'is-invalid':!$password_valid,'is-valid':($password_valid&& $form1.confirm_password)}"
id="confirm_password"
name="confirm_password"
required>
<div class="invalid-feedback" data-show="!$password_valid">
{% trans "Password does not match. or length is less than 8 characters." %}
</div>
</div>
</form>
</div>
<div class="tab-pane" role="tabpanel" aria-labelledby="bootstrap-wizard-validation-tab2" id="bootstrap-wizard-validation-tab2">
<form class="needs-validation" id="wizardValidationForm2" novalidate="novalidate" data-wizard-form="2" data-ref-f2>
<div class="mb-3">
<label for="name" class="form-label">{% trans "Name" %}</label>
<input data-bind-form2.name type="text" class="form-control" id="name" name="name" required>
</div>
<div class="mb-3">
<label for="arabic_name" class="form-label">{% trans "Arabic Name" %}</label>
<input data-bind-form2.arabic_name type="text" class="form-control" id="arabic_name" name="arabic_name" required>
</div>
<div class="mb-3">
<label for="phone_number" class="form-label">{% trans "Phone Number" %}</label><span data-show="!$phone_number_valid" class="text-danger">*</span>
<input data-bind-form2.phone_number type="tel" data-class="{'is-invalid':!$phone_number_valid}" class="form-control" id="phone_number" name="phone_number" required
data-on-input="$phone_number_valid = validate_sa_phone_number($form2.phone_number)"
>
<div class="invalid-feedback" data-show="!$phone_number_valid">
{% trans "Please enter a valid phone number" %}
</div>
</div>
</form>
</div>
<div class="tab-pane" role="tabpanel" aria-labelledby="bootstrap-wizard-validation-tab3" id="bootstrap-wizard-validation-tab3">
<form class="needs-validation" id="wizardValidationForm3" novalidate="novalidate" data-wizard-form="3" data-ref-f3>
<div class="mb-3">
<label for="crn" class="form-label">{% trans "CRN" %}</label>
<input data-bind-form3.crn type="text" class="form-control" id="crn" name="crn" required>
</div>
<div class="mb-3">
<label for="vrn" class="form-label">{% trans "VRN" %}</label>
<input data-bind-form3.vrn type="text" class="form-control" id="vrn" name="vrn" required>
</div>
<div class="mb-3">
<label for="address" class="form-label">{% trans "Address" %}</label>
<textarea data-bind-form3.address class="form-control" id="address" name="address" required></textarea>
</div>
</form>
</div>
<div class="tab-pane" role="tabpanel" aria-labelledby="bootstrap-wizard-validation-tab4" id="bootstrap-wizard-validation-tab4">
<div class="row flex-center pb-8 pt-4 gx-3 gy-4">
<div class="col-12 col-sm-auto">
<div class="text-center text-sm-start"><img class="d-dark-none" src="{% static 'images/spot-illustrations/38.webp' %}" alt="" width="220"><img class="d-light-none" src="{% static 'images/spot-illustrations/dark_38.webp' %}" alt="" width="220"></div>
</div>
<div class="col-12 col-sm-auto">
<div class="text-center text-sm-start">
<h5 class="mb-3">{% trans 'You are all set!' %}</h5>
<p class="text-body-emphasis fs-9">{% trans 'Now you can access your account' %}<br>{% trans 'anytime' %} {% trans 'anywhere' %}</p><button data-on-click="sendFormData()" class="btn btn-primary px-6" id='submit_btn'>{% trans 'Submit' %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-computed-form1_valid="validatePassword($form1.password,$form1.confirm_password) && validateEmail($form1.email)" class="card-footer border-top-0" data-wizard-footer="data-wizard-footer">
<div class="d-flex pager wizard list-inline mb-0">
<button class="d-none btn btn-link ps-0" type="button" data-wizard-prev-btn="data-wizard-prev-btn">{% trans 'Previous' %}</button>
<div class="flex-1 text-end">
<button data-attr-disabled="!$form1_valid" data-attr-disabled="!$phone_number_valid" class="btn btn-phoenix-primary px-6 px-sm-6 next" type="button" id="next_btn" data-wizard-next-btn="data-wizard-next-btn">{% trans 'Next' %}</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="pt-lg-0 pt-xl-8">
{% include 'footer.html' %}
</section>
<script src="{% static 'js/phoenix.js' %}"></script>
{% endblock content %}
{% block customJS %}
</section>
<section class="pt-lg-0 pt-xl-8">
{% include 'footer.html' %}
</section>
<script src="{% static 'js/phoenix.js' %}"></script>
{% endblock content %}
{% block customJS %}
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'js/sweetalert2.all.min.js' %}"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@v1.0.0-beta.11/bundles/datastar.js"></script>
<script>
<script type="module"
src="https://cdn.jsdelivr.net/gh/starfederation/datastar@v1.0.0-beta.11/bundles/datastar.js"></script>
<script>
function validatePassword(password, confirmPassword) {
return password === confirmPassword && password.length > 7 && password !== '';
return password === confirmPassword && password.length > 7 && password !== '';
}
function validateEmail(email) {
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
return emailRegex.test(email) && email !== '';
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
return emailRegex.test(email) && email !== '';
}
function validateform2(name,arabic_name,phone_number) {
if (name === '' || arabic_name === '' || phone_number === '' || phone_number.length < 10 || !phone_number.startsWith('056')) {
return false;
}
return true
if (name === '' || arabic_name === '' || phone_number === '' || phone_number.length < 10 || !phone_number.startsWith('056')) {
return false;
}
return true
}
function validate_sa_phone_number(phone_number) {
const phone_numberRegex = /^056[0-9]{7}$/;
return phone_numberRegex.test(phone_number) && phone_numberRegex !== '';
const phone_numberRegex = /^056[0-9]{7}$/;
return phone_numberRegex.test(phone_number) && phone_numberRegex !== '';
}
function getAllFormData() {
const forms = document.querySelectorAll('.needs-validation');
const formData = {};
forms.forEach(form => {
const fields = form.querySelectorAll('input,textarea,select');
fields.forEach(field => {
formData[field.name] = field.value;
});
const forms = document.querySelectorAll('.needs-validation');
const formData = {};
forms.forEach(form => {
const fields = form.querySelectorAll('input,textarea,select');
fields.forEach(field => {
formData[field.name] = field.value;
});
return formData;
});
return formData;
}
function showLoading() {
@ -237,7 +343,7 @@
titleText: msg
});
}
function getCookie(name) {
function getCookie(name) {
let cookieValue = null;
if (document.cookie && document.cookie !== "") {
const cookies = document.cookie.split(";");
@ -252,32 +358,32 @@
return cookieValue;
}
async function sendFormData() {
const formData = getAllFormData();
const url = "{% url 'account_signup' %}";
const csrftoken = getCookie('csrftoken');
try {
showLoading();
const response = await fetch(url, {
method: 'POST',
headers: {
'X-CSRFToken': '{{csrf_token}}',
'Content-Type': 'application/json',
},
body: JSON.stringify(formData),
});
hideLoading();
const data = await response.json();
if (response.ok) {
notify("success","Account created successfully");
setTimeout(() => {
window.location.href = "{% url 'account_login' %}";
}, 1000);
} else {
notify("error",data.error);
}
} catch (error) {
notify("error",error);
const formData = getAllFormData();
const url = "{% url 'account_signup' %}";
const csrftoken = getCookie('csrftoken');
try {
showLoading();
const response = await fetch(url, {
method: 'POST',
headers: {
'X-CSRFToken': '{{csrf_token}}',
'Content-Type': 'application/json',
},
body: JSON.stringify(formData),
});
hideLoading();
const data = await response.json();
if (response.ok) {
notify("success","Account created successfully");
setTimeout(() => {
window.location.href = "{% url 'account_login' %}";
}, 1000);
} else {
notify("error",data.error);
}
} catch (error) {
notify("error",error);
}
}
</script>
{% endblock customJS %}
</script>
{% endblock customJS %}

View File

@ -1,18 +1,25 @@
{% extends "base.html" %}
{% load crispy_forms_filters %}
{% load allauth i18n static%}
{% block title %}{{ _("Sign Up") }}{% endblock title %}
{% load allauth i18n static %}
{% block title %}
{{ _("Sign Up") }}
{% endblock title %}
{% block content %}
<div class="row">
<div class="row min-vh-100 text-center">
<div class="col-sm-10 col-md-8 col-lg-5 col-xl-5 col-xxl-3">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</div>
</a>
@ -20,74 +27,76 @@
<h3 class="text-body-highlight">Sign Up</h3>
<p class="text-body-tertiary">Create your account today</p>
</div>
<!-- Passkey Signup -->
<!-- Passkey Signup -->
{% if PASSKEY_SIGNUP_ENABLED %}
<hr class="my-4">
<div class="d-grid gap-2">
<a href="{{ signup_by_passkey_url }}" class="btn btn-outline-primary btn-lg">
{{ _("Sign up using a passkey") }}
</a>
<a href="{{ signup_by_passkey_url }}"
class="btn btn-outline-primary btn-lg">{{ _("Sign up using a passkey") }}</a>
</div>
{% endif %}
<!-- Social Signup -->
<!-- Social Signup -->
{% if SOCIALACCOUNT_ENABLED %}
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %}
{% endif %}
<!-- Sign Up Form -->
{% if not SOCIALACCOUNT_ONLY %}
<form method="post" action="{% url 'account_signup' %}" class="needs-validation" novalidate>
<form method="post"
action="{% url 'account_signup' %}"
class="needs-validation"
novalidate>
{% csrf_token %}
{{ redirect_field }}
<div class="mb-3">
<label for="id_email" class="form-label">{{ form.email.label }}</label>
<input type="email" class="form-control" id="id_email" name="email" placeholder="name@example.com">
{% if form.email.errors %}
<div class="text-danger">{{ form.email.errors|striptags }}</div>
{% endif %}
<input type="email"
class="form-control"
id="id_email"
name="email"
placeholder="name@example.com">
{% if form.email.errors %}<div class="text-danger">{{ form.email.errors|striptags }}</div>{% endif %}
</div>
<div class="mb-3">
<label for="id_password1" class="form-label">{{ form.password1.label }}</label>
<div class="position-relative" data-password="data-password">
<input type="password" class="form-control form-icon-input pe-6" id="id_password1" name="password1" data-password-input="data-password-input" placeholder="Password">
<a class="btn px-3 py-0 h-100 position-absolute top-0 end-0 fs-7 text-body-tertiary" data-password-toggle="data-password-toggle"><span class="uil uil-eye show"></span><span class="uil uil-eye-slash hide"></span></a>
<input type="password"
class="form-control form-icon-input pe-6"
id="id_password1"
name="password1"
data-password-input="data-password-input"
placeholder="Password">
<a class="btn px-3 py-0 h-100 position-absolute top-0 end-0 fs-7 text-body-tertiary"
data-password-toggle="data-password-toggle"><span class="uil uil-eye show"></span><span class="uil uil-eye-slash hide"></span></a>
</div>
{% if form.password1.errors %}
<div class="text-danger">{{ form.password1.errors|striptags }}</div>
{% endif %}
{% if form.password1.errors %}<div class="text-danger">{{ form.password1.errors|striptags }}</div>{% endif %}
</div>
<div class="mb-3">
<label for="id_password2" class="form-label">{{ form.password2.label }}</label>
<div class="position-relative" data-password="data-password">
<input type="password" class="form-control form-icon-input pe-6" id="id_password2" name="password2" data-password-input="data-password-input" placeholder="Confirm Password">
<a class="btn px-3 py-0 h-100 position-absolute top-0 end-0 fs-7 text-body-tertiary" data-password-toggle="data-password-toggle"><span class="uil uil-eye show"></span><span class="uil uil-eye-slash hide"></span></a>
<input type="password"
class="form-control form-icon-input pe-6"
id="id_password2"
name="password2"
data-password-input="data-password-input"
placeholder="Confirm Password">
<a class="btn px-3 py-0 h-100 position-absolute top-0 end-0 fs-7 text-body-tertiary"
data-password-toggle="data-password-toggle"><span class="uil uil-eye show"></span><span class="uil uil-eye-slash hide"></span></a>
</div>
{% if form.password2.errors %}
<div class="text-danger">{{ form.password2.errors|striptags }}</div>
{% endif %}
{% if form.password2.errors %}<div class="text-danger">{{ form.password2.errors|striptags }}</div>{% endif %}
</div>
<div class="form-check mb-3">
<input class="form-check-input" id="termsService" type="checkbox" />
<label class="form-label fs-9 text-transform-none" for="termsService">I accept the <a href="">terms </a>and <a href="">privacy policy</a></label>
<label class="form-label fs-9 text-transform-none" for="termsService">
I accept the <a href="">terms</a>and <a href="">privacy policy</a>
</label>
</div>
<button type="submit" class="btn btn-phoenix-primary w-100 mb-3">{{ _("Sign Up") }}</button>
<div class="text-center">{% trans 'Already have an account?' %}<a class="fw-bold" href="{% url 'account_login' %}"> {{ _("Sign In") }}</a></div>
<div class="text-center">
{% trans 'Already have an account?' %}<a class="fw-bold" href="{% url 'account_login' %}">{{ _("Sign In") }}</a>
</div>
</form>
{% endif %}
</div>
</div>
</div>
{% endblock content %}
{% endblock content %}

View File

@ -2,10 +2,8 @@
{% load account %}
{% load allauth %}
{% user_display user as user_display %}
<div class="alert alert-phoenix-danger d-flex fs-9" role="alert">
<span class="fas fa-info-circle fs-8 me-3"></span>
<strong>{% trans 'Note' %}:</strong>
{% blocktranslate %}You are already logged in as {{ user_display }}.{% endblocktranslate %}
<span class="fas fa-info-circle fs-8 me-3"></span>
<strong>{% trans 'Note' %}:</strong>
{% blocktranslate %}You are already logged in as {{ user_display }}.{% endblocktranslate %}
</div>

View File

@ -1,4 +1,4 @@
{% load i18n allauth %}
{% element p %}
<strong>{% trans 'Warning:' %}</strong> {% trans "You currently do not have any email address set up. You should really add an email address so you can receive notifications, reset your password, etc." %}
<strong>{% trans 'Warning:' %}</strong> {% trans "You currently do not have any email address set up. You should really add an email address so you can receive notifications, reset your password, etc." %}
{% endelement %}

View File

@ -3,49 +3,35 @@
{% load i18n static %}
{% load allauth account %}
{% block title %}
{% trans 'User Settings' %}
{% trans 'User Settings' %}
{% endblock %}
{% block content %}
<form action="" method="post">
{% csrf_token %}
<div class="col-12 col-xl-8">
<div class=" mb-4">
<div class="row gx-3 mb-4 gy-6 gy-sm-3">
<div class="col-12 col-sm-8">
<h4 class="mb-4">Default Invoice Accounts</h4>
<div class="form-icon-container mb-3">
{{ form.invoice_cash_account|as_crispy_field }}
<form action="" method="post">
{% csrf_token %}
<div class="col-12 col-xl-8">
<div class=" mb-4">
<div class="row gx-3 mb-4 gy-6 gy-sm-3">
<div class="col-12 col-sm-8">
<h4 class="mb-4">Default Invoice Accounts</h4>
<div class="form-icon-container mb-3">{{ form.invoice_cash_account|as_crispy_field }}</div>
<div class="form-icon-container mb-3">{{ form.invoice_prepaid_account|as_crispy_field }}</div>
<div class="form-icon-container mb-3">{{ form.invoice_unearned_account|as_crispy_field }}</div>
</div>
</div>
<div class="row gx-3 mb-4 gy-6 gy-sm-3">
<div class="col-12 col-sm-8">
<h4 class="mb-4">Default Bill Accounts</h4>
<div class="form-icon-container mb-3">{{ form.bill_cash_account|as_crispy_field }}</div>
<div class="form-icon-container mb-3">{{ form.bill_prepaid_account|as_crispy_field }}</div>
<div class="form-icon-container mb-3">{{ form.bill_unearned_account|as_crispy_field }}</div>
</div>
</div>
<div class="text-start mb-6">
<div>
<button type="submit" class="btn btn-phoenix-primary">Update</button>
</div>
</div>
</div>
<div class="form-icon-container mb-3">
{{ form.invoice_prepaid_account|as_crispy_field }}
</div>
<div class="form-icon-container mb-3">
{{ form.invoice_unearned_account|as_crispy_field }}
</div>
</div>
</div>
<div class="row gx-3 mb-4 gy-6 gy-sm-3">
<div class="col-12 col-sm-8">
<h4 class="mb-4">Default Bill Accounts</h4>
<div class="form-icon-container mb-3">
{{ form.bill_cash_account|as_crispy_field }}
</div>
<div class="form-icon-container mb-3">
{{ form.bill_prepaid_account|as_crispy_field }}
</div>
<div class="form-icon-container mb-3">
{{ form.bill_unearned_account|as_crispy_field }}
</div>
</div>
</div>
<div class="text-start mb-6">
<div>
<button type="submit" class="btn btn-phoenix-primary">Update</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
</form>
{% endblock %}

View File

@ -1,25 +1,27 @@
{% extends "base.html" %}
{% load i18n static%}
{% load i18n static %}
{% load allauth %}
{% block head_title %}
{% trans "Verify Your Email Address" %}
{% endblock head_title %}
{% block content %}
<div class="row">
<div class="row flex-center min-vh-50 py-5">
<div class="col-sm-10 col-md-8 col-lg-5 col-xxl-4">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</a>
<h3>
{% trans "Verify Your Email Address" %}
</h3>
<h3>{% trans "Verify Your Email Address" %}</h3>
<p>
{% blocktrans %}We have sent an email to you for verification. Follow the link provided to finalize the signup process. If you do not see the verification email in your main inbox, check your spam folder. Please contact us if you do not receive the verification email within a few minutes.{% endblocktrans %}
</p>

View File

@ -8,16 +8,20 @@
<div class="row">
<div class="row flex-center min-vh-50 py-5">
<div class="col-sm-10 col-md-8 col-lg-5 col-xxl-4">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</a>
<h3>
{% trans "Verify Your Email Address" %}
</h3>
<h3>{% trans "Verify Your Email Address" %}</h3>
<p>
{% blocktrans %}We have sent an email to you for verification. Follow the link provided to finalize the signup process. If you do not see the verification email in your main inbox, check your spam folder. Please contact us if you do not receive the verification email within a few minutes.{% endblocktrans %}
</p>

View File

@ -1,5 +1,5 @@
{% extends "base.html" %}
{% load i18n static%}
{% load i18n static %}
{% load allauth %}
{% block head_title %}
{% trans "Verify Your Email Address" %}
@ -8,16 +8,20 @@
<div class="row">
<div class="row flex-center min-vh-50 py-5">
<div class="col-sm-10 col-md-8 col-lg-5 col-xxl-4">
<a class="d-flex flex-center text-decoration-none mb-4" href="{% url 'home' %}">
<a class="d-flex flex-center text-decoration-none mb-4"
href="{% url 'home' %}">
<div class="d-flex align-items-center fw-bolder fs-3 d-inline-block">
<img class="d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-light-none" src="{% static 'images/logos/logo.png' %}" alt="{% trans 'home' %}" width="58" />
<img class="d-dark-none"
src="{% static 'images/logos/logo-d.png' %}"
alt="{% trans 'home' %}"
width="58" />
<img class="d-light-none"
src="{% static 'images/logos/logo.png' %}"
alt="{% trans 'home' %}"
width="58" />
</div>
</a>
<h3>
{% trans "Verify Your Email Address" %}
</h3>
<h3>{% trans "Verify Your Email Address" %}</h3>
{% url 'account_email' as email_url %}
<p>
{% blocktrans %}This part of the site requires us to verify that

View File

@ -1,7 +1,8 @@
{% extends "base.html" %}
{% load i18n custom_filters %}
{% block title %}{% trans "Accounts" %}{% endblock title %}
{% block title %}
{% trans "Accounts" %}
{% endblock title %}
{% block accounts %}
<a class="nav-link active fw-bold">
{% trans "Accounts"|capfirst %}
@ -10,18 +11,17 @@
{% endblock %}
{% block content %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class=""><i class="fas fa-right-to-bracket me-2"></i> {% trans "Audit Log Dashboard" %}</h3>
<h3 class="">
<i class="fas fa-right-to-bracket me-2"></i> {% trans "Audit Log Dashboard" %}
</h3>
</div>
<!-- Log Type Tabs -->
<div class="mb-4">
{% include 'admin_management/nav.html' %}
<div class="tab-content p-3 border border-top-0 rounded-bottom" id="accountTypeTabsContent">
<div class="tab-content p-3 border border-top-0 rounded-bottom"
id="accountTypeTabsContent">
<!-- modellogs Tab -->
{% if page_obj %}
<div class="table-responsive px-1 scrollbar mt-3">
<table class= "table align-items-center table-flush table-hover">
@ -37,38 +37,23 @@
<tbody class="list">
{% for event in page_obj.object_list %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap">{{event.datetime}}</td>
<td class="align-middle product white-space-nowrap">{{ event.datetime }}</td>
<td class="align-middle product white-space-nowrap">{{ event.user.username|default:"N/A" }}</td>
<td class="align-middle product white-space-nowrap">{{ event.get_login_type_display}}</td>
<td class="align-middle product white-space-nowrap">{{ event.username}}</td>
<td class="align-middle product white-space-nowrap">{{ event.remote_ip}}</td>
<td class="align-middle product white-space-nowrap">{{ event.get_login_type_display }}</td>
<td class="align-middle product white-space-nowrap">{{ event.username }}</td>
<td class="align-middle product white-space-nowrap">{{ event.remote_ip }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% include 'partials/pagination.html' with q='loginEvents' %}
</div>
<div class="d-flex">{% include 'partials/pagination.html' with q='loginEvents' %}</div>
</div>
{% else %}
<p>No authentication audit events found.</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,4 +1,3 @@
{% extends 'base.html' %}
{% load i18n %}
{% load crispy_forms_filters %}
@ -16,37 +15,27 @@
</form>
</div>
</div> {% endcomment %}
<!---->
<div class="row justify-content-center mt-5 mb-3">
<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">
<h3 class="mb-0 fs-4 text-center text-white">
{% trans 'Activate Account'%}
</h3>
</div>
<div class="card-body bg-light-subtle">
<p class="text-center">Are you sure you want to activate this account "{{ obj.email }}"?</p>
<form method="post">
{% csrf_token %}
<hr class="my-2">
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-3">
<button class="btn btn-lg btn-phoenix-primary md-me-2" type="submit">{{ _("Activate") }}</button>
<a class="btn btn-lg btn-phoenix-danger mx-2" href="{% url 'user_management' request.dealer.slug %}">Cancel</a>
</div>
</form>
<div class="row justify-content-center mt-5 mb-3">
<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">
<h3 class="mb-0 fs-4 text-center text-white">{% trans 'Activate Account' %}</h3>
</div>
<div class="card-body bg-light-subtle">
<p class="text-center">Are you sure you want to activate this account "{{ obj.email }}"?</p>
<form method="post">
{% csrf_token %}
<hr class="my-2">
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-3">
<button class="btn btn-lg btn-phoenix-primary md-me-2" type="submit">{{ _("Activate") }}</button>
<a class="btn btn-lg btn-phoenix-danger mx-2"
href="{% url 'user_management' request.dealer.slug %}">Cancel</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!---->
{% endblock %}

View File

@ -1,29 +1,28 @@
{% extends "base.html" %}
{% load i18n %}
{%block title%} {%trans 'Admin Management' %} {%endblock%}
{% block content %}
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-4 g-4 mt-10">
<div class="col">
<a href="{% url 'user_management' request.dealer.slug %}">
<div class="card h-100">
<div class="card-header text-center">
<h5 class="card-title">{{ _("User Management")}}</h5>
<span class="me-2"><i class="fas fa-user fa-2x"></i></span>
{% block title %}
{% trans 'Admin Management' %} {% endblock %}
{% block content %}
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-4 g-4 mt-10">
<div class="col">
<a href="{% url 'user_management' request.dealer.slug %}">
<div class="card h-100">
<div class="card-header text-center">
<h5 class="card-title">{{ _("User Management") }}</h5>
<span class="me-2"><i class="fas fa-user fa-2x"></i></span>
</div>
</div>
</div>
</a>
</div>
<div class="col">
<a href="{% url 'audit_log_dashboard' request.dealer.slug %}">
<div class="card h-100">
<div class="card-header text-center">
<h5 class="card-title">{{ _("Audit Log Dashboard")}}</h5>
<span class="me-2"><i class="fas fa-user fa-2x"></i></span>
</a>
</div>
<div class="col">
<a href="{% url 'audit_log_dashboard' request.dealer.slug %}">
<div class="card h-100">
<div class="card-header text-center">
<h5 class="card-title">{{ _("Audit Log Dashboard") }}</h5>
<span class="me-2"><i class="fas fa-user fa-2x"></i></span>
</div>
</div>
</div>
</a>
</a>
</div>
</div>
</div>
{% endblock content %}
{% endblock content %}

View File

@ -1,7 +1,8 @@
{% extends "base.html" %}
{% load i18n custom_filters %}
{% block title %}{% trans "Accounts" %}{% endblock title %}
{% block title %}
{% trans "Accounts" %}
{% endblock title %}
{% block accounts %}
<a class="nav-link active fw-bold">
{% trans "Accounts"|capfirst %}
@ -10,18 +11,17 @@
{% endblock %}
{% block content %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class=""><i class="fas fa-history me-2"></i>{% trans "Audit Log Dashboard" %}</h3>
<h3 class="">
<i class="fas fa-history me-2"></i>{% trans "Audit Log Dashboard" %}
</h3>
</div>
<!-- Log Type Tabs -->
<div class="mb-4">
{% include 'admin_management/nav.html' %}
<div class="tab-content p-3 border border-top-0 rounded-bottom" id="accountTypeTabsContent">
<div class="tab-content p-3 border border-top-0 rounded-bottom"
id="accountTypeTabsContent">
<!-- modellogs Tab -->
{% if page_obj %}
<div class="table-responsive px-1 scrollbar mt-3">
<table class="table align-items-center table-flush table-hover mt-3">
@ -33,51 +33,53 @@
<th>{% trans "Model" %}</th>
<th>{% trans "Object ID" %}</th>
<th>{% trans "Object Representation" %}</th>
<th>{% trans "Field" %}</th> {# Dedicated column for field name #}
<th>{% trans "Old Value" %}</th> {# Dedicated column for old value #}
<th>{% trans "New Value" %}</th> {# Dedicated column for new value #}
<th>{% trans "Field" %}</th>
{# Dedicated column for field name #}
<th>{% trans "Old Value" %}</th>
{# Dedicated column for old value #}
<th>{% trans "New Value" %}</th>
{# Dedicated column for new value #}
</tr>
</thead>
<tbody>
{% for event in page_obj.object_list %}
{% for event in page_obj.object_list %}
{% if event.field_changes %}
{# Loop through each individual field change for this event #}
{# Loop through each individual field change for this event #}
{% for change in event.field_changes %}
<tr>
{# Display common event details using rowspan for the first change #}
{# Display common event details using rowspan for the first change #}
{% if forloop.first %}
<td rowspan="{{ event.field_changes|length }}">
{{ event.datetime|date:"Y-m-d H:i:s" }}
</td>
<td rowspan="{{ event.field_changes|length }}">
{{ event.user.username|default:"Anonymous" }}
</td>
<td rowspan="{{ event.field_changes|length }}">
{{ event.event_type_display }}
</td>
<td rowspan="{{ event.field_changes|length }}">
{{ event.model_name|title }}
</td>
<td rowspan="{{ event.field_changes|length }}">
{{ event.object_id }}
</td>
<td rowspan="{{ event.field_changes|length }}">
{{ event.object_repr }}
</td>
<td rowspan="{{ event.field_changes|length }}">{{ event.datetime|date:"Y-m-d H:i:s" }}</td>
<td rowspan="{{ event.field_changes|length }}">{{ event.user.username|default:"Anonymous" }}</td>
<td rowspan="{{ event.field_changes|length }}">{{ event.event_type_display }}</td>
<td rowspan="{{ event.field_changes|length }}">{{ event.model_name|title }}</td>
<td rowspan="{{ event.field_changes|length }}">{{ event.object_id }}</td>
<td rowspan="{{ event.field_changes|length }}">{{ event.object_repr }}</td>
{% endif %}
{# Display the specific field change details in their own columns #}
<td><strong>{{ change.field }}</strong></td>
{# Display the specific field change details in their own columns #}
<td>
<strong>{{ change.field }}</strong>
</td>
<td>
{% if change.old is not None %}
<pre style="white-space: pre-wrap; word-break: break-all; font-size: 0.85em; background-color: #f8f9fa; padding: 5px; border-radius: 3px;">{{ change.old }}</pre>
<pre style="white-space: pre-wrap;
word-break: break-all;
font-size: 0.85em;
background-color: #f8f9fa;
padding: 5px;
border-radius: 3px">{{ change.old }}</pre>
{% else %}
(None)
{% endif %}
</td>
<td>
{% if change.new is not None %}
<pre style="white-space: pre-wrap; word-break: break-all; font-size: 0.85em; background-color: #f8f9fa; padding: 5px; border-radius: 3px;">{{ change.new }}</pre>
<pre style="white-space: pre-wrap;
word-break: break-all;
font-size: 0.85em;
background-color: #f8f9fa;
padding: 5px;
border-radius: 3px">{{ change.new }}</pre>
{% else %}
(None)
{% endif %}
@ -85,7 +87,7 @@
</tr>
{% endfor %}
{% else %}
{# Fallback for events with no specific field changes (e.g., CREATE, DELETE) #}
{# Fallback for events with no specific field changes (e.g., CREATE, DELETE) #}
<tr>
<td>{{ event.datetime|date:"Y-m-d H:i:s" }}</td>
<td>{{ event.user.username|default:"Anonymous" }}</td>
@ -93,7 +95,7 @@
<td>{{ event.model_name|title }}</td>
<td>{{ event.object_id }}</td>
<td>{{ event.object_repr }}</td>
{# Span the 'Field', 'Old Value', 'New Value' columns #}
{# Span the 'Field', 'Old Value', 'New Value' columns #}
<td>
{% if event.event_type_display == "Create" %}
{% trans "Object created." %}
@ -108,26 +110,14 @@
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% include 'partials/pagination.html' with q='userActions' %}
</div>
<div class="d-flex">{% include 'partials/pagination.html' with q='userActions' %}</div>
</div>
{% else %}
<p>{% trans "No model change audit events found." %}</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,6 +1,5 @@
{% load i18n %}
<ul class="nav nav-tabs" id="accountTypeTabs" role="tablist">
<li class="nav-item me-3" role="presentation">
<a href="{% url 'audit_log_dashboard' request.dealer.slug %}?q=userActions">
<i class="fas fa-history me-2"></i>{% trans "User Actions" %}

View File

@ -14,38 +14,31 @@
</form>
</div>
</div> {% endcomment %}
<!---->
<div class="row justify-content-center mt-5 mb-3">
<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">
<h3 class="mb-0 fs-4 text-center text-white">
{% trans 'Delete Account'%}
</h3>
</div>
<div class="card-body bg-light-subtle">
<p class="lead text-center">Are you sure you want to delete this account "{{ obj.email }}"? This will delete all associated information for this user.</p>
<form method="post">
{% csrf_token %}
<hr class="my-2">
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-3">
<button class="btn btn-lg btn-phoenix-danger md-me-2" type="submit"><i class="fas fa-trash me-2"></i>{{ _("Delete Permenantly") }}</button>
<a class="btn btn-lg btn-phoenix-secondary mx-2" href="{% url 'user_management' request.dealer.slug %}"><i class="fas fa-ban me-2"></i>Cancel</a>
</div>
</form>
<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">
<h3 class="mb-0 fs-4 text-center text-white">{% trans 'Delete Account' %}</h3>
</div>
<div class="card-body bg-light-subtle">
<p class="lead text-center">
Are you sure you want to delete this account "{{ obj.email }}"? This will delete all associated information for this user.
</p>
<form method="post">
{% csrf_token %}
<hr class="my-2">
<div class="d-grid gap-2 d-md-flex justify-content-md-center mt-3">
<button class="btn btn-lg btn-phoenix-danger md-me-2" type="submit">
<i class="fas fa-trash me-2"></i>{{ _("Delete Permenantly") }}
</button>
<a class="btn btn-lg btn-phoenix-secondary mx-2"
href="{% url 'user_management' request.dealer.slug %}"><i class="fas fa-ban me-2"></i>Cancel</a>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!---->
{% endblock %}

View File

@ -1,7 +1,8 @@
{% extends "base.html" %}
{% load i18n custom_filters %}
{% block title %}{% trans "Accounts" %}{% endblock title %}
{% block title %}
{% trans "Accounts" %}
{% endblock title %}
{% block accounts %}
<a class="nav-link active fw-bold">
{% trans "Accounts"|capfirst %}
@ -10,16 +11,16 @@
{% endblock %}
{% block content %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class=""><i class="fas fa-file-alt me-2"></i> {% trans "Audit Log Dashboard" %}</h3>
<h3 class="">
<i class="fas fa-file-alt me-2"></i> {% trans "Audit Log Dashboard" %}
</h3>
</div>
<!-- Log Type Tabs -->
<div class="mb-4">
{% include 'admin_management/nav.html' %}
<div class="tab-content p-3 border border-top-0 rounded-bottom" id="accountTypeTabsContent">
<div class="tab-content p-3 border border-top-0 rounded-bottom"
id="accountTypeTabsContent">
<!-- modellogs Tab -->
{% if page_obj %}
<div class="table-responsive px-1 scrollbar mt-3">
@ -36,34 +37,23 @@
<tbody class="list">
{% for event in page_obj.object_list %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap">{{event.datetime}}</td>
<td class="align-middle product white-space-nowrap">{{ event.datetime }}</td>
<td class="align-middle product white-space-nowrap">{{ event.user.username|default:"Anonymous" }}</td>
<td class="align-middle product white-space-nowrap">{{ event.url }}</td>
<td class="align-middle product white-space-nowrap">{{ event.method}}</td>
<td class="align-middle product white-space-nowrap">{{ event.remote_ip}}</td>
<td class="align-middle product white-space-nowrap">{{ event.method }}</td>
<td class="align-middle product white-space-nowrap">{{ event.remote_ip }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% include 'partials/pagination.html' with q='userRequests' %}
</div>
<div class="d-flex">{% include 'partials/pagination.html' with q='userRequests' %}</div>
</div>
{% else %}
<p>No request audit events found.</p>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,271 +1,322 @@
{% extends 'base.html' %}
{% load i18n static humanize %}
{% block title %}
{% trans 'User Management' %}
{% trans 'User Management' %}
{% endblock title %}
{% block content %}
<section class="pt-5 pb-9">
<div class="row">
<h2 class="mb-4"><i class="fa-solid fa-people-roof me-1"></i> {% trans 'User Management' %}</h2>
<div class="row g-3 justify-content-between mb-4">
<div class="col-12">
<h3 class="mb-3">{% trans 'Customers' %}</h3>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('First Name') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Last Name') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Email') }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase " scope="col" style="width:15%;">{{ _('Status') }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase" scope="col" style="width:15%;">{{ _('Created date') }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col">{{ _('Actions') }}</th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for customer in customers %}
<tr>
<td class="ps-0">{{ customer.first_name }}</td>
<td class="ps-0">{{ customer.last_name }}</td>
<td class="ps-0">{{ customer.email }}</td>
<td class="ps-0">
{% if customer.active %}
<span class="fas fa-check-circle text-success"></span> {{ _('Active') }}
{% else %}
<span class="fas fa-times-circle text-danger"></span> {{ _('Inactive') }}
{% endif %}
</td>
<td class="ps-0">{{ customer.created|naturalday|capfirst }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button
class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'activate_account' request.dealer.slug 'customer' customer.slug %}"><button class="dropdown-item text-primary">{% trans "Activate" %}</button></a>
<div class="dropdown-divider"></div>
<a href="{% url 'permenant_delete_account' request.dealer.slug 'customer' customer.slug %}"><button class="dropdown-item text-danger">{% trans "Permenantly Delete" %}</button></a>
<section class="pt-5 pb-9">
<div class="row">
<h2 class="mb-4">
<i class="fa-solid fa-people-roof me-1"></i> {% trans 'User Management' %}
</h2>
<div class="row g-3 justify-content-between mb-4">
<div class="col-12">
<h3 class="mb-3">{% trans 'Customers' %}</h3>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("First Name") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Last Name") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Email") }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase"
scope="col"
style="width:15%">{{ _("Status") }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase"
scope="col"
style="width:15%">{{ _("Created date") }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col">{{ _("Actions") }}</th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for customer in customers %}
<tr>
<td class="ps-0">{{ customer.first_name }}</td>
<td class="ps-0">{{ customer.last_name }}</td>
<td class="ps-0">{{ customer.email }}</td>
<td class="ps-0">
{% if customer.active %}
<span class="fas fa-check-circle text-success"></span> {{ _("Active") }}
{% else %}
<span class="fas fa-times-circle text-danger"></span> {{ _("Inactive") }}
{% endif %}
</td>
<td class="ps-0">{{ customer.created|naturalday|capfirst }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'activate_account' request.dealer.slug 'customer' customer.slug %}">
<button class="dropdown-item text-primary">{% trans "Activate" %}</button>
</a>
<div class="dropdown-divider"></div>
<a href="{% url 'permenant_delete_account' request.dealer.slug 'customer' customer.slug %}">
<button class="dropdown-item text-danger">{% trans "Permenantly Delete" %}</button>
</a>
</div>
</div>
</td>
</tr>
{% empty %}
<td colspan="6" class="text-center">{% trans 'No data available in table' %}</td>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</td>
</tr>
{% empty %}
<td colspan="6" class="text-center">{% trans 'No data available in table' %}</td>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-12">
<h3 class="mb-3">{% trans 'Organizations' %}</h3>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Name') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Arabic Name') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Email') }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase " scope="col" style="width:15%;">{{ _('Status') }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase" scope="col" style="width:15%;">{{ _('Create date') }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col">{{ _('Actions') }}</th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for organization in organizations %}
<tr>
<td class="ps-0">{{ organization.name }}</td>
<td class="ps-0">{{ organization.arabic_name }}</td>
<td class="ps-0">{{ organization.email }}</td>
<td class="ps-0">
{% if customer.active %}
<span class="fas fa-check-circle text-success"></span> {{ _('Active') }}
{% else %}
<span class="fas fa-times-circle text-danger"></span> {{ _('Inactive') }}
{% endif %}
</td>
<td class="ps-0">{{ organization.created|naturalday|capfirst }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button
class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'activate_account' request.dealer.slug 'organization' organization.slug %}"><button class="dropdown-item text-primary">{% trans "Activate" %}</button></a>
<div class="dropdown-divider"></div>
<a href="{% url 'permenant_delete_account' request.dealer.slug 'organization' organization.slug %}"><button class="dropdown-item text-danger">{% trans "Permenantly Delete" %}</button></a>
<div class="row mt-5">
<div class="col-12">
<h3 class="mb-3">{% trans 'Organizations' %}</h3>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Name") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Arabic Name") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Email") }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase"
scope="col"
style="width:15%">{{ _("Status") }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase"
scope="col"
style="width:15%">{{ _("Create date") }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col">{{ _("Actions") }}</th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for organization in organizations %}
<tr>
<td class="ps-0">{{ organization.name }}</td>
<td class="ps-0">{{ organization.arabic_name }}</td>
<td class="ps-0">{{ organization.email }}</td>
<td class="ps-0">
{% if customer.active %}
<span class="fas fa-check-circle text-success"></span> {{ _("Active") }}
{% else %}
<span class="fas fa-times-circle text-danger"></span> {{ _("Inactive") }}
{% endif %}
</td>
<td class="ps-0">{{ organization.created|naturalday|capfirst }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'activate_account' request.dealer.slug 'organization' organization.slug %}">
<button class="dropdown-item text-primary">{% trans "Activate" %}</button>
</a>
<div class="dropdown-divider"></div>
<a href="{% url 'permenant_delete_account' request.dealer.slug 'organization' organization.slug %}">
<button class="dropdown-item text-danger">{% trans "Permenantly Delete" %}</button>
</a>
</div>
</div>
</td>
</tr>
{% empty %}
<td colspan="6" class="text-center">{% trans 'No data available in table' %}</td>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</td>
</tr>
{% empty %}
<td colspan="6" class="text-center">{% trans 'No data available in table' %}</td>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-12">
<h3 class="mb-3">{% trans 'Vendors' %}</h3>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Name') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Arabic Name') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Email') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:15%;">{{ _('Status') }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase" scope="col" style="width:15%;">{{ _('Create date') }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col">{{ _('Actions') }}</th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for vendor in vendors %}
<tr>
<td class="ps-0">{{ vendor.name }}</td>
<td class="ps-0">{{ vendor.arabic_name }}</td>
<td class="ps-0">{{ vendor.email }}</td>
<td class="ps-0">
{% if customer.active %}
<span class="fas fa-check-circle text-success"></span> {{ _('Active') }}
{% else %}
<span class="fas fa-times-circle text-danger"></span> {{ _('Inactive') }}
{% endif %}
</td>
<td class="ps-0">{{ vendor.created_at|naturalday|capfirst }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button
class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'activate_account' request.dealer.slug 'vendor' vendor.slug %}"><button class="dropdown-item text-primary">{% trans "Activate" %}</button></a>
<div class="dropdown-divider"></div>
<a href="{% url 'permenant_delete_account' request.dealer.slug 'vendor' vendor.slug %}"><button class="dropdown-item text-danger">{% trans "Permenantly Delete" %}</button></a>
<div class="row mt-5">
<div class="col-12">
<h3 class="mb-3">{% trans 'Vendors' %}</h3>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Name") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Arabic Name") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Email") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:15%">{{ _("Status") }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase"
scope="col"
style="width:15%">{{ _("Create date") }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col">{{ _("Actions") }}</th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for vendor in vendors %}
<tr>
<td class="ps-0">{{ vendor.name }}</td>
<td class="ps-0">{{ vendor.arabic_name }}</td>
<td class="ps-0">{{ vendor.email }}</td>
<td class="ps-0">
{% if customer.active %}
<span class="fas fa-check-circle text-success"></span> {{ _("Active") }}
{% else %}
<span class="fas fa-times-circle text-danger"></span> {{ _("Inactive") }}
{% endif %}
</td>
<td class="ps-0">{{ vendor.created_at|naturalday|capfirst }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'activate_account' request.dealer.slug 'vendor' vendor.slug %}">
<button class="dropdown-item text-primary">{% trans "Activate" %}</button>
</a>
<div class="dropdown-divider"></div>
<a href="{% url 'permenant_delete_account' request.dealer.slug 'vendor' vendor.slug %}">
<button class="dropdown-item text-danger">{% trans "Permenantly Delete" %}</button>
</a>
</div>
</div>
</td>
</tr>
{% empty %}
<td colspan="6" class="text-center">{% trans 'No data available in table' %}</td>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</td>
</tr>
{% empty %}
<td colspan="6" class="text-center">{% trans 'No data available in table' %}</td>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-12">
<h3 class="mb-3">{% trans 'Staff' %}</h3>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Name') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Arabic Name') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:20%;">{{ _('Email') }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" style="width:15%;">{{ _('Status') }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase" scope="col" style="width:15%;">{{ _('Create date') }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col">{{ _('Actions') }}</th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for obj in staff %}
<tr>
<td class="ps-0">{{ obj.name }}</td>
<td class="ps-0">{{ obj.arabic_name }}</td>
<td class="ps-0">{{ obj.email }}</td>
<td class="ps-0">
{% if obj.active %}
<span class="fas fa-check-circle text-success"></span> {{ _('Active') }}
{% else %}
<span class="fas fa-times-circle text-danger"></span> {{ _('Inactive') }}
{% endif %}
</td>
<td class="ps-0">{{ obj.created|naturalday|capfirst }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button
class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'activate_account' request.dealer.slug 'staff' obj.slug %}"><button class="dropdown-item text-primary">{% trans "Activate" %}</button></a>
<div class="dropdown-divider"></div>
<a href="{% url 'permenant_delete_account' request.dealer.slug 'staff' obj.slug %}"><button class="dropdown-item text-danger">{% trans "Permenantly Delete" %}</button></a>
<div class="row mt-5">
<div class="col-12">
<h3 class="mb-3">{% trans 'Staff' %}</h3>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table align-items-center table-flush table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Name") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Arabic Name") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:20%">{{ _("Email") }}</th>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0"
scope="col"
style="width:15%">{{ _("Status") }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase"
scope="col"
style="width:15%">{{ _("Create date") }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col">{{ _("Actions") }}</th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for obj in staff %}
<tr>
<td class="ps-0">{{ obj.name }}</td>
<td class="ps-0">{{ obj.arabic_name }}</td>
<td class="ps-0">{{ obj.email }}</td>
<td class="ps-0">
{% if obj.active %}
<span class="fas fa-check-circle text-success"></span> {{ _("Active") }}
{% else %}
<span class="fas fa-times-circle text-danger"></span> {{ _("Inactive") }}
{% endif %}
</td>
<td class="ps-0">{{ obj.created|naturalday|capfirst }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'activate_account' request.dealer.slug 'staff' obj.slug %}">
<button class="dropdown-item text-primary">{% trans "Activate" %}</button>
</a>
<div class="dropdown-divider"></div>
<a href="{% url 'permenant_delete_account' request.dealer.slug 'staff' obj.slug %}">
<button class="dropdown-item text-danger">{% trans "Permenantly Delete" %}</button>
</a>
</div>
</div>
</td>
</tr>
{% empty %}
<td colspan="6" class="text-center">{% trans 'No data available in table' %}</td>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</td>
</tr>
{% empty %}
<td colspan="6" class="text-center">{% trans 'No data available in table' %}</td>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-end mt-3">
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
{% endblock %}

View File

@ -1,10 +1,8 @@
{% extends BASE_TEMPLATE %}
{% load i18n %}
{% load static %}
{% block title %}{{ page_title }}{% endblock %}
{% block description %}{{ page_description }}{% endblock %}
{% block content %}
<div class="container py-5">
<div class="card bg-body">
@ -81,7 +79,6 @@
</div>
<div class="col-md-6">
<div class="d-flex align-items-center">
<span class="icon-saudi_riyal text-primary"></span>
<strong class="me-2">{% trans 'Service price' %}:</strong> {{ appointment.get_appointment_amount_to_pay_text }}
</div>
@ -91,9 +88,11 @@
</div>
</div>
{% endblock %}
{% block extra_js %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.45/moment-timezone-with-data.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/6.1.10/index.global.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.js"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.45/moment-timezone-with-data.min.js"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/6.1.10/index.global.min.js"
crossorigin="anonymous"></script>
{% endblock %}

View File

@ -2,7 +2,9 @@
{% load i18n %}
{% load static %}
{% block customCSS %}
<link rel="stylesheet" type="text/css" href="{% static 'css/verification_code.css' %}"/>
<link rel="stylesheet"
type="text/css"
href="{% static 'css/verification_code.css' %}" />
{% endblock %}
{% block title %}
{% trans 'Enter Verification Code' %}
@ -19,7 +21,8 @@
<form method="post"
action="{% url 'appointment:email_change_verification_code' %}">
{% csrf_token %}
<label>{% trans 'Code' %}:
<label>
{% trans 'Code' %}:
<input type="text" name="code" placeholder="X1Y2Z3" required>
</label>
<button class="btn btn-phoenix-primary" type="submit">{% trans 'Submit' %}</button>
@ -29,7 +32,15 @@
<div class="messages" style="margin: 20px 0">
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}

View File

@ -1,21 +1,22 @@
{% extends BASE_TEMPLATE %}
{% load i18n %}
{% load static %}
{% block customCSS %}
<link rel="stylesheet" type="text/css" href="{% static 'css/app_admin/days_off.css' %}"/>
<link rel="stylesheet"
type="text/css"
href="{% static 'css/app_admin/days_off.css' %}" />
<!-- jQuery UI CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/themes/base/jquery-ui.css"
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/themes/base/jquery-ui.css"
integrity="sha512-lCk0aEL6CvAGQvaZ47hoq1v/hNsunE8wD4xmmBelkJjg51DauW6uVdaWEJlwgAE6PxcY7/SThs1T4+IMwwpN7w=="
crossorigin="anonymous" referrerpolicy="no-referrer"/>
crossorigin="anonymous"
referrerpolicy="no-referrer" />
{% endblock %}
{% block body %}
<section class="content content-wrapper">
<div class="days-off-form-wrapper">
<div class="do-form-content">
<h2>{% trans "Manage Days Off" %}</h2>
<form method="post" action="">
{% csrf_token %}
<!-- Staff Member -->
@ -26,60 +27,66 @@
});
</script>
{% endif %}
{% if days_off_form.staff_member %}
<div class="form-group">
<label for="{{ days_off_form.staff_member.id_for_label }}">{% trans 'Staff Member' %}:</label>
{{ days_off_form.staff_member }}
</div>
{% endif %}
<!-- Start Date Display (read-only) -->
<div class="form-group">
<label for="{{ day_off_form.start_date.id_for_label }}_display">{% trans 'Start date' %}:</label>
<input type="text" id="{{ day_off_form.start_date.id_for_label }}_display"
<input type="text"
id="{{ day_off_form.start_date.id_for_label }}_display"
class="datepicker-display"
value="{{ day_off_form.start_date.value }}" readonly>
value="{{ day_off_form.start_date.value }}"
readonly>
<!-- Actual value to be submitted -->
<input type="hidden" id="{{ day_off_form.start_date.id_for_label }}"
name="{{ day_off_form.start_date.name }}" class="datepicker-actual"
<input type="hidden"
id="{{ day_off_form.start_date.id_for_label }}"
name="{{ day_off_form.start_date.name }}"
class="datepicker-actual"
value="{{ day_off_form.start_date.value }}">
</div>
<!-- End Date Display (read-only) -->
<div class="form-group">
<label for="{{ day_off_form.end_date.id_for_label }}_display">{% trans 'End date' %}:</label>
<input type="text" id="{{ day_off_form.end_date.id_for_label }}_display"
<input type="text"
id="{{ day_off_form.end_date.id_for_label }}_display"
class="datepicker-display"
value="{{ day_off_form.end_date.value }}" readonly>
value="{{ day_off_form.end_date.value }}"
readonly>
<!-- Actual value to be submitted -->
<input type="hidden" id="{{ day_off_form.end_date.id_for_label }}"
name="{{ day_off_form.end_date.name }}" class="datepicker-actual"
<input type="hidden"
id="{{ day_off_form.end_date.id_for_label }}"
name="{{ day_off_form.end_date.name }}"
class="datepicker-actual"
value="{{ day_off_form.end_date.value }}">
</div>
<div class="form-group">
<label for="{{ day_off_form.description.id_for_label }}">{% trans 'Description' %}:</label>
<input type="text" id="{{ day_off_form.description.id_for_label }}"
name="{{ day_off_form.description.name }}" value="{{ day_off_form.description.value }}">
<input type="text"
id="{{ day_off_form.description.id_for_label }}"
name="{{ day_off_form.description.name }}"
value="{{ day_off_form.description.value }}">
</div>
<button type="submit" class="btn btn-phoenix-primary">{% trans "Submit" %}</button>
</form>
<div class="row-form-errors" style="margin: 10px 0">
{% if days_off_form.errors %}
<div class="alert alert-danger">
{{ days_off_form.errors }}
</div>
{% endif %}
{% if days_off_form.errors %}<div class="alert alert-danger">{{ days_off_form.errors }}</div>{% endif %}
</div>
<div class="messages" style="margin: 20px 0">
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
@ -89,15 +96,16 @@
</div>
</section>
{% endblock %}
{% block customJS %}
<!-- JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.js"
integrity="sha512-ynDTbjF5rUHsWBjz7nsljrrSWqLTPJaORzSe5aGCFxOigRZRmwM05y+kuCtxaoCSzVGB1Ky3XeRZsDhbSLdzXQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script type="text/javascript">
$(document).ready(function () {
$.datepicker._defaults.monthNamesShort = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"];

View File

@ -1,12 +1,8 @@
{% extends BASE_TEMPLATE %}
{% load crispy_forms_filters custom_filters%}
{% load crispy_forms_filters custom_filters %}
{% load i18n %}
{% load static %}
{% block customCSS %}
{% endblock %}
{% block customCSS %}{% endblock %}
{% block content %}
{% translate "Confirm Deletion" as modal_title %}
{% translate "Delete" as delete_btn_modal %}
@ -15,98 +11,65 @@
<h3 class="mb-3">{{ page_title }}</h3>
<form class="form" method="post" enctype="multipart/form-data">
{% csrf_token %}
<!-- Name Field -->
<!-- Name Field -->
<div class="form-floating mb-3">
{{ form.name|add_class:"form-control form-control-sm" }}
<label for="{{ form.name.id_for_label }}">{{ _("Name") }}</label>
{% if form.name.errors %}
<div class="alert alert-danger mt-2">
{{ form.name.errors }}
</div>
{% endif %}
{% if form.name.errors %}<div class="alert alert-danger mt-2">{{ form.name.errors }}</div>{% endif %}
</div>
<!-- Description Field -->
<!-- Description Field -->
<div class="form-floating mb-3">
{{ form.description|add_class:"form-control form-control-sm" }}
<label for="{{ form.description.id_for_label }}">{{ _("Description") }}</label>
{% if form.description.errors %}
<div class="alert alert-danger mt-2">
{{ form.description.errors }}
</div>
{% endif %}
{% if form.description.errors %}<div class="alert alert-danger mt-2">{{ form.description.errors }}</div>{% endif %}
</div>
<!-- Duration Field -->
<!-- Duration Field -->
<div class="form-floating mb-3">
{{ form.duration|add_class:"form-control form-control-sm" }}
<label for="{{ form.duration.id_for_label }}">{{ _("Duration") }}</label>
{% if form.duration.errors %}
<div class="alert alert-danger mt-2">
{{ form.duration.errors }}
</div>
{% endif %}
{% if form.duration.errors %}<div class="alert alert-danger mt-2">{{ form.duration.errors }}</div>{% endif %}
</div>
<!-- Price Field -->
<!-- Price Field -->
<div class="form-floating mb-3">
{{ form.price|add_class:"form-control form-control-sm" }}
<label for="{{ form.price.id_for_label }}">{{ _("Price") }}</label>
{% if form.price.errors %}
<div class="alert alert-danger mt-2">
{{ form.price.errors }}
</div>
{% endif %}
{% if form.price.errors %}<div class="alert alert-danger mt-2">{{ form.price.errors }}</div>{% endif %}
</div>
<!-- Down Payment Field -->
<!-- Down Payment Field -->
<div class="form-floating mb-3">
{{ form.down_payment|add_class:"form-control form-control-sm" }}
<label for="{{ form.down_payment.id_for_label }}">{{ _("Down Payment")}}</label>
{% if form.down_payment.errors %}
<div class="alert alert-danger mt-2">
{{ form.down_payment.errors }}
</div>
{% endif %}
<label for="{{ form.down_payment.id_for_label }}">{{ _("Down Payment") }}</label>
{% if form.down_payment.errors %}<div class="alert alert-danger mt-2">{{ form.down_payment.errors }}</div>{% endif %}
</div>
<!-- Image Field -->
<!-- Image Field -->
<div class="mb-3">
<label for="{{ form.image.id_for_label }}" class="form-label">{{ _("Image") }}</label>
{{ form.image }}
{% if form.image.errors %}
<div class="alert alert-danger mt-2">
{{ form.image.errors }}
</div>
{% endif %}
{% if form.image.errors %}<div class="alert alert-danger mt-2">{{ form.image.errors }}</div>{% endif %}
</div>
<!-- Currency Field -->
<!-- Currency Field -->
<div class="form-floating mb-3">
<select name="currency" id="id_currency" class="form-select form-control-sm" >
<option class="icon-saudi_riyal" value="SAR"><span class="icon-saudi_riyal"></span></option>
<select name="currency" id="id_currency" class="form-select form-control-sm">
<option class="icon-saudi_riyal" value="SAR">
<span class="icon-saudi_riyal"></span>
</option>
</select>
<label for="id_currency"> <span class="icon-saudi_riyal"></span></label>
{% if form.currency.errors %}
<div class="alert alert-danger mt-2">
{{ form.currency.errors }}
</div>
{% endif %}
<label for="id_currency">
<span class="icon-saudi_riyal"></span>
</label>
{% if form.currency.errors %}<div class="alert alert-danger mt-2">{{ form.currency.errors }}</div>{% endif %}
</div>
<!-- Background Color Field -->
<!-- Background Color Field -->
<div class="form-floating mb-3">
<input type="color" value="#000000" id="{{ form.background_color.id_for_label }}" class="form-control form-control-sm" >
<label for="{{ form.background_color.id_for_label }}">{{ _("Background Color")}}</label>
<input type="color"
value="#000000"
id="{{ form.background_color.id_for_label }}"
class="form-control form-control-sm">
<label for="{{ form.background_color.id_for_label }}">{{ _("Background Color") }}</label>
{% if form.background_color.errors %}
<div class="alert alert-danger mt-2">
{{ form.background_color.errors }}
</div>
<div class="alert alert-danger mt-2">{{ form.background_color.errors }}</div>
{% endif %}
</div>
{% if btn_text %}
<button type="submit" class="btn btn-sm btn-phoenix-primary">{{ btn_text }}</button>
{% else %}
@ -126,14 +89,11 @@
{% endif %}
{% endif %}
</form>
</div>
</div>
{% include 'modal/confirm_modal.html' %}
{% endblock %}
{% block customJS %}
<script src="{% static 'js/modal/show_modal.js' %}"></script>
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}

View File

@ -1,11 +1,11 @@
{% extends BASE_TEMPLATE %}
{% load i18n %}
{% load static %}
{% block customCSS %}
<link rel="stylesheet" type="text/css" href="{% static 'css/app_admin/staff_member.css' %}"/>
<link rel="stylesheet"
type="text/css"
href="{% static 'css/app_admin/staff_member.css' %}" />
{% endblock %}
{% block body %}
<section class="main-container">
<div class="container-fluid">
@ -25,54 +25,55 @@
</small>
</div>
{% endif %}
<div class="form-group">
{{ form.services_offered.label_tag }}
{{ form.services_offered.errors }}
{{ form.services_offered }}
<br><small>{% trans 'Hold down “Control”, or “Command” on a Mac, to select more than one.' %}</small>
<br>
<small>{% trans 'Hold down “Control”, or “Command” on a Mac, to select more than one.' %}</small>
</div>
<div class="form-group">
{{ form.slot_duration.label_tag }}
{{ form.slot_duration }}
<small>{{ form.slot_duration.help_text }}</small>
</div>
<div class="form-group">
{{ form.lead_time.label_tag }}
{{ form.lead_time }}
<small>{{ form.lead_time.help_text }}</small>
</div>
<div class="form-group">
{{ form.finish_time.label_tag }}
{{ form.finish_time }}
<small>{{ form.finish_time.help_text }}</small>
</div>
<div class="form-group">
{{ form.appointment_buffer_time.label_tag }}
{{ form.appointment_buffer_time }}
<small>{{ form.appointment_buffer_time.help_text }}</small>
</div>
<div class="form-check">
{{ form.work_on_saturday }}
{{ form.work_on_saturday.label_tag }}
</div>
<div class="form-check">
{{ form.work_on_sunday }}
{{ form.work_on_sunday.label_tag }}
</div>
<button type="submit" class="btn btn-phoenix-primary">{% trans 'Save' %}</button>
</form>
<div class="messages" style="margin: 20px 0">
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
@ -81,7 +82,6 @@
</div>
</section>
{% endblock %}
{% block customJS %}
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}

View File

@ -1,40 +1,39 @@
{% extends BASE_TEMPLATE %}
{% load i18n %}
{% load static %}
{% block customCSS %}
{% endblock %}
{% block customCSS %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-6">
<h3 class="mb-3">{% trans 'Staff Personal Information' %}</h3>
<form id="updatePersonalInfoForm" method="post" action="">
{% csrf_token %}
<div class="form-floating mb-3">
{{ form.first_name }}
<label for="first_name">{{ _("First Name") }}</label>
</div>
<div class="form-floating mb-3">
{{ form.last_name }}
<label for="last_name">{{ _("Last Name") }}</label>
</div>
<div class="form-floating mb-3">
{{ form.email }}
<label for="email">{{ _("Email") }}</label>
</div>
<button type="submit" class="btn btn-phoenix-primary">{{ btn_text }}</button>
</form>
<div class="messages" style="margin: 20px 0">
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
@ -42,7 +41,6 @@
</div>
</div>
{% endblock %}
{% block customJS %}
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}

View File

@ -2,70 +2,107 @@
{% load i18n %}
{% load static %}
{% load custom_filters %}
{% block customCSS %}
<!-- additional CSS -->
{% endblock %}
{% block customCSS %}<!-- additional CSS -->{% endblock %}
{% block content %}
<div class="row">
<div class="col-6">
<h3>{% trans "Manage Working Hours" %}</h3>
<form class="form" method="post" action="" id="workingHoursForm"
data-action="{% if working_hours_instance %}update{% else %}create{% endif %}"
<form class="form"
method="post"
action=""
id="workingHoursForm"
data-action="{% if working_hours_instance %}
update
{% else %}
create
{% endif %}"
data-working-hours-id="
{% if working_hours_instance %}{{ working_hours_instance.id }}{% else %}0{% endif %}"
data-staff-user-id="{% if staff_user_id %}{{ staff_user_id }}{% else %}0{% endif %}">
{% if working_hours_instance %}
{{ working_hours_instance.id }}
{% else %}
0
{% endif %}"
data-staff-user-id="{% if staff_user_id %}
{{ staff_user_id }}
{% else %}
0
{% endif %}">
{% csrf_token %}
{% if working_hours_form.staff_member %}
<div class="form-group mb-3">
<label class="form-label" for="{{ working_hours_form.staff_member.id_for_label }}">{% trans 'Staff Member' %}:</label>
<label class="form-label"
for="{{ working_hours_form.staff_member.id_for_label }}">
{% trans 'Staff Member' %}:
</label>
{{ working_hours_form.staff_member }}
</div>
{% endif %}
<div class="form-group mb-3">
<label class="form-label" for="{{ working_hours_form.day_of_week.id_for_label }}">{% trans 'Day of Week' %}:</label>
<label class="form-label"
for="{{ working_hours_form.day_of_week.id_for_label }}">{% trans 'Day of Week' %}:</label>
{{ working_hours_form.day_of_week|add_class:"form-select form-select-sm" }}
</div>
<div class="form-group mb-3">
<label class="form-label" for="{{ working_hours_form.start_time.id_for_label }}">{% trans 'Start time' %}:</label>
<div class="input-group time24hr" id="start-timepicker" data-target-input="nearest">
<input type="text" class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker"
data-target="#start-timepicker" name="{{ working_hours_form.start_time.name }}"
<label class="form-label"
for="{{ working_hours_form.start_time.id_for_label }}">{% trans 'Start time' %}:</label>
<div class="input-group time24hr"
id="start-timepicker"
data-target-input="nearest">
<input type="text"
class="form-control form-control-sm datetimepicker-input"
data-toggle="datetimepicker"
data-target="#start-timepicker"
name="{{ working_hours_form.start_time.name }}"
value="{{ working_hours_form.start_time.value|default:'09:00 AM' }}"
id="{{ working_hours_form.start_time.id_for_label }}">
<div class="input-group-text" data-toggle="datetimepicker" data-target="#start-timepicker"><i class="far fa-clock"></i></div>
<div class="input-group-text"
data-toggle="datetimepicker"
data-target="#start-timepicker">
<i class="far fa-clock"></i>
</div>
</div>
</div>
<div class="form-group mb-3">
<label class="form-label" for="{{ working_hours_form.end_time.id_for_label }}">{% trans 'End time' %}:</label>
<div class="input-group date" id="end-timepicker" data-target-input="nearest">
<input type="text" class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker"
data-target="#end-timepicker" name="{{ working_hours_form.end_time.name }}"
<label class="form-label"
for="{{ working_hours_form.end_time.id_for_label }}">{% trans 'End time' %}:</label>
<div class="input-group date"
id="end-timepicker"
data-target-input="nearest">
<input type="text"
class="form-control form-control-sm datetimepicker-input"
data-toggle="datetimepicker"
data-target="#end-timepicker"
name="{{ working_hours_form.end_time.name }}"
value="{{ working_hours_form.end_time.value|default:'05:00 PM' }}"
id="{{ working_hours_form.end_time.id_for_label }}">
<div class="input-group-text" data-toggle="datetimepicker" data-target="#end-timepicker"><i class="far fa-clock"></i></div>
<div class="input-group-text"
data-toggle="datetimepicker"
data-target="#end-timepicker">
<i class="far fa-clock"></i>
</div>
</div>
</div>
<button type="submit" class="btn btn-sm btn-phoenix-primary">{{ button_text }}</button>
<input type="hidden" id="addWorkingHoursUrl"
<input type="hidden"
id="addWorkingHoursUrl"
value="{% url 'appointment:add_working_hours_id' staff_user_id|default:user.id %}">
<input type="hidden" id="updateWorkingHoursUrl"
<input type="hidden"
id="updateWorkingHoursUrl"
value="{% url 'appointment:update_working_hours_id' working_hours_id|default:0 staff_user_id|default:user.id %}">
</form>
{% include 'modal/error_modal.html' %}
<div class="messages" style="margin: 20px 0">
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
@ -75,19 +112,22 @@
{% endblock %}
{% block customJS %}
<!-- JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.8/umd/popper.min.js"
integrity="sha512-TPh2Oxlg1zp+kz3nFA0C5vVC6leG/6mm1z9+mA81MI5eaUVqasPLO8Cuk4gMF4gUfP5etR73rgU/8PNMsSesoQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/js/bootstrap.min.js"
integrity="sha512-7rusk8kGPFynZWu26OKbTeI+QPoYchtxsmPeBqkHIEXJxeun4yJ4ISYe7C6sz9wdxeE1Gk3VxsIWgCZTc+vX3g=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.js"
integrity="sha512-3CuraBvy05nIgcoXjVN33mACRyI89ydVHg7y/HMN9wcTVbHeur0SeBzweSd/rxySapO7Tmfu68+JlKkLTnDFNg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.39.0/js/tempusdominus-bootstrap-4.min.js"
integrity="sha512-k6/Bkb8Fxf/c1Tkyl39yJwcOZ1P4cRrJu77p83zJjN2Z55prbFHxPs9vN7q3l3+tSMGPDdoH51AEU8Vgo1cgAA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script type="text/javascript">
const addWorkingHoursUrl = $('#addWorkingHoursUrl').val();
const updateWorkingHoursUrl = $('#updateWorkingHoursUrl').val();
@ -163,4 +203,3 @@
<script src="{% static 'js/modal/error_modal.js' %}"></script>
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}

View File

@ -1,7 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% load static %}
{% block title %}
{% trans 'Service List' %}
{% endblock %}
@ -29,7 +28,13 @@
<tbody>
{% for service in services %}
<tr>
<td><img class="rounded-soft" src="{{ service.get_image_url }}" alt="" style="width: 35px; height: 35px;"/></td>
<td>
<img class="rounded-soft"
src="{{ service.get_image_url }}"
alt=""
style="width: 35px;
height: 35px" />
</td>
<td>{{ service.name }}</td>
<td>{{ service.get_duration }}</td>
<td>{{ service.get_price_text }}</td>
@ -64,11 +69,8 @@
</div>
{% include 'modal/confirm_modal.html' %}
</div>
{% endblock %}
{% block customJS %}
<script src="{% static 'js/modal/show_modal.js' %}"></script>
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}

View File

@ -1,18 +1,16 @@
{% extends BASE_TEMPLATE %}
{% load i18n %}
{% load static %}
{% block customMetaTag %}
<meta name="csrf-token" content="{{ csrf_token }}">
{% endblock %}
{% block customMetaTag %}<meta name="csrf-token" content="{{ csrf_token }}">{% endblock %}
{% block customCSS %}
<link rel="stylesheet" type="text/css" href="{% static 'css/appt-common.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'css/app_admin/admin.css' %}"/>
<link rel="stylesheet"
type="text/css"
href="{% static 'css/appt-common.css' %}" />
<link rel="stylesheet"
type="text/css"
href="{% static 'css/app_admin/admin.css' %}" />
{% endblock %}
{% block title %}
{{ page_title }}
{% endblock %}
{% block title %}{{ page_title }}{% endblock %}
{% block content %}
<section class="content content-wrapper">
<div class="container">
@ -20,40 +18,49 @@
<div id="calendar" class="calendarbox"></div>
<div id="event-list-container" class="event-list-container"></div>
</div>
{% include 'modal/event_details_modal.html' %}
{% include 'modal/error_modal.html' %}
<div class="messages" style="margin: 20px 0">
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
</div>
</div>
</section>
<div id="customContextMenu" style="display: none; position: absolute; z-index: 1000;">
<a id="newAppointmentOption" class="btn btn-sm btn-phoenix-success rounded-pill me-1 mb-1" href="#">{{ _("New Appointment")}}</a>
<div id="customContextMenu"
style="display: none;
position: absolute;
z-index: 1000">
<a id="newAppointmentOption"
class="btn btn-sm btn-phoenix-success rounded-pill me-1 mb-1"
href="#">{{ _("New Appointment") }}</a>
</div>
{% include 'modal/confirm_modal.html' %}
{% endblock %}
{% block customJS %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.js"
integrity="sha512-3CuraBvy05nIgcoXjVN33mACRyI89ydVHg7y/HMN9wcTVbHeur0SeBzweSd/rxySapO7Tmfu68+JlKkLTnDFNg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.45/moment-timezone-with-data.min.js"
integrity="sha512-t/mY3un180WRfsSkWy4Yi0tAxEDGcY2rAEx873hb5BrkvLA0QLk54+SjfYgFBBoCdJDV1H86M8uyZdJhAOHeyA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/6.1.10/index.global.min.js"
integrity="sha512-JCQkxdym6GmQ+AFVioDUq8dWaWN6tbKRhRyHvYZPupQ6DxpXzkW106FXS1ORgo/m3gxtt5lHRMqSdm2OfPajtg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script>
const timezone = "{{ timezone }}";
const locale = "{{ locale }}";
@ -88,13 +95,11 @@
const noServiceOfferedTxt = "{% trans "You don't offer any service. Add new service from your profile." %}";
const noStaffMemberTxt = "{% trans "No staff members found." %}";
</script>
<script src="{% static 'js/modal/error_modal.js' %}"></script>
<script src="{% static 'js/app_admin/staff_index.js' %}"></script>
<script src="{% static 'js/modal/show_modal.js' %}"></script>
<script src="{% static 'js/js-utils.js' %}"></script>
<script>
<script>
function createCommonInputFields(appointment, servicesDropdown, isEditMode, defaultStartTime, staffDropdown) {
const startTimeValue = isEditMode ? moment(appointment.start_time).format('HH:mm:ss') : defaultStartTime;
const disabledAttribute = isEditMode ? '' : 'disabled';

View File

@ -1,26 +1,17 @@
{% extends 'base.html' %}
{% load i18n %}
{% load static %}
{% block customCSS %}
{% endblock %}
{% block title %}
{{ _("Staff Members List")}}
{% endblock %}
{% block customCSS %}{% endblock %}
{% block title %}{{ _("Staff Members List") }}{% endblock %}
{% block description %}
{% trans 'List of all staff members' %}.
{% endblock %}
{% block body %}
<div class="row">
<div class="col-6">
<h3 class="section-header-itm">{% trans 'Staff Members' %}</h3>
<div class="buttons-container section-header-itm">
<a href="{{ btn_staff_me_link }}"
class="btn btn-sm btn-phoenix-info">
{{ btn_staff_me }}
</a>
<a href="{{ btn_staff_me_link }}" class="btn btn-sm btn-phoenix-info">{{ btn_staff_me }}</a>
<a href="{% url 'appointment:add_staff_member_info' %}"
class="btn btn-sm btn-phoenix-success">{{ _("Add") }}
<i class="fas fa-add"></i>
@ -53,16 +44,12 @@
<td colspan="3">{% trans 'No staff members found' %}.</td>
</tr>
{% endfor %}
<small>
{% trans "PS: Remove means, deleting the staff status of the user. The user account is still active." %}
</small>
<small>{% trans "PS: Remove means, deleting the staff status of the user. The user account is still active." %}</small>
</tbody>
</table>
</div>
</div>
{% endblock %}
{% block customJS %}
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}

View File

@ -1,28 +1,26 @@
{% extends BASE_TEMPLATE %}
{% load i18n %}
{% load static %}
{% block customCSS %}
{% endblock %}
{% block title %}
{{ page_title }}
{% endblock %}
{% block description %}
{{ page_description }}
{% endblock %}
{% block customCSS %}{% endblock %}
{% block title %}{{ page_title }}{% endblock %}
{% block description %}{{ page_description }}{% endblock %}
{% block content %}
<div class="row mt-4">
<div class="col-6">
{% translate "Confirm Deletion" as modal_title %}
{% translate "Delete" as delete_btn_modal %}
<h3>{% trans 'Personal Information' %}</h3>
<!-- Display fields from PersonalInformationForm -->
<!-- Display fields from PersonalInformationForm -->
<div class="section-content">
<p><strong>{% trans 'First name' %}:</strong> {{ user.first_name }}</p>
<p><strong>{% trans 'Last name' %}:</strong> {{ user.last_name }}</p>
<p><strong>{% trans 'Email' %}:</strong> {{ user.email }}</p>
<p>
<strong>{% trans 'First name' %}:</strong> {{ user.first_name }}
</p>
<p>
<strong>{% trans 'Last name' %}:</strong> {{ user.last_name }}
</p>
<p>
<strong>{% trans 'Email' %}:</strong> {{ user.email }}
</p>
</div>
<a href="{% url 'appointment:update_user_info' user.id %}"
class="btn btn-sm btn-phoenix-primary">
@ -30,32 +28,34 @@
</a>
</div>
</div>
<!-- Appointment Information Section -->
<!-- Appointment Information Section -->
<div class="row mt-4">
<div class="col-6">
<h3>{% trans 'Appointments Information' %}</h3>
<small>
{{ service_msg }}
</small>
<small>{{ service_msg }}</small>
{% if staff_member %}
<div class="section-content">
<p>
<strong>{% trans 'Slot duration' %}:</strong> {{ staff_member.get_slot_duration_text }}
<i class="fas fa-info-circle" data-toggle="tooltip"
<i class="fas fa-info-circle"
data-toggle="tooltip"
title="{{ slot_duration_help_text }}"></i>
</p>
<p><strong>{% trans 'General start time' %}:</strong> {{ staff_member.get_lead_time }}</p>
<p><strong>{% trans 'General end time' %}:</strong> {{ staff_member.get_finish_time }}</p>
<p>
<strong>{% trans 'General start time' %}:</strong> {{ staff_member.get_lead_time }}
</p>
<p>
<strong>{% trans 'General end time' %}:</strong> {{ staff_member.get_finish_time }}
</p>
<p>
<strong>{% trans 'Weekend days you work' %}:</strong> {{ staff_member.get_weekend_days_worked_text }}
</p>
<p>
<strong>{% trans 'Appointment buffer time' %}:</strong> {{ staff_member.get_appointment_buffer_time_text }}
<i class="fas fa-info-circle" data-toggle="tooltip" title="{{ buffer_time_help_text }}"></i>
<i class="fas fa-info-circle"
data-toggle="tooltip"
title="{{ buffer_time_help_text }}"></i>
</p>
</div>
<a href="{% url 'appointment:update_staff_other_info' staff_member.user.id %}"
class="btn btn-sm section-content-button modify-btn button-color-blue btn-phoenix-primary">
@ -72,8 +72,7 @@
{% endif %}
</div>
</div>
<!-- Days Off Information Section -->
<!-- Days Off Information Section -->
<section class="profile">
<div class="container">
<h3>{% trans 'Days Off' %}</h3>
@ -140,8 +139,7 @@
</div>
</div>
</section>
<!-- Working Hours Information Section -->
<!-- Working Hours Information Section -->
<section class="profile">
<div class="container">
<h3>{% trans 'Working Hours' %}</h3>
@ -165,7 +163,6 @@
<tbody>
{% for working_hour in working_hours %}
<tr>
{% if working_hour.day_of_week == 0 %}
<td>{{ _("Sunday") }}</td>
{% elif working_hour.day_of_week == 1 %}
@ -181,7 +178,6 @@
{% elif working_hour.day_of_week == 6 %}
<td>{{ _("Saturday") }}</td>
{% endif %}
<td>{{ working_hour.start_time|time:"g:i A" }}</td>
<td>{{ working_hour.end_time|time:"g:i A" }}</td>
<td>
@ -224,8 +220,7 @@
</div>
</div>
</section>
<!-- Service Information Section -->
<!-- Service Information Section -->
<section class="profile">
<div class="container">
<h3>{% trans 'Service Offered' %}</h3>
@ -265,17 +260,11 @@
</div>
</div>
</section>
{% include 'modal/confirm_modal.html' %}
{% endblock %}
{% block customJS %}
<!-- Bootstrap's JS and CSS (if not already included) -->
<!-- Our custom modal JS -->
<script src="{% static 'js/modal/show_modal.js' %}"></script>
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}

View File

@ -2,7 +2,9 @@
{% load i18n %}
{% load static %}
{% block customCSS %}
<link rel="stylesheet" type="text/css" href="{% static 'css/appointments-user-details.css' %}"/>
<link rel="stylesheet"
type="text/css"
href="{% static 'css/appointments-user-details.css' %}" />
{% endblock %}
{% block title %}
{% translate 'Client Information' %} - {{ ar.get_service_name }}
@ -22,9 +24,7 @@
{% csrf_token %}
<div class="appointment-user-info">
<div class="appointment-user-info-title">
<div class="title">
{% trans "Fill out your details" %}
</div>
<div class="title">{% trans "Fill out your details" %}</div>
</div>
<hr class="second-part">
<div class="user-info-input">
@ -37,10 +37,14 @@
</div>
</div>
<div class="name-email">
<label for="{{ form.name.id_for_label }}" class="name">{% trans "Full Name" %} *<br>
<label for="{{ form.name.id_for_label }}" class="name">
{% trans "Full Name" %} *
<br>
{{ client_data_form.name }}
</label>
<label for="{{ form.email.id_for_label }}" class="email">{% trans "Email" %} *<br>
<label for="{{ form.email.id_for_label }}" class="email">
{% trans "Email" %} *
<br>
{{ client_data_form.email }}
</label>
</div>
@ -52,19 +56,22 @@
</div>
<div class="phone-number">
<label for="{{ form.phone.id_for_label }}">
{% trans "Phone" %} *<br>
{% trans "Phone" %} *
<br>
</label>
<div class="phone-input-container">
{{ form.phone }}
</div>
<div class="phone-input-container">{{ form.phone }}</div>
</div>
<div class="address">
<label for="{{ form.address.id_for_label }}">{% trans "City and State" %} * :<br>
<label for="{{ form.address.id_for_label }}">
{% trans "City and State" %} * :
<br>
{{ form.address }}
</label>
</div>
<div class="additional-information">
<label for="{{ form.additional_info.id_for_label }}">{% trans 'Additional Information' %}<br>
<label for="{{ form.additional_info.id_for_label }}">
{% trans 'Additional Information' %}
<br>
{{ form.additional_info }}
</label>
</div>
@ -73,18 +80,14 @@
</div>
<div class="service-description-and-pay">
<div class="service-details-title">{% trans "Service Details" %}</div>
<hr class="second-part">
<div class="service-description-content">
<div class="item-name">{{ ar.get_service_name }}</div>
<div id="service-datetime-chosen"
class="service-datetime-chosen">
<div id="service-datetime-chosen" class="service-datetime-chosen">
{{ ar.date }}&nbsp;{% trans "at" %}&nbsp;{{ ar.start_time }}
</div>
<div>{{ ar.service.get_duration }}</div>
</div>
<hr class="second-part">
{% if ar.is_a_paid_service %}
{% if APPOINTMENT_PAYMENT_URL %}
@ -95,12 +98,13 @@
<div>${{ ar.get_service_price }}</div>
</div>
<div class="payment-options">
<button type="submit" class="btn btn-phoenix-primary btn-pay-full" name="payment_type"
value="full">
{% trans "Pay" %}
</button>
<button type="submit"
class="btn btn-phoenix-primary btn-pay-full"
name="payment_type"
value="full">{% trans "Pay" %}</button>
{% if ar.accepts_down_payment %}
<button type="submit" class="btn btn-phoenix-primary btn-pay-down-payment"
<button type="submit"
class="btn btn-phoenix-primary btn-pay-down-payment"
name="payment_type"
value="down">
{% trans "Down Payment" %} (${{ ar.get_service_down_payment }})
@ -109,16 +113,16 @@
</div>
</div>
{% else %}
<button type="submit" class="btn btn-phoenix-primary btn-submit-appointment" name="payment_type"
value="full">
{% trans "Finish" %}
</button>
<button type="submit"
class="btn btn-phoenix-primary btn-submit-appointment"
name="payment_type"
value="full">{% trans "Finish" %}</button>
{% endif %}
{% else %}
<button type="submit" class="btn btn-phoenix-primary btn-submit-appointment" name="payment_type"
value="full">
{% trans "Finish" %}
</button>
<button type="submit"
class="btn btn-phoenix-primary btn-submit-appointment"
name="payment_type"
value="full">{% trans "Finish" %}</button>
{% endif %}
</div>
</form>

View File

@ -2,69 +2,69 @@
{% load i18n %}
{% load static %}
{% block customCSS %}
<link rel="stylesheet" type="text/css" href="{% static 'css/appt-common.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'css/appointments.css' %}"/>
{% endblock %}
{% block title %}
{{ page_title }}
{% endblock %}
{% block description %}
{{ page_description }}
<link rel="stylesheet"
type="text/css"
href="{% static 'css/appt-common.css' %}" />
<link rel="stylesheet"
type="text/css"
href="{% static 'css/appointments.css' %}" />
{% endblock %}
{% block title %}{{ page_title }}{% endblock %}
{% block description %}{{ page_description }}{% endblock %}
{% block body %}
<div class="row">
<div class="col-xl-12">
<h3 class="page-title">
{% if page_header %}{{ page_header }}{% else %}{{ service.name }}{% endif %} </h3>
{% if page_header %}
{{ page_header }}
{% else %}
{{ service.name }}
{% endif %}
</h3>
<small class="page-description">
{% trans "Check out our availability and book the date and time that works for you" %}
</small>
<hr>
<div class="djangoAppt_page-body">
<div class="djangoAppt_appointment-calendar">
<div class="djangoAppt_appointment-calendar-title-timezone">
<div class="djangoAppt_title">
{% trans "Select a date and time" %}
</div>
<div class="djangoAppt_timezone-details">
{% trans "Timezone" %}:&nbsp;{{ timezoneTxt }}
</div>
<div class="djangoAppt_title">{% trans "Select a date and time" %}</div>
<div class="djangoAppt_timezone-details">{% trans "Timezone" %}:&nbsp;{{ timezoneTxt }}</div>
</div>
<hr class="djangoAppt_second-part">
<div class="djangoAppt_calendar-and-slot">
<div class="djangoAppt_calendar" id="calendar">
</div>
<div class="djangoAppt_calendar" id="calendar"></div>
<div class="djangoAppt_slot">
<div class="djangoAppt_date_chosen">{{ date_chosen }}</div>
<div class="slot-container">
<div class="error-message"></div>
<ul id="slot-list" class="djangoAppt_slot-list">
<!-- Slot list will be updated dynamically by the AJAX request -->
<!-- Slot list will be updated dynamically by the AJAX request -->
</ul>
</div>
</div>
</div>
{% if rescheduled_date %}
<div class="form-group" style="margin-top: 10px">
<label for="reason_for_rescheduling">{% trans "Reason for rescheduling" %}:</label>
<textarea name="reason_for_rescheduling" id="reason_for_rescheduling"
class="form-control" rows="1" required></textarea>
<textarea name="reason_for_rescheduling"
id="reason_for_rescheduling"
class="form-control"
rows="1"
required></textarea>
</div>
{% endif %}
</div>
<div class="djangoAppt_service-description">
<form method="post" action="{% url 'appointment:appointment_request_submit' %}"
<form method="post"
action="{% url 'appointment:appointment_request_submit' %}"
class="appointment-form">
{% csrf_token %}
<div class="staff-members-list">
<label class="djangoAppt_item-name" for="staff_id">{{ label }}</label>
<select name="staff_member" id="staff_id">
{% if not staff_member %}
<option value="none"
selected>{% trans 'Please select a staff member' %}</option>
<option value="none" selected>{% trans 'Please select a staff member' %}</option>
{% endif %}
{% for sf in all_staff_members %}
<option value="{{ sf.id }}"
@ -72,7 +72,6 @@
{% endfor %}
</select>
</div>
<div>{% trans "Service Details" %}</div>
<hr class="djangoAppt_second-part">
<div class="djangoAppt_service-description-content">
@ -89,25 +88,34 @@
</div>
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
</div>
</div>
{% endblock %}
{% block customJS %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.30.1/moment.js"
integrity="sha512-3CuraBvy05nIgcoXjVN33mACRyI89ydVHg7y/HMN9wcTVbHeur0SeBzweSd/rxySapO7Tmfu68+JlKkLTnDFNg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.45/moment-timezone-with-data.min.js"
integrity="sha512-t/mY3un180WRfsSkWy4Yi0tAxEDGcY2rAEx873hb5BrkvLA0QLk54+SjfYgFBBoCdJDV1H86M8uyZdJhAOHeyA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/6.1.10/index.global.min.js"
integrity="sha512-JCQkxdym6GmQ+AFVioDUq8dWaWN6tbKRhRyHvYZPupQ6DxpXzkW106FXS1ORgo/m3gxtt5lHRMqSdm2OfPajtg=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script>
const timezone = "{{ timezoneTxt }}";
const locale = "{{ locale }}";

View File

@ -2,19 +2,19 @@
{% load i18n %}
{% load static %}
{% block customCSS %}
<link rel="stylesheet" type="text/css" href="{% static 'css/thank_you.css' %}"/>
{% endblock %}
{% block title %}
{{ page_title }}
{% endblock %}
{% block description %}
{{ page_description }}
<link rel="stylesheet"
type="text/css"
href="{% static 'css/thank_you.css' %}" />
{% endblock %}
{% block title %}{{ page_title }}{% endblock %}
{% block description %}{{ page_description }}{% endblock %}
{% block body %}
<div class="container content-body-apd">
<div class="main-content">
<h1 class="thank-you-title">{% trans "See you soon" %} !</h1>
<p class="thank-you-message">{% trans "We've successfully scheduled your appointment! Please check your email for all the details" %}.</p>
<p class="thank-you-message">
{% trans "We've successfully scheduled your appointment! Please check your email for all the details" %}.
</p>
<p class="appointment-details-title">{% trans "Appointment details" %}:</p>
<ul class="appointment-details">
<li>{% trans 'Service' %}: {{ appointment.get_service_name }}</li>
@ -24,7 +24,15 @@
</ul>
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
@ -33,4 +41,4 @@
{% endblock %}
{% block customJS %}
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}
{% endblock %}

View File

@ -1,39 +1,39 @@
{% extends BASE_TEMPLATE %}
{% load i18n %}
{% load static %}
{% block customCSS %}
<link rel="stylesheet" href="{% static 'css/verification_code.css' %}">
{% endblock %}
{% block title %}{% trans 'Enter Verification Code' %}{% endblock %}
{% block description %}{% trans 'Enter Verification Code' %}{% endblock %}
{% block title %}
{% trans 'Enter Verification Code' %}
{% endblock %}
{% block description %}
{% trans 'Enter Verification Code' %}
{% endblock %}
{% block body %}
<div class="vcode-container">
<div class="vcode-card">
<h1 class="vcode-title">{% trans 'Enter Verification Code' %}</h1>
<p class="vcode-instruction">{% trans "We've sent a verification code to your email. Please enter it below" %}:</p>
<form method="post" class="vcode-form">
{% csrf_token %}
<div class="vcode-input-group">
<label for="verification-code" class="vcode-label">{% trans 'Code' %}:</label>
<input type="text" id="verification-code" name="code" class="vcode-input" required>
<input type="text"
id="verification-code"
name="code"
class="vcode-input"
required>
</div>
<button type="submit" class="vcode-button">{% trans 'Submit' %}</button>
</form>
{% if messages %}
{% for message in messages %}
<div class="vcode-alert vcode-alert-{% if message.tags %}{{ message.tags }}{% endif %}">
{{ message }}
</div>
<div class="vcode-alert vcode-alert-
{% if message.tags %}{{ message.tags }}{% endif %}">{{ message }}</div>
{% endfor %}
{% endif %}
</div>
</div>
{% endblock %}
{% block customJS %}
{% endblock %}
{% block customJS %}{% endblock %}

View File

@ -62,12 +62,22 @@
<div class="main-content">
<div class="confirmation-message">
<h1>{% trans "Rescheduling Successful" %}</h1>
<p>{% trans "Your appointment rescheduling request has been successfully submitted. Please check your email and click on the confirmation link to finalize the rescheduling process." %}</p>
<p>
{% trans "Your appointment rescheduling request has been successfully submitted. Please check your email and click on the confirmation link to finalize the rescheduling process." %}
</p>
<a href="/">{% trans "Go to Homepage" %}</a>
</div>
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
@ -76,4 +86,4 @@
{% endblock %}
{% block customJS %}
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}
{% endblock %}

View File

@ -83,22 +83,21 @@
{% block body %}
<div class="container">
<h2>{% trans 'Reset Your Password' %}</h2>
<!-- Display messages -->
<!-- Display messages -->
{% if messages %}
<ul class="messages">
{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
<li {% if message.tags %}class="{{ message.tags }}"{% endif %}>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
<!-- Password Reset Form -->
<!-- Password Reset Form -->
<form method="post">
{% csrf_token %}
{{ form.as_p }} <!-- Renders the form fields -->
<button type="submit">{% trans 'Reset Password' %}</button>
</form>
{% endblock %}
{% block customJS %}
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}
{% endblock %}
{% block customJS %}
<script src="{% static 'js/js-utils.js' %}"></script>
{% endblock %}

View File

@ -37,12 +37,18 @@
{% block body %}
<div class="container">
<h1 class="title">{{ page_title }}</h1>
<p class="message">
{{ page_message }}
</p>
<p class="message">{{ page_message }}</p>
{% if messages %}
{% for message in messages %}
<div class="alert alert-dismissible {% if message.tags %}alert-{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}danger{% else %}{{ message.tags }}{% endif %}{% endif %}"
<div class="alert alert-dismissible
{% if message.tags %}
alert-
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
danger
{% else %}
{{ message.tags }}
{% endif %}
{% endif %}"
role="alert">{{ message }}</div>
{% endfor %}
{% endif %}

View File

@ -1,91 +1,100 @@
{% load static %} {% load i18n %}
{% load static %}
{% load i18n %}
<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}
<html lang="{{ LANGUAGE_CODE }}"
dir="{% if LANGUAGE_CODE == 'ar' %}rtl{% else %}ltr{% endif %}"
dir="{% if LANGUAGE_CODE == 'ar' %}
rtl
{% else %}
ltr
{% endif %}"
data-bs-theme=""
data-navigation-type="default"
data-navbar-horizontal-shape="default">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Haikal - The Backbone of Car Qar: An innovative car inventory management system designed to streamline dealership operations. Manage inventory, sales, transfers, and accounting seamlessly with advanced analytics and intuitive tools. Inspired by Arabic origins, Haikal empowers businesses with precision and efficiency.">
<title>{% block title %}{% trans 'HAIKAL' %}{% endblock %}</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'images/favicons/apple-touch-icon.png' %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'images/favicons/favicon-32x32.png' %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'images/favicons/favicon-16x16.png' %}">
<link rel="shortcut icon" type="image/x-icon" href="{% static 'images/favicons/favicon.ico' %}">
<meta name="description"
content="Haikal - The Backbone of Car Qar: An innovative car inventory management system designed to streamline dealership operations. Manage inventory, sales, transfers, and accounting seamlessly with advanced analytics and intuitive tools. Inspired by Arabic origins, Haikal empowers businesses with precision and efficiency.">
<title>
{% block title %}
{% trans 'HAIKAL' %}
{% endblock %}
</title>
<link rel="apple-touch-icon"
sizes="180x180"
href="{% static 'images/favicons/apple-touch-icon.png' %}">
<link rel="icon"
type="image/png"
sizes="32x32"
href="{% static 'images/favicons/favicon-32x32.png' %}">
<link rel="icon"
type="image/png"
sizes="16x16"
href="{% static 'images/favicons/favicon-16x16.png' %}">
<link rel="shortcut icon"
type="image/x-icon"
href="{% static 'images/favicons/favicon.ico' %}">
<link rel="manifest" href="{% static 'images/favicons/manifest.json' %}">
<meta name="msapplication-TileImage" content="{% static 'images/logos/logo-d.png' %}">
<meta name="msapplication-TileImage"
content="{% static 'images/logos/logo-d.png' %}">
<meta name="theme-color" content="#ffffff">
<script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script>
<script src="{% static 'js/config.js' %}"></script>
<script src="{% static 'js/sweetalert2.all.min.js' %}"></script>
<!-- ===============================================-->
<!-- Stylesheets-->
<!-- ===============================================-->
<link href="{% static 'vendors/mapbox-gl/mapbox-gl.css' %}" rel="stylesheet">
<link href="{% static 'vendors/swiper/swiper-bundle.min.css' %}" rel="stylesheet">
<!-- ===============================================-->
<!-- Stylesheets-->
<!-- ===============================================-->
<link href="{% static 'vendors/mapbox-gl/mapbox-gl.css' %}"
rel="stylesheet">
<link href="{% static 'vendors/swiper/swiper-bundle.min.css' %}"
rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap" rel="stylesheet">
<link href="{% static 'vendors/simplebar/simplebar.min.css' %}" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap"
rel="stylesheet">
<link href="{% static 'vendors/simplebar/simplebar.min.css' %}"
rel="stylesheet">
<link href="{% static 'css/sweetalert2.min.css' %}" rel="stylesheet">
<link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css">
<link rel="stylesheet"
href="https://unicons.iconscout.com/release/v4.0.8/css/line.css">
{% if LANGUAGE_CODE == 'en' %}
<link href="{% static 'css/theme.min.css' %}" type="text/css" rel="stylesheet" id="style-default">
<link href="{% static 'css/user.min.css' %}" type="text/css" rel="stylesheet" id="user-style-default">
<link href="{% static 'css/theme.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-default">
<link href="{% static 'css/user.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-default">
{% else %}
<link href="{% static 'css/theme-rtl.min.css' %}" type="text/css" rel="stylesheet" id="style-rtl">
<link href="{% static 'css/user-rtl.min.css' %}" type="text/css" rel="stylesheet" id="user-style-rtl">
<link href="{% static 'css/theme-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-rtl">
<link href="{% static 'css/user-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-rtl">
{% endif %}
</head>
<body>
{% include 'messages.html' %}
<main class="main" id="top">
<div class="content">
{% block content %}
<!-- Main content goes here -->
{% endblock %}
{% block content %}<!-- Main content goes here -->{% endblock %}
</div>
</main>
<!-- ===============================================-->
<!-- End of Main Content-->
<!-- ===============================================-->
<script>
</script>
{% block customJS %}{% endblock customJS %}
<!-- ===============================================-->
<!-- JavaScripts-->
<!-- ===============================================-->
<!-- ===============================================-->
<!-- End of Main Content-->
<!-- ===============================================-->
<script></script>
{% block customJS %}
{% endblock customJS %}
<!-- ===============================================-->
<!-- JavaScripts-->
<!-- ===============================================-->
<script src="{% static 'vendors/popper/popper.min.js' %}"></script>
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
<script src="{% static 'vendors/anchorjs/anchor.min.js' %}"></script>
@ -102,5 +111,4 @@
<script src="https://unpkg.com/@turf/turf@6/turf.min.js"></script>
<script src="{% static 'vendors/swiper/swiper-bundle.min.js' %}"></script>
</body>
</html>
</html>

View File

@ -1,8 +1,12 @@
{% load i18n static%}
{% load i18n static %}
<!DOCTYPE html>
{% get_current_language as LANGUAGE_CODE %}
<html lang="{{ LANGUAGE_CODE }}"
dir="{% if LANGUAGE_CODE == 'ar' %}rtl{% else %}ltr{% endif %}"
dir="{% if LANGUAGE_CODE == 'ar' %}
rtl
{% else %}
ltr
{% endif %}"
data-bs-theme=""
data-navigation-type="default"
data-navbar-horizontal-shape="default">
@ -10,22 +14,30 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Haikal - The Backbone of Car Qar: An innovative car inventory management system designed to streamline dealership operations. Manage inventory, sales, transfers, and accounting seamlessly with advanced analytics and intuitive tools. Inspired by Arabic origins, Haikal empowers businesses with precision and efficiency.">
<meta name="description"
content="Haikal - The Backbone of Car Qar: An innovative car inventory management system designed to streamline dealership operations. Manage inventory, sales, transfers, and accounting seamlessly with advanced analytics and intuitive tools. Inspired by Arabic origins, Haikal empowers businesses with precision and efficiency.">
<title>
{% block title %}
{% endblock %}
{% block description %}
{% endblock %}
{% block title %}{% endblock %}
{% block description %}{% endblock %}
</title>
<link rel="apple-touch-icon" sizes="180x180" href="{% static 'images/favicons/apple-touch-icon.png' %}">
<link rel="icon" type="image/png" sizes="32x32" href="{% static 'images/favicons/favicon-32x32.png' %}">
<link rel="icon" type="image/png" sizes="16x16" href="{% static 'images/favicons/favicon-16x16.png' %}">
<link rel="shortcut icon" type="image/x-icon" href="{% static 'images/favicons/favicon.ico' %}">
<link rel="apple-touch-icon"
sizes="180x180"
href="{% static 'images/favicons/apple-touch-icon.png' %}">
<link rel="icon"
type="image/png"
sizes="32x32"
href="{% static 'images/favicons/favicon-32x32.png' %}">
<link rel="icon"
type="image/png"
sizes="16x16"
href="{% static 'images/favicons/favicon-16x16.png' %}">
<link rel="shortcut icon"
type="image/x-icon"
href="{% static 'images/favicons/favicon.ico' %}">
<link rel="manifest" href="{% static 'images/favicons/manifest.json' %}">
<meta name="msapplication-TileImage" content="{% static 'images/logos/logo-d.png' %}">
<meta name="msapplication-TileImage"
content="{% static 'images/logos/logo-d.png' %}">
<meta name="theme-color" content="#ffffff">
{% comment %} <script src="{% static 'vendors/simplebar/simplebar.min.js' %}"></script> {% endcomment %}
<script src="{% static 'js/config.js' %}"></script>
<script src="{% static 'js/sweetalert2.all.min.js' %}"></script>
@ -33,68 +45,68 @@
{% comment %} <link href="{% static 'vendors/swiper/swiper-bundle.min.css' %}" rel="stylesheet"> {% endcomment %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800;900&amp;display=swap"
rel="stylesheet">
{% comment %} <link href="{% static 'vendors/simplebar/simplebar.min.css' %}" rel="stylesheet"> {% endcomment %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@emran-alhaddad/saudi-riyal-font/index.css">
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@emran-alhaddad/saudi-riyal-font/index.css">
{% comment %} <link href="{% static 'vendors/flatpickr/flatpickr.min.css' %}" rel="stylesheet"> {% endcomment %}
<link href="{% static 'css/custom.css' %}" rel="stylesheet">
{% comment %} <link rel="stylesheet" href="https://unicons.iconscout.com/release/v4.0.8/css/line.css"> {% endcomment %}
{% if LANGUAGE_CODE == 'ar' %}
<link href="{% static 'css/theme-rtl.min.css' %}" type="text/css" rel="stylesheet" id="style-rtl">
<link href="{% static 'css/user-rtl.min.css' %}" type="text/css" rel="stylesheet" id="user-style-rtl">
<link href="{% static 'css/theme-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-rtl">
<link href="{% static 'css/user-rtl.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-rtl">
{% else %}
<link href="{% static 'css/theme.min.css' %}" type="text/css" rel="stylesheet" id="style-default">
<link href="{% static 'css/user.min.css' %}" type="text/css" rel="stylesheet" id="user-style-default">
<link href="{% static 'css/theme.min.css' %}"
type="text/css"
rel="stylesheet"
id="style-default">
<link href="{% static 'css/user.min.css' %}"
type="text/css"
rel="stylesheet"
id="user-style-default">
{% endif %}
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'js/jquery.min.js' %}"></script>
{% comment %} <script src="{% static 'js/echarts.js' %}"></script> {% endcomment %}
{% block customCSS %}
{% endblock %}
{% block customCSS %}{% endblock %}
</head>
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
{% include "toast-alert.html" %}
<main class="main" id="top">
{% if request.user.is_authenticated %}
{% include 'header.html' %}
{% endif %}
<div class="content">
{% include "plans/expiration_messages.html" %}
{% block period_navigation %}
{% endblock period_navigation %}
{% block content %}
{% endblock content%}
{% endblock content %}
{% block body %}
{% endblock body%}
{% endblock body %}
{% include 'footer.html' %}
</div>
</main>
{% comment %} <script src="{% static 'js/djetler.bundle.js' %}"></script>
<script src="{% static 'js/js-utils.js' %}"></script> {% endcomment %}
{% comment %} <script src="{% static 'js/modal/show_modal.js' %}"></script> {% endcomment %}
<!-- ===============================================-->
<!-- JavaScripts-->
<!-- ===============================================-->
<!-- ===============================================-->
<!-- JavaScripts-->
<!-- ===============================================-->
<script src="{% static 'vendors/popper/popper.min.js' %}"></script>
<!--1-->
<script src="{% static 'vendors/bootstrap/bootstrap.min.js' %}"></script>
{% comment %} <script src="{% static 'vendors/anchorjs/anchor.min.js' %}"></script>
<script src="{% static 'vendors/is/is.min.js' %}"></script> {% endcomment %}
<!--2-->
<script src="{% static 'vendors/fontawesome/all.min.js' %}"></script>
<script src="{% static 'vendors/lodash/lodash.min.js' %}"></script>
{% comment %} <script src="{% static 'vendors/list.js/list.min.js' %}"></script> {% endcomment %}
<script src="{% static 'vendors/feather-icons/feather.min.js' %}"></script>
@ -104,15 +116,14 @@
{% comment %} <script src="{% static 'vendors/echarts/echarts.min.js' %}"></script> {% endcomment %}
{% comment %} <script src="{% static 'js/crm-analytics.js' %}"></script> {% endcomment %}
{% comment %} <script src="{% static 'js/travel-agency-dashboard.js' %}"></script>
<script src="{% static 'js/crm-dashboard.js' %}"></script>
<script src="{% static 'js/crm-dashboard.js' %}"></script>
<script src="{% static 'js/projectmanagement-dashboard.js' %}"></script> {% endcomment %}
{% comment %} <script src="{% static 'vendors/mapbox-gl/mapbox-gl.js' %}"></script> {% endcomment %}
{% comment %} <script src="{% static 'vendors/turf.min.js' %}"></script> {% endcomment %}
<script src="{% static 'vendors/htmx.min.js' %}"></script>
<script src="{% static 'js/formSubmitHandler.js' %}"></script>
{% comment %} <script src="{% static 'vendors/swiper/swiper-bundle.min.js' %}"></script>
<script src="{% static 'vendors/flatpickr/flatpickr.min.js' %}"></script> {% endcomment %}
<script>
{% if entity_slug %}
let entitySlug = "{{ view.kwargs.entity_slug }}"
@ -129,8 +140,6 @@
datePickers.forEach(dp => djLedger.getCalendar(dp.attributes.id.value, dateNavigationUrl))
{% endif %}
</script>
{% block customJS %}
{% endblock %}
{% block customJS %}{% endblock %}
</body>
</html>
</html>

View File

@ -10,7 +10,6 @@
{% block content %}
<!---->
<div class="row justify-content-center mt-5 mb-3">
<div class="col-lg-8 col-md-10">
@ -60,9 +59,6 @@
</div>
</div>
</div>
</div>
</div>
<!---->
{% endblock %}
{% endblock %}

View File

@ -3,260 +3,220 @@
{% load static %}
{% load django_ledger %}
{% load custom_filters %}
{% block title %}Bill Details - {{ block.super }}{% endblock %}
{% block customCSS %}
<style>
<style>
/* Optional custom overrides for Bootstrap 5 */
.table th,
.table td {
vertical-align: middle;
}
.table th,
.table td {
vertical-align: middle;
}
.card-header i {
font-size: 1.25rem;
}
.card-header i {
font-size: 1.25rem;
}
.text-xs {
font-size: 0.75rem;
}
.text-xs {
font-size: 0.75rem;
}
.text-xxs {
font-size: 0.6rem;
}
.text-xxs {
font-size: 0.6rem;
}
#djl-vendor-card-widget{
#djl-vendor-card-widget{
max-height:30rem;
}
max-height:30rem;
}
</style>
</style>
{% endblock %}
{% block content %}
<div class="row mt-3 mb-2">
<div class="col-12 col-md-3">
<div class="row">
<div class="col-12 mb-3">
<div class="card shadow-sm">
<div class="card-body">
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill entity_slug=view.kwargs.entity_slug style='bill-detail' %}
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="card shadow-sm ">
<div class="card-header pb-0">
<div class="d-flex align-items-center mb-2">
<i class="fas fa-sticky-note me-3 text-primary"></i>
<h5 class="mb-0">{% trans 'Bill Notes' %}</h5>
</div>
</div>
{% if perms.django_ledger.change_billmodel%}
<div class="card-body">
{% include 'bill/includes/card_markdown.html' with style='card_1' title='' notes_html=bill.notes_html %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="col-12 col-md-9">
<div class="row">
<div class="col-12">
{% if bill.is_configured %}
<div class="card mb-3 shadow-sm">
<div class="card-body">
<div class="row text-center g-3">
<div class="col-12 col-md-3">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">
{% trans 'Cash Account' %}:
<a href="{% url 'account_detail' request.dealer.slug bill.cash_account.uuid %}"
class="text-decoration-none ms-1">
{{ bill.cash_account.code }}
</a>
</h6>
<h4 class="mb-0" id="djl-bill-detail-amount-paid">
{% currency_symbol %}{{ bill.get_amount_cash | absolute | currency_format }}
</h4>
</div>
</div>
{% if bill.accrue %}
<div class="col-12 col-md-3">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">
{% trans 'Prepaid Account' %}:
<a href="{% url 'account_detail' request.dealer.slug bill.prepaid_account.uuid %}"
class="text-decoration-none ms-1">
{{ bill.prepaid_account.code }}
</a>
</h6>
<h4 class="text-success mb-0" id="djl-bill-detail-amount-prepaid">
{% currency_symbol %}{{ bill.get_amount_prepaid | currency_format }}
</h4>
</div>
</div>
<div class="col-12 col-md-3">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">
{% trans 'Accounts Payable' %}:
<a href="{% url 'account_detail' request.dealer.slug bill.unearned_account.uuid %}"
class="text-decoration-none ms-1">
{{ bill.unearned_account.code }}
</a>
</h6>
<h4 class="text-danger mb-0" id="djl-bill-detail-amount-unearned">
{% currency_symbol %}{{ bill.get_amount_unearned | currency_format }}
</h4>
</div>
</div>
<div class="col-12 col-md-3">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">
{% trans 'Accrued' %} {{ bill.get_progress | percentage }}
</h6>
<h4 class="mb-0">
{% currency_symbol %}{{ bill.get_amount_earned | currency_format }}
</h4>
</div>
</div>
{% else %}
<div class="col-12 col-md-3 offset-md-6">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">
{% trans 'You Still Owe' %}
</h6>
<h4 class="text-danger mb-0" id="djl-bill-detail-amount-owed">
{% currency_symbol %}{{ bill.get_amount_open | currency_format }}
</h4>
</div>
</div>
{% endif %}
<div class="row mt-3 mb-2">
<div class="col-12 col-md-3">
<div class="row">
<div class="col-12 mb-3">
<div class="card shadow-sm">
<div class="card-body">
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill entity_slug=view.kwargs.entity_slug style='bill-detail' %}
</div>
</div>
</div>
{% endif %}
</div>
<div class="col-12">
<div class="card mb-3 shadow-sm">
<div class="card shadow-sm ">
<div class="card-header pb-0">
<div class="d-flex align-items-center mb-2">
<i class="fas fa-receipt me-3 text-primary"></i>
<h5 class="mb-0">{% trans 'Bill Items' %}</h5>
<i class="fas fa-sticky-note me-3 text-primary"></i>
<h5 class="mb-0">{% trans 'Bill Notes' %}</h5>
</div>
</div>
<div class="card-body px-0 pt-0 pb-2">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Item' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Entity Unit' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Unit Cost' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Quantity' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Total' %}</th>
<th class="sort white-space-nowrap align-middle " scope="col">{% trans 'PO' %}</th>
</tr>
</thead>
<tbody class="list fs-9" id="project-list-table-body">
{% for bill_item in itemtxs_qs %}
<tr>
<td class="align-middle white-space-nowrap">
<div class="d-flex px-2 py-1">
<div class="d-flex flex-column justify-content-center">
<h6 class="mb-0 text-sm">{{ bill_item.item_model }}</h6>
</div>
{% if perms.django_ledger.change_billmodel %}
<div class="card-body">
{% include 'bill/includes/card_markdown.html' with style='card_1' title='' notes_html=bill.notes_html %}
</div>
{% endif %}
</div>
</div>
</div>
<div class="col-12 col-md-9">
<div class="row">
<div class="col-12">
{% if bill.is_configured %}
<div class="card mb-3 shadow-sm">
<div class="card-body">
<div class="row text-center g-3">
<div class="col-12 col-md-3">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">
{% trans 'Cash Account' %}:
<a href="{% url 'account_detail' request.dealer.slug bill.cash_account.uuid %}"
class="text-decoration-none ms-1">{{ bill.cash_account.code }}</a>
</h6>
<h4 class="mb-0" id="djl-bill-detail-amount-paid">
{% currency_symbol %}{{ bill.get_amount_cash | absolute | currency_format }}
</h4>
</div>
</div>
{% if bill.accrue %}
<div class="col-12 col-md-3">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">
{% trans 'Prepaid Account' %}:
<a href="{% url 'account_detail' request.dealer.slug bill.prepaid_account.uuid %}"
class="text-decoration-none ms-1">
{{ bill.prepaid_account.code }}
</a>
</h6>
<h4 class="text-success mb-0" id="djl-bill-detail-amount-prepaid">
{% currency_symbol %}{{ bill.get_amount_prepaid | currency_format }}
</h4>
</div>
</td>
<td class="align-middle white-space-nowrap">
<span class="text-xs font-weight-bold">
{% if bill_item.entity_unit %}
{{ bill_item.entity_unit }}
{% endif %}
</span>
</td>
<td class="align-middle white-space-nowrap">
<span class="text-xs font-weight-bold">
{{ bill_item.unit_cost | currency_format }}
</span>
</td>
<td class="align-middle white-space-nowrap">
<span class="text-xs font-weight-bold">{{ bill_item.quantity }}</span>
</td>
<td class="align-middle white-space-nowrap">
<span class="text-xs font-weight-bold">
{{ bill_item.total_amount | currency_format }}
</span>
</td>
<td class="align-items-start white-space-nowrap pe-2">
{% if bill_item.po_model_id %}
{% if perms.django_ledger.view_purchaseordermodel%}
<a class="btn btn-sm btn-phoenix-primary"
href="{% url 'purchase_order_detail' request.dealer.slug request.dealer.entity.slug bill_item.po_model_id %}">
{% trans 'View PO' %}
</a>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="3"></td>
<td class="text-end"><strong>{% trans 'Total' %}</strong></td>
<td class="text-end">
<strong>
{% currency_symbol %}{{ total_amount__sum | currency_format }}
</strong>
</td>
<td></td>
</tr>
</tfoot>
</table>
</div>
<div class="col-12 col-md-3">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">
{% trans 'Accounts Payable' %}:
<a href="{% url 'account_detail' request.dealer.slug bill.unearned_account.uuid %}"
class="text-decoration-none ms-1">
{{ bill.unearned_account.code }}
</a>
</h6>
<h4 class="text-danger mb-0" id="djl-bill-detail-amount-unearned">
{% currency_symbol %}{{ bill.get_amount_unearned | currency_format }}
</h4>
</div>
</div>
<div class="col-12 col-md-3">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">{% trans 'Accrued' %} {{ bill.get_progress | percentage }}</h6>
<h4 class="mb-0">{% currency_symbol %}{{ bill.get_amount_earned | currency_format }}</h4>
</div>
</div>
{% else %}
<div class="col-12 col-md-3 offset-md-6">
<div class="border rounded p-3">
<h6 class="text-uppercase text-xs text-muted mb-2">{% trans 'You Still Owe' %}</h6>
<h4 class="text-danger mb-0" id="djl-bill-detail-amount-owed">
{% currency_symbol %}{{ bill.get_amount_open | currency_format }}
</h4>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
<div class="col-12">
<div class="card mb-3 shadow-sm">
<div class="card-header pb-0">
<div class="d-flex align-items-center mb-2">
<i class="fas fa-receipt me-3 text-primary"></i>
<h5 class="mb-0">{% trans 'Bill Items' %}</h5>
</div>
</div>
<div class="card-body px-0 pt-0 pb-2">
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Item' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Entity Unit' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Unit Cost' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Quantity' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Total' %}</th>
<th class="sort white-space-nowrap align-middle " scope="col">{% trans 'PO' %}</th>
</tr>
</thead>
<tbody class="list fs-9" id="project-list-table-body">
{% for bill_item in itemtxs_qs %}
<tr>
<td class="align-middle white-space-nowrap">
<div class="d-flex px-2 py-1">
<div class="d-flex flex-column justify-content-center">
<h6 class="mb-0 text-sm">{{ bill_item.item_model }}</h6>
</div>
</div>
</td>
<td class="align-middle white-space-nowrap">
<span class="text-xs font-weight-bold">
{% if bill_item.entity_unit %}{{ bill_item.entity_unit }}{% endif %}
</span>
</td>
<td class="align-middle white-space-nowrap">
<span class="text-xs font-weight-bold">{{ bill_item.unit_cost | currency_format }}</span>
</td>
<td class="align-middle white-space-nowrap">
<span class="text-xs font-weight-bold">{{ bill_item.quantity }}</span>
</td>
<td class="align-middle white-space-nowrap">
<span class="text-xs font-weight-bold">{{ bill_item.total_amount | currency_format }}</span>
</td>
<td class="align-items-start white-space-nowrap pe-2">
{% if bill_item.po_model_id %}
{% if perms.django_ledger.view_purchaseordermodel %}
<a class="btn btn-sm btn-phoenix-primary"
href="{% url 'purchase_order_detail' request.dealer.slug request.dealer.entity.slug bill_item.po_model_id %}">
{% trans 'View PO' %}
</a>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="3"></td>
<td class="text-end">
<strong>{% trans 'Total' %}</strong>
</td>
<td class="text-end">
<strong>{% currency_symbol %}{{ total_amount__sum | currency_format }}</strong>
</td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-12">
<div class="card mb-3 shadow-sm">
<div class="card-header pb-0">
<div class="d-flex align-items-center mb-2">
<i class="fas fa-exchange-alt me-3 text-primary"></i>
<h5 class="mb-0">{% trans 'Bill Transactions' %}</h5>
<div class="col-12">
<div class="card mb-3 shadow-sm">
<div class="card-header pb-0">
<div class="d-flex align-items-center mb-2">
<i class="fas fa-exchange-alt me-3 text-primary"></i>
<h5 class="mb-0">{% trans 'Bill Transactions' %}</h5>
</div>
</div>
</div>
<div class="card-body px-0 pt-0 pb-2 table-responsive">
{% transactions_table bill %}
<div class="card-body px-0 pt-0 pb-2 table-responsive">{% transactions_table bill %}</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% include "bill/includes/mark_as.html" %}
{% endblock %}
{% include "bill/includes/mark_as.html" %}
{% endblock %}

View File

@ -4,56 +4,36 @@
{% load django_ledger %}
{% load custom_filters %}
{% load widget_tweaks crispy_forms_filters %}
{% block content %}
<div class="container py-4">
<div class="row g-2">
<!-- Bill Form -->
<!-- Bill Form -->
<div class="col-12">
<div class="row">
<div class="col">
<div class="card mb-2">
<div class="card-body">
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill_model style='bill-detail' entity_slug=view.kwargs.entity_slug %}
<form action="{% url 'bill-update' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug bill_pk=bill_model.uuid %}" method="post">
{% csrf_token %}
<div class="mb-3">
{{ form|crispy }}
<div class="card mb-2">
<div class="card-body">
{% include 'bill/includes/card_bill.html' with dealer_slug=request.dealer.slug bill=bill_model style='bill-detail' entity_slug=view.kwargs.entity_slug %}
<form action="{% url 'bill-update' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug bill_pk=bill_model.uuid %}"
method="post">
{% csrf_token %}
<div class="mb-3">{{ form|crispy }}</div>
<button type="submit" class="btn btn-phoenix-primary mb-2 me-2">
<i class="fas fa-save me-2"></i>{% trans 'Save Bill' %}
</button>
<a href="{% url 'bill-detail' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug bill_pk=bill_model.uuid %}"
class="btn btn-phoenix-secondary mb-2">
<i class="fas fa-arrow-left me-2"></i>{% trans 'Back to Bill Detail' %}
</a>
</form>
</div>
<button type="submit" class="btn btn-phoenix-primary mb-2 me-2">
<i class="fas fa-save me-2"></i>{% trans 'Save Bill' %}
</button>
<a href="{% url 'bill-detail' dealer_slug=request.dealer.slug entity_slug=view.kwargs.entity_slug bill_pk=bill_model.uuid %}"
class="btn btn-phoenix-secondary mb-2">
<i class="fas fa-arrow-left me-2"></i>{% trans 'Back to Bill Detail' %}
</a>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Bill Item Formset -->
<div class="col-12">
{% bill_item_formset_table itemtxs_formset %}
</div>
<!-- Bill Item Formset -->
<div class="col-12">{% bill_item_formset_table itemtxs_formset %}</div>
</div>
</div>
{% include "bill/includes/mark_as.html" %}
{% endblock %}
{% endblock %}

View File

@ -1,22 +1,19 @@
{% load django_ledger %}
{% load i18n %}
<div id="djl-bill-card-widget" class="">
{% if not create_bill %}
{% if style == 'dashboard' %}
<!-- Dashboard Style Card -->
<div class="">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center mb-3 text-primary">
<h6 class="text-uppercase text-primary mb-0">
<i class="fas fa-file-invoice me-2"></i>{% trans 'Bill' %}
</h6>
<span class="badge bg-{{ bill.get_status_badge_color }}">{{ bill.get_bill_status_display }}</span>
<span class="badge bg-{{ bill.get_status_badge_color }}">{{ bill.get_bill_status_display }}</span>
</div>
<h4 class="card-title">{{ bill.vendor.vendor_name }}</h4>
<p class="text-sm text-muted mb-4">{{ bill.vendor.address_1 }}</p>
{% if not bill.is_past_due %}
<p class="text-info mb-2">
<i class="fas fa-clock me-2"></i>{% trans 'Due in' %}: {{ bill.date_due | timeuntil }}
@ -26,7 +23,6 @@
<i class="fas fa-exclamation-triangle me-2"></i>{% trans 'Past Due' %}: {{ bill.date_due | timesince }} {% trans 'ago' %}
</p>
{% endif %}
<div class="d-flex align-items-center mb-3">
<span class="me-2">{% trans 'Accrued' %}:</span>
{% if bill.accrue %}
@ -35,7 +31,6 @@
<i class="fas fa-times-circle text-danger me-2"></i>
{% endif %}
</div>
<div class="mb-4">
<p class="text-danger fw-bold mb-1">
{% trans 'Amount Due' %}: {% currency_symbol %}{{ bill.get_amount_open | currency_format }}
@ -43,78 +38,56 @@
<p class="text-success mb-1">
{% trans 'Amount Paid' %}: {% currency_symbol %}{{ bill.amount_paid | currency_format }}
</p>
<p class="mb-1">
{% trans 'Progress' %}: {{ bill.get_progress | percentage }}
</p>
<p class="mb-1">{% trans 'Progress' %}: {{ bill.get_progress | percentage }}</p>
<div class="progress mt-2">
<div class="progress-bar bg-success"
role="progressbar"
style="width: {{ bill.get_progress_percent }}%"
aria-valuenow="{{ bill.get_progress_percent }}"
aria-valuemin="0"
aria-valuemax="100">
</div>
aria-valuemax="100"></div>
</div>
</div>
<!-- Modal Action -->
{% modal_action bill 'get' entity_slug %}
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{% url 'django_ledger:bill-detail' entity_slug=entity_slug bill_pk=bill.uuid %}"
class="btn btn-sm btn-phoenix-primary me-md-2">
{% trans 'View' %}
</a>
class="btn btn-sm btn-phoenix-primary me-md-2">{% trans 'View' %}</a>
{% if perms.django_ledger.change_billmodel %}
<a href="{% url 'django_ledger:bill-update' entity_slug=entity_slug bill_pk=bill.uuid %}"
class="btn btn-sm btn-phoenix-warning me-md-2">
{% trans 'Update' %}
</a>
{% if bill.can_pay %}
<button onclick="djLedger.toggleModal('{{ bill.get_html_id }}')"
class="btn btn-sm btn-phoenix-info">
{% trans 'Mark as Paid' %}
</button>
<a href="{% url 'django_ledger:bill-update' entity_slug=entity_slug bill_pk=bill.uuid %}"
class="btn btn-sm btn-phoenix-warning me-md-2">{% trans 'Update' %}</a>
{% if bill.can_pay %}
<button onclick="djLedger.toggleModal('{{ bill.get_html_id }}')"
class="btn btn-sm btn-phoenix-info">{% trans 'Mark as Paid' %}</button>
{% endif %}
{% if bill.can_cancel %}
<button onclick="djLedger.toggleModal('{{ bill.get_html_id }}')"
class="btn btn-sm btn-phoenix-danger">{% trans 'Cancel' %}</button>
{% endif %}
{% endif %}
{% if bill.can_cancel %}
<button onclick="djLedger.toggleModal('{{ bill.get_html_id }}')"
class="btn btn-sm btn-phoenix-danger">
{% trans 'Cancel' %}
</button>
{% endif %}
{% endif %}
</div>
</div>
</div>
{% elif style == 'bill-detail' %}
<!-- Detail Style Card -->
<div class="">
<div class="card-header p-2 bg-{{ bill.get_status_badge_color }}">
<div class="d-flex align-items-center justify-content-center mb-2 text-primary">
<i class="fas fa-file-invoice me-3 "></i>
<h4 class="mb-0 text-primary me-2">
{% trans 'Bill' %} {{ bill.bill_number }}
</h4>
<h4 class="mb-0 text-primary me-2">{% trans 'Bill' %} {{ bill.bill_number }}</h4>
</div>
<a href="{% url 'bill_list' request.dealer.slug %}"
class="btn btn-phoenix-primary mb-2">
<i class="fas fa-long-arrow-alt-left me-2"></i>{% trans 'Back to Bill List' %}
</a>
<a href="{% url 'bill_list' request.dealer.slug %}"
class="btn btn-phoenix-primary mb-2">
<i class="fas fa-long-arrow-alt-left me-2"></i>{% trans 'Back to Bill List' %}
</a>
</div>
<div class="card-body p-2 text-center">
{% if bill.is_draft %}
<h3 class="text-warning fw-bold mb-4">{% trans 'This bill is' %} {{ bill.get_bill_status_display }}</h3>
<p class="mb-2">
<span class="fw-bold">{% trans 'Vendor Name' %}:</span>
{{ bill.vendor.vendor_name }}
</p>
<span class="fw-bold">{% trans 'Vendor Name' %}:</span>
{{ bill.vendor.vendor_name }}
</p>
<div class="border-bottom pb-2 mb-4">
<p class="mb-2">
<span class="fw-bold">{% trans 'Amount Due' %}:</span>
@ -136,9 +109,9 @@
{% elif bill.is_review %}
<h3 class="text-warning fw-bold mb-4">{% trans 'This bill is' %} {{ bill.get_bill_status_display }}</h3>
<p class="mb-2">
<span class="fw-bold">{% trans 'Vendor Name' %}:</span>
{{ bill.vendor.vendor_name }}
</p>
<span class="fw-bold">{% trans 'Vendor Name' %}:</span>
{{ bill.vendor.vendor_name }}
</p>
<div class="border-bottom pb-2 mb-4">
<p class="mb-2">
<span class="fw-bold">{% trans 'Amount Due' %}:</span>
@ -163,9 +136,9 @@
{% elif bill.is_approved %}
<h3 class="text-info fw-bold mb-4">{% trans 'This bill is' %} {{ bill.get_bill_status_display }}</h3>
<p class="mb-2">
<span class="fw-bold">{% trans 'Vendor Name' %}:</span>
{{ bill.vendor.vendor_name }}
</p>
<span class="fw-bold">{% trans 'Vendor Name' %}:</span>
{{ bill.vendor.vendor_name }}
</p>
<div class="border-bottom pb-2 mb-4">
<p class="mb-2">
<span class="fw-bold">{% trans 'Amount Due' %}:</span>
@ -189,8 +162,7 @@
style="width: {{ bill.get_progress_percent }}%"
aria-valuenow="{{ bill.get_progress_percent }}"
aria-valuemin="0"
aria-valuemax="100">
</div>
aria-valuemax="100"></div>
</div>
</div>
{% if bill.xref %}
@ -198,10 +170,10 @@
{% endif %}
{% elif bill.is_paid %}
<h3 class="text-success fw-bold mb-4">{% trans 'This bill is' %} {{ bill.get_bill_status_display }}</h3>
<p class="mb-2">
<span class="fw-bold">{% trans 'Vendor Name' %}:</span>
{{ bill.vendor.vendor_name }}
</p>
<p class="mb-2">
<span class="fw-bold">{% trans 'Vendor Name' %}:</span>
{{ bill.vendor.vendor_name }}
</p>
<div class="border-bottom pb-2 mb-4">
<p class="mb-2">
<span class="fw-bold">{% trans 'Amount Paid' %}:</span>
@ -221,95 +193,91 @@
<span class="fw-bold">{% trans 'Bill Amount' %}:</span>
{% currency_symbol %}{{ bill.amount_due | currency_format }}
</p>
<p class="text-danger fw-bold">
{{ bill.get_bill_status_display | upper }}
</p>
<p class="text-danger fw-bold">{{ bill.get_bill_status_display | upper }}</p>
</div>
{% endif %}
</div>
<div class="card-footer p-0">
<div class="d-flex flex-wrap gap-2 mt-2">
<!-- Update Button -->
{% if perms.django_ledger.change_billmodel%}
<button class="btn btn-phoenix-primary" {% if not request.is_accountant %} disabled {% endif %}>
<a href="{% url 'bill-update' dealer_slug=dealer_slug entity_slug=entity_slug bill_pk=bill.uuid %}">
<i class="fas fa-edit me-2"></i>{% trans 'Update' %}
</a>
</button>
<!-- Mark as Draft -->
{% if bill.can_draft %}
<button class="btn btn-phoenix-success"
{% if not request.is_accountant %} disabled {% endif %}
onclick="showPOModal('Mark as Draft', '{% url 'bill-action-mark-as-draft' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Draft')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Draft' %}
{% if perms.django_ledger.change_billmodel %}
<button class="btn btn-phoenix-primary"
{% if not request.is_accountant %}disabled{% endif %}>
<a href="{% url 'bill-update' dealer_slug=dealer_slug entity_slug=entity_slug bill_pk=bill.uuid %}">
<i class="fas fa-edit me-2"></i>{% trans 'Update' %}
</a>
</button>
<!-- Mark as Draft -->
{% if bill.can_draft %}
<button class="btn btn-phoenix-success"
{% if not request.is_accountant %}disabled{% endif %}
onclick="showPOModal('Mark as Draft', '{% url 'bill-action-mark-as-draft' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Draft')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Draft' %}
</button>
{% endif %}
<!-- Mark as Review -->
{% if bill.can_review %}
<button class="btn btn-phoenix-warning"
{% if not request.is_accountant %}disabled{% endif %}
onclick="showPOModal('Mark as Review', '{% url 'bill-action-mark-as-review' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Review')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Review' %}
</button>
{% endif %}
<!-- Mark as Approved -->
{% if bill.can_approve and perms.django_ledger.can_approve_billmodel %}
<button class="btn btn-phoenix-success"
onclick="showPOModal('Mark as Approved', '{% url 'bill-action-mark-as-approved' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Approved')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Approved' %}
</button>
{% endif %}
{% if bill.can_approve and not request.is_manager %}
<button class="btn btn-phoenix-warning" disabled>
<i class="fas fa-hourglass-start me-2"></i><span class="text-warning">{% trans 'Waiting for Manager Approval' %}</span>
</button>
{% endif %}
<!-- Mark as Paid -->
{% if bill.can_pay %}
<button class="btn btn-phoenix-success"
onclick="showPOModal('Mark as Paid', '{% url 'bill-action-mark-as-paid' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Paid')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Paid' %}
</button>
{% endif %}
<!-- Void Button -->
{% if bill.can_void %}
<button class="btn btn-phoenix-danger"
onclick="showPOModal('Mark as Void', '{% url 'bill-action-mark-as-void' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Void')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Void' %}
</button>
{% endif %}
<!-- Cancel Button -->
{% if bill.can_cancel %}
<button class="btn btn-phoenix-danger"
{% if not request.is_accountant %}disabled{% endif %}
onclick="showPOModal('Mark as Canceled', '{% url 'bill-action-mark-as-canceled' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Canceled')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Canceled' %}
</button>
{% modal_action_v2 bill bill.get_mark_as_canceled_url bill.get_mark_as_canceled_message bill.get_mark_as_canceled_html_id %}
{% endif %}
{% endif %}
<!-- Mark as Review -->
{% if bill.can_review %}
<button class="btn btn-phoenix-warning"
{% if not request.is_accountant %} disabled {% endif %}
onclick="showPOModal('Mark as Review', '{% url 'bill-action-mark-as-review' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Review')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Review' %}
</button>
{% endif %}
<!-- Mark as Approved -->
{% if bill.can_approve and perms.django_ledger.can_approve_billmodel %}
<button class="btn btn-phoenix-success"
onclick="showPOModal('Mark as Approved', '{% url 'bill-action-mark-as-approved' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Approved')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Approved' %}
</button>
{% endif %}
{% if bill.can_approve and not request.is_manager %}
<button class="btn btn-phoenix-warning" disabled>
<i class="fas fa-hourglass-start me-2"></i><span class="text-warning">{% trans 'Waiting for Manager Approval' %}</span>
</button>
{% endif %}
<!-- Mark as Paid -->
{% if bill.can_pay %}
<button class="btn btn-phoenix-success"
onclick="showPOModal('Mark as Paid', '{% url 'bill-action-mark-as-paid' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Paid')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Paid' %}
</button>
{% endif %}
<!-- Void Button -->
{% if bill.can_void %}
<button class="btn btn-phoenix-danger"
onclick="showPOModal('Mark as Void', '{% url 'bill-action-mark-as-void' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Void')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Void' %}
</button>
{% endif %}
<!-- Cancel Button -->
{% if bill.can_cancel %}
<button class="btn btn-phoenix-danger"
{% if not request.is_accountant %} disabled {% endif %}
onclick="showPOModal('Mark as Canceled', '{% url 'bill-action-mark-as-canceled' dealer_slug=request.dealer.slug entity_slug=entity_slug bill_pk=bill.pk %}', 'Mark as Canceled')">
<i class="fas fa-check-circle me-2"></i>{% trans 'Mark as Canceled' %}
</button>
{% modal_action_v2 bill bill.get_mark_as_canceled_url bill.get_mark_as_canceled_message bill.get_mark_as_canceled_html_id %}
{% endif %}
{% endif %}
</div>
</div>
</div>
{% endif %}
{% else %}
<!-- Create Bill Card -->
{% if perms.django_ledger.add_billmodel%}
<div class=" bg-light">
<div class="card-body text-center p-5">
<a href="{% url 'django_ledger:bill-create' entity_slug=entity_slug %}"
class="text-primary">
<i class="fas fa-plus-circle fa-4x mb-3"></i>
<h3 class="h4">{% trans 'New Bill' %}</h3>
</a>
{% if perms.django_ledger.add_billmodel %}
<div class=" bg-light">
<div class="card-body text-center p-5">
<a href="{% url 'django_ledger:bill-create' entity_slug=entity_slug %}"
class="text-primary">
<i class="fas fa-plus-circle fa-4x mb-3"></i>
<h3 class="h4">{% trans 'New Bill' %}</h3>
</a>
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
<style>
.card-footer .btn-link {
padding: 1rem;
@ -320,7 +288,6 @@
background-color: rgba(0,0,0,0.03);
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
window.showPOModal = function(title, actionUrl, buttonText) {
@ -347,4 +314,4 @@
modal.show();
};
});
</script>
</script>

View File

@ -1,15 +1,13 @@
{% load trans from i18n %}
{% load django_ledger %}
{% if style == 'card_1' %}
<div class="card h-100" style="height: 25rem;">
<div class="card-body overflow-auto">
{% if notes_html %}
{{ notes_html|safe }}
{% else %}
<p class="card-text">{% trans 'No available notes to display...' %}</p>
{% endif %}
<div class="card h-100" style="height: 25rem;">
<div class="card-body overflow-auto">
{% if notes_html %}
{{ notes_html|safe }}
{% else %}
<p class="card-text">{% trans 'No available notes to display...' %}</p>
{% endif %}
</div>
</div>
</div>
{% endif %}

View File

@ -1,19 +1,21 @@
{% load i18n %}
{% load django_ledger %}
<div class="card " id="djl-vendor-card-widget" >
<div class="card " id="djl-vendor-card-widget">
<div class="card-header">
<h2 class="card-title d-flex align-items-center text-primary">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-person-lines-fill me-2" viewBox="0 0 16 16">
<path d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm-1 0a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-5 0a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zM2 3a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4A.5.5 0 0 1 2 3zm9.854 2.854a.5.5 0 0 1 0-.708l3-3a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0zM2.5 14.5c0-.827.673-1.5 1.5-1.5h7c.827 0 1.5.673 1.5 1.5s-.673 1.5-1.5 1.5h-7c-.827 0-1.5-.673-1.5-1.5z"/>
<svg xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
fill="currentColor"
class="bi bi-person-lines-fill me-2"
viewBox="0 0 16 16">
<path d="M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm-1 0a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-5 0a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zM2 3a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4A.5.5 0 0 1 2 3zm9.854 2.854a.5.5 0 0 1 0-.708l3-3a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0zM2.5 14.5c0-.827.673-1.5 1.5-1.5h7c.827 0 1.5.673 1.5 1.5s-.673 1.5-1.5 1.5h-7c-.827 0-1.5-.673-1.5-1.5z" />
</svg>
{% trans 'Vendor Info' %}
</h2>
</div>
<div class="card-body">
<h4 class="card-title fw-bold mb-3">{{ vendor.vendor_name }}</h4>
<p class="card-text mb-0">
{% if vendor.address_1 %}<span class="d-block">{{ vendor.address_1 }}</span>{% endif %}
{% if vendor.address_2 %}<span class="d-block">{{ vendor.address_2 }}</span>{% endif %}
@ -23,4 +25,4 @@
{% if vendor.website %}<span class="d-block">{{ vendor.website }}</span>{% endif %}
</p>
</div>
</div>
</div>

View File

@ -4,11 +4,14 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="POModalTitle"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body" id="POModalBody">
<!-- Content will be inserted here by JavaScript -->
</div>
</div>
</div>
</div>
</div>

View File

@ -2,8 +2,8 @@
{% load static %}
{% load django_ledger %}
{% load widget_tweaks %}
<form action="{% url 'bill-update-items' dealer_slug=dealer_slug entity_slug=entity_slug bill_pk=bill_pk %}" method="post">
<form action="{% url 'bill-update-items' dealer_slug=dealer_slug entity_slug=entity_slug bill_pk=bill_pk %}"
method="post">
<div class="container-fluid py-4">
<!-- Page Header -->
<div class="row mb-4">
@ -15,14 +15,12 @@
<hr class="my-3">
</div>
</div>
<!-- Form Content -->
<div class="row">
<div class="col-12">
{% csrf_token %}
{{ item_formset.non_form_errors }}
{{ item_formset.management_form }}
<!-- Card Container -->
<div class="card shadow-sm">
<div class="card-body p-0">
@ -44,33 +42,25 @@
<tbody>
{% for f in item_formset %}
<tr class="align-middle">
<!-- Item Column -->
<!-- Item Column -->
<td>
<div class="d-flex flex-column ms-2">
{% for hidden_field in f.hidden_fields %}
{{ hidden_field }}
{% endfor %}
{% for hidden_field in f.hidden_fields %}{{ hidden_field }}{% endfor %}
{{ f.item_model|add_class:"form-control" }}
{% if f.errors %}
<span class="text-danger text-xs">{{ f.errors }}</span>
{% endif %}
{% if f.errors %}<span class="text-danger text-xs">{{ f.errors }}</span>{% endif %}
</div>
</td>
<!-- PO Quantity -->
<!-- PO Quantity -->
<td class="text-center">
<span class="text-muted text-xs">
{% if f.instance.po_quantity %}{{ f.instance.po_quantity }}{% endif %}
</span>
</td>
<!-- PO Amount -->
<!-- PO Amount -->
<td class="text-center">
{% if f.instance.po_total_amount %}
<div class="d-flex flex-column">
<span class="text-xs font-weight-bold">
{% currency_symbol %}{{ f.instance.po_total_amount | currency_format }}
</span>
<span class="text-xs font-weight-bold">{% currency_symbol %}{{ f.instance.po_total_amount | currency_format }}</span>
<a class="btn btn-sm btn-phoenix-info mt-1"
href="{% url 'purchase_order_detail' dealer_slug entity_slug f.instance.po_model_id %}">
{% trans 'View PO' %}
@ -78,54 +68,38 @@
</div>
{% endif %}
</td>
<!-- Quantity -->
<!-- Quantity -->
<td class="text-center">
<div class="input-group input-group-sm w-100">
{{ f.quantity|add_class:"form-control" }}
</div>
<div class="input-group input-group-sm w-100">{{ f.quantity|add_class:"form-control" }}</div>
</td>
<!-- Unit Cost -->
<!-- Unit Cost -->
<td class="text-center">
<div class="input-group input-group-sm w-100">
{{ f.unit_cost|add_class:"form-control" }}
</div>
<div class="input-group input-group-sm w-100">{{ f.unit_cost|add_class:"form-control" }}</div>
</td>
<!-- Entity Unit -->
<td class="text-center">
{{ f.entity_unit|add_class:"form-control" }}
</td>
<!-- Total Amount -->
<!-- Entity Unit -->
<td class="text-center">{{ f.entity_unit|add_class:"form-control" }}</td>
<!-- Total Amount -->
<td class="text-end">
<span class="text-xs font-weight-bold">
<span>{% currency_symbol %}</span>{{ f.instance.total_amount | currency_format }}
</span>
</td>
<!-- Delete Checkbox -->
<!-- Delete Checkbox -->
<td class="text-center">
{% if item_formset.can_delete %}
<div class="form-check d-flex justify-content-center">
{{ f.DELETE }}
</div>
{% endif %}
{% if item_formset.can_delete %}<div class="form-check d-flex justify-content-center">{{ f.DELETE }}</div>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
<!-- Footer Total -->
<tfoot class="total-row">
<tr>
<td colspan="5"></td>
<td class="text-end"><strong>{% trans 'Total' %}</strong></td>
<td class="text-end">
<strong>
{% currency_symbol %}{{ total_amount__sum | currency_format }}
</strong>
<strong>{% trans 'Total' %}</strong>
</td>
<td class="text-end">
<strong>{% currency_symbol %}{{ total_amount__sum | currency_format }}</strong>
</td>
<td></td>
</tr>
@ -136,7 +110,6 @@
</div>
</div>
</div>
<!-- Action Buttons -->
<div class="row mt-4">
<div class="col-12">

View File

@ -1,8 +1,6 @@
{% load django_ledger %}
{% load i18n %}
<div class="table-container">
<table class="table is-fullwidth is-narrow is-striped is-bordered django-ledger-table-bottom-margin-75">
<thead>
<tr>
@ -23,17 +21,16 @@
<td>{{ bill.get_bill_status_display }}</td>
<td>{{ bill.get_status_action_date }}</td>
<td>{{ bill.vendor.vendor_name }}</td>
<td id="{{ bill.get_html_amount_due_id }}">
{% currency_symbol %}{{ bill.amount_due | currency_format }}</td>
<td id="{{ bill.get_html_amount_paid_id }}">
{% currency_symbol %}{{ bill.amount_paid | currency_format }}</td>
<td id="{{ bill.get_html_amount_due_id }}">{% currency_symbol %}{{ bill.amount_due | currency_format }}</td>
<td id="{{ bill.get_html_amount_paid_id }}">{% currency_symbol %}{{ bill.amount_paid | currency_format }}</td>
<td class="has-text-centered">
{% if bill.is_past_due %}
<span class="icon is-small has-text-danger">{% icon 'bi:check-circle-fill' 24 %}</span>
{% endif %}
</td>
<td class="has-text-centered">
<div class="dropdown is-right is-hoverable" id="bill-action-{{ bill.uuid }}">
<div class="dropdown is-right is-hoverable"
id="bill-action-{{ bill.uuid }}">
<div class="dropdown-trigger">
<button class="button is-small is-rounded is-outlined is-dark"
aria-haspopup="true"
@ -56,5 +53,4 @@
{% endfor %}
</tbody>
</table>
</div>

View File

@ -1,11 +1,9 @@
{% load i18n %}
{% load django_ledger %}
{% if style == 'detail' %}
<div class="table-responsive">
<table class="table table-hover">
<thead >
<thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Timestamp' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Account' %}</th>
@ -17,23 +15,31 @@
</tr>
</thead>
<tbody class="fs-9">
{% for transaction_model in transaction_model_qs %}
<tr>
<td class=" white-space-nowrap align-middle ps-2" scope="col" >{{ transaction_model.timestamp }}</td>
<td class=" white-space-nowrap align-middle ps-2" scope="col">{{ transaction_model.timestamp }}</td>
<td class=" white-space-nowrap align-middle" scope="col">{{ transaction_model.account_code }}</td>
<td class=" white-space-nowrap align-middle" scope="col">{{ transaction_model.account_name }}</td>
<td class=" white-space-nowrap align-middle" scope="col">{% if transaction_model.entity_unit_name %}{{ transaction_model.entity_unit_name }}{% endif %}</td>
<td class=" white-space-nowrap align-middle" scope="col">{% if transaction_model.is_credit %}{{ transaction_model.amount | currency_format }}{% endif %}</td>
<td class=" white-space-nowrap align-middle" scope="col">{% if transaction_model.is_debit %}{{ transaction_model.amount | currency_format }}{% endif %}</td>
<td class=" white-space-nowrap align-middle pe-2" scope="col">{% if transaction_model.description %}{{ transaction_model.description }}{% endif %}</td>
<td class=" white-space-nowrap align-middle" scope="col">
{% if transaction_model.entity_unit_name %}{{ transaction_model.entity_unit_name }}{% endif %}
</td>
<td class=" white-space-nowrap align-middle" scope="col">
{% if transaction_model.is_credit %}{{ transaction_model.amount | currency_format }}{% endif %}
</td>
<td class=" white-space-nowrap align-middle" scope="col">
{% if transaction_model.is_debit %}{{ transaction_model.amount | currency_format }}{% endif %}
</td>
<td class=" white-space-nowrap align-middle pe-2" scope="col">
{% if transaction_model.description %}{{ transaction_model.description }}{% endif %}
</td>
</tr>
{% endfor %}
<tr class="fw-bold">
<td class=" white-space-nowrap align-middle" colspan="3"></td>
<td class=" white-space-nowrap align-middle" scope="col">{% trans 'Total' %}</td>
<td class=" white-space-nowrap align-middle" scope="col">{% currency_symbol %}{{ total_credits | currency_format }}</td>
<td class=" white-space-nowrap align-middle" scope="col">{% trans 'Total' %}</td>
<td class=" white-space-nowrap align-middle" scope="col">
{% currency_symbol %}{{ total_credits | currency_format }}
</td>
<td class=" white-space-nowrap align-middle" scope="col">{% currency_symbol %}{{ total_debits | currency_format }}</td>
<td class=" white-space-nowrap align-middle" scope="col"></td>
</tr>
@ -56,9 +62,15 @@
<tr>
<td class=" white-space-nowrap align-middle ps-2">{{ transaction_model.account_code }}</td>
<td class=" white-space-nowrap align-middle">{{ transaction_model.account_name }}</td>
<td class=" white-space-nowrap align-middle">{% if transaction_model.is_credit %}{{ transaction_model.amount | currency_format }}{% endif %}</td>
<td class=" white-space-nowrap align-middle">{% if transaction_model.is_debit %}{{ transaction_model.amount | currency_format }}{% endif %}</td>
<td class=" white-space-nowrap align-middle pe-2">{% if transaction_model.description %}{{ transaction_model.description }}{% endif %}</td>
<td class=" white-space-nowrap align-middle">
{% if transaction_model.is_credit %}{{ transaction_model.amount | currency_format }}{% endif %}
</td>
<td class=" white-space-nowrap align-middle">
{% if transaction_model.is_debit %}{{ transaction_model.amount | currency_format }}{% endif %}
</td>
<td class=" white-space-nowrap align-middle pe-2">
{% if transaction_model.description %}{{ transaction_model.description }}{% endif %}
</td>
</tr>
{% endfor %}
<tr class="fw-bold">
@ -72,4 +84,3 @@
</table>
</div>
{% endif %}

View File

@ -1,43 +1,84 @@
<div class="support-chat-row">
<div class="row-fluid support-chat">
<div class="card bg-body-emphasis">
<div class="card-header d-flex flex-between-center px-4 py-3 border-bottom border-translucent">
<h5 class="mb-0 d-flex align-items-center gap-2">Demo widget<span class="fa-solid fa-circle text-success fs-11"></span></h5>
<div class="btn-reveal-trigger">
<button class="btn btn-link p-0 dropdown-toggle dropdown-caret-none transition-none d-flex" type="button" id="support-chat-dropdown" data-bs-toggle="dropdown" data-boundary="window" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"><span class="fas fa-ellipsis-h text-body"></span></button>
<div class="dropdown-menu dropdown-menu-end py-2" aria-labelledby="support-chat-dropdown"><a class="dropdown-item" href="#!">Request a callback</a><a class="dropdown-item" href="#!">Search in chat</a><a class="dropdown-item" href="#!">Show history</a><a class="dropdown-item" href="#!">Report to Admin</a><a class="dropdown-item btn-support-chat" href="#!">Close Support</a></div>
<div class="row-fluid support-chat">
<div class="card bg-body-emphasis">
<div class="card-header d-flex flex-between-center px-4 py-3 border-bottom border-translucent">
<h5 class="mb-0 d-flex align-items-center gap-2">
Demo widget<span class="fa-solid fa-circle text-success fs-11"></span>
</h5>
<div class="btn-reveal-trigger">
<button class="btn btn-link p-0 dropdown-toggle dropdown-caret-none transition-none d-flex"
type="button"
id="support-chat-dropdown"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h text-body"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2"
aria-labelledby="support-chat-dropdown">
<a class="dropdown-item" href="#!">Request a callback</a><a class="dropdown-item" href="#!">Search in chat</a><a class="dropdown-item" href="#!">Show history</a><a class="dropdown-item" href="#!">Report to Admin</a><a class="dropdown-item btn-support-chat" href="#!">Close Support</a>
</div>
</div>
</div>
<div class="card-body chat p-0">
<div class="d-flex flex-column-reverse scrollbar h-100 p-3">
<div class="text-end mt-6">
<a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3"
href="#!">
<p class="mb-0 fw-semibold fs-9">I need help with something</p>
<span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3"
href="#!">
<p class="mb-0 fw-semibold fs-9">I cant reorder a product I previously ordered</p>
<span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3"
href="#!">
<p class="mb-0 fw-semibold fs-9">How do I place an order?</p>
<span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="false d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3"
href="#!">
<p class="mb-0 fw-semibold fs-9">My payment method not working</p>
<span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a>
</div>
</div>
<div class="card-body chat p-0">
<div class="d-flex flex-column-reverse scrollbar h-100 p-3">
<div class="text-end mt-6"><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3" href="#!">
<p class="mb-0 fw-semibold fs-9">I need help with something</p><span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3" href="#!">
<p class="mb-0 fw-semibold fs-9">I cant reorder a product I previously ordered</p><span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="mb-2 d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3" href="#!">
<p class="mb-0 fw-semibold fs-9">How do I place an order?</p><span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a><a class="false d-inline-flex align-items-center text-decoration-none text-body-emphasis bg-body-hover rounded-pill border border-primary py-2 ps-4 pe-3" href="#!">
<p class="mb-0 fw-semibold fs-9">My payment method not working</p><span class="fa-solid fa-paper-plane text-primary fs-9 ms-3"></span>
</a>
</div>
<div class="text-center mt-auto">
<div class="avatar avatar-3xl status-online"><img class="rounded-circle border border-3 border-light-subtle" src="{% static 'images/team/40x40/30.webp' %}" alt="" /></div>
<div class="text-center mt-auto">
<div class="avatar avatar-3xl status-online">
<img class="rounded-circle border border-3 border-light-subtle"
src="{% static 'images/team/40x40/30.webp' %}"
alt="" />
</div>
<h5 class="mt-2 mb-3">Eric</h5>
<p class="text-center text-body-emphasis mb-0">Ask us anything well get back to you here or by email within 24 hours.</p>
</div>
<p class="text-center text-body-emphasis mb-0">
Ask us anything well get back to you here or by email within 24 hours.
</p>
</div>
</div>
<div class="card-footer d-flex align-items-center gap-2 border-top border-translucent ps-3 pe-4 py-3">
<div class="d-flex align-items-center flex-1 gap-3 border border-translucent rounded-pill px-4">
<input class="form-control outline-none border-0 flex-1 fs-9 px-0" type="text" placeholder="Write message" />
<label class="btn btn-link d-flex p-0 text-body-quaternary fs-9 border-0" for="supportChatPhotos"><span class="fa-solid fa-image"></span></label>
<input class="d-none" type="file" accept="image/*" id="supportChatPhotos" />
<label class="btn btn-link d-flex p-0 text-body-quaternary fs-9 border-0" for="supportChatAttachment"> <span class="fa-solid fa-paperclip"></span></label>
<input class="d-none" type="file" id="supportChatAttachment" />
</div>
<button class="btn p-0 border-0 send-btn"><span class="fa-solid fa-paper-plane fs-9"></span></button>
</div>
</div>
</div>
<button class="btn btn-support-chat p-0 border border-translucent"><span class="fs-8 btn-text text-primary text-nowrap">Chat demo</span><span class="ping-icon-wrapper mt-n4 ms-n6 mt-sm-0 ms-sm-2 position-absolute position-sm-relative"><span class="ping-icon-bg"></span><span class="fa-solid fa-circle ping-icon"></span></span><span class="fa-solid fa-headset text-primary fs-8 d-sm-none"></span><span class="fa-solid fa-chevron-down text-primary fs-7"></span></button>
</div>
</div>
<div class="card-footer d-flex align-items-center gap-2 border-top border-translucent ps-3 pe-4 py-3">
<div class="d-flex align-items-center flex-1 gap-3 border border-translucent rounded-pill px-4">
<input class="form-control outline-none border-0 flex-1 fs-9 px-0"
type="text"
placeholder="Write message" />
<label class="btn btn-link d-flex p-0 text-body-quaternary fs-9 border-0"
for="supportChatPhotos">
<span class="fa-solid fa-image"></span>
</label>
<input class="d-none" type="file" accept="image/*" id="supportChatPhotos" />
<label class="btn btn-link d-flex p-0 text-body-quaternary fs-9 border-0"
for="supportChatAttachment">
<span class="fa-solid fa-paperclip"></span>
</label>
<input class="d-none" type="file" id="supportChatAttachment" />
</div>
<button class="btn p-0 border-0 send-btn">
<span class="fa-solid fa-paper-plane fs-9"></span>
</button>
</div>
</div>
</div>
<button class="btn btn-support-chat p-0 border border-translucent">
<span class="fs-8 btn-text text-primary text-nowrap">Chat demo</span><span class="ping-icon-wrapper mt-n4 ms-n6 mt-sm-0 ms-sm-2 position-absolute position-sm-relative"><span class="ping-icon-bg"></span><span class="fa-solid fa-circle ping-icon"></span></span><span class="fa-solid fa-headset text-primary fs-8 d-sm-none"></span><span class="fa-solid fa-chevron-down text-primary fs-7"></span>
</button>
</div>

View File

@ -1,30 +1,38 @@
{% load static i18n crispy_forms_tags %}
<!-- activity Modal -->
<div class="modal fade" id="activityModal" tabindex="-1" aria-labelledby="activityModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
<h4 class="modal-title" id="noteModalLabel">{% trans 'Activity' %}</h4>
<button class="btn p-0 text-body-quaternary fs-6" data-bs-dismiss="modal" aria-label="Close">
<span class="fas fa-times"></span>
</button>
</div>
<div class="modal-body">
<form action="{% url 'add_activity' dealer_slug=request.dealer.slug content_type=content_type slug=slug %}" method="post" class="add_activity_form">
{% csrf_token %}
<div class="mb-2 form-group">
<select class="form-select" name="activity_type" id="activity_type">
<option value="call">{% trans 'Call' %}</option>
<option value="email">{% trans 'Email' %}</option>
<option value="meeting">{% trans 'Meeting' %}</option>
</select>
</div>
<div class="mb-3 form-group">
<textarea class="form-control" name="notes" id="notes" rows="6"></textarea>
</div>
<button type="submit" class="btn btn-phoenix-success w-100">{% trans 'Save' %}</button>
</form>
</div>
<div class="modal fade"
id="activityModal"
tabindex="-1"
aria-labelledby="activityModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
<h4 class="modal-title" id="noteModalLabel">{% trans 'Activity' %}</h4>
<button class="btn p-0 text-body-quaternary fs-6"
data-bs-dismiss="modal"
aria-label="Close">
<span class="fas fa-times"></span>
</button>
</div>
<div class="modal-body">
<form action="{% url 'add_activity' dealer_slug=request.dealer.slug content_type=content_type slug=slug %}"
method="post"
class="add_activity_form">
{% csrf_token %}
<div class="mb-2 form-group">
<select class="form-select" name="activity_type" id="activity_type">
<option value="call">{% trans 'Call' %}</option>
<option value="email">{% trans 'Email' %}</option>
<option value="meeting">{% trans 'Meeting' %}</option>
</select>
</div>
<div class="mb-3 form-group">
<textarea class="form-control" name="notes" id="notes" rows="6"></textarea>
</div>
<button type="submit" class="btn btn-phoenix-success w-100">{% trans 'Save' %}</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,7 +1,6 @@
{% load i18n %}
{% if date_navigation_url %}
<button id="{{ date_picker_id }}" data-baseurl="{{ date_navigation_url }}"
<button id="{{ date_picker_id }}"
data-baseurl="{{ date_navigation_url }}"
class="btn btn-sm btn-phoenix-primary">{% trans 'Select Date' %}</button>
{% endif %}

View File

@ -1,30 +1,37 @@
{% load i18n crispy_forms_tags %}
<div class="modal fade" id="noteModal" tabindex="-1" aria-labelledby="noteModalLabel" aria-hidden="true">
<div class="modal fade"
id="noteModal"
tabindex="-1"
aria-labelledby="noteModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
<h4 class="modal-title" id="noteModalLabel">{% trans 'Note' %}</h4>
<button class="btn p-0 text-body-quaternary fs-6" data-bs-dismiss="modal" aria-label="Close">
<span class="fas fa-times"></span>
</button>
<div class="modal-content">
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
<h4 class="modal-title" id="noteModalLabel">{% trans 'Note' %}</h4>
<button class="btn p-0 text-body-quaternary fs-6"
data-bs-dismiss="modal"
aria-label="Close">
<span class="fas fa-times"></span>
</button>
</div>
<div class="modal-body">
<form action="{% url 'add_note' request.dealer.slug content_type slug %}"
method="post"
class="add_note_form">
{% csrf_token %}
{{ note_form|crispy }}
<button type="submit" class="btn btn-phoenix-success w-100">{% trans 'Save' %}</button>
</form>
</div>
</div>
<div class="modal-body">
<form action="{% url 'add_note' request.dealer.slug content_type slug %}" method="post" class="add_note_form">
{% csrf_token %}
{{ note_form|crispy }}
<button type="submit" class="btn btn-phoenix-success w-100">{% trans 'Save' %}</button>
</form>
</div>
</div>
</div>
</div>
<script>
function updateNote(e) {
let url = e.getAttribute('data-url')
let note = e.getAttribute('data-note')
document.querySelector('#id_note').value = note
let form = document.querySelector('.add_note_form')
form.action = url
let url = e.getAttribute('data-url')
let note = e.getAttribute('data-note')
document.querySelector('#id_note').value = note
let form = document.querySelector('.add_note_form')
form.action = url
}
</script>
</script>

View File

@ -1,20 +1,28 @@
{% load i18n crispy_forms_filters %}
<div class="modal fade" id="scheduleModal" tabindex="-1" aria-labelledby="taskModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
<h4 class="modal-title" id="taskModalLabel">{% trans 'Schedule' %}</h4>
<button class="btn p-0 text-body-quaternary fs-6" data-bs-dismiss="modal" aria-label="Close">
<span class="fas fa-times"></span>
</button>
</div>
<div class="modal-body">
<form action="{% url 'schedule_event' request.dealer.slug content_type slug %}" method="post" class="add_schedule_form">
{% csrf_token %}
{{ schedule_form|crispy }}
<button type="submit" class="btn btn-phoenix-success w-100">{% trans 'Save' %}</button>
</form>
</div>
<div class="modal fade"
id="scheduleModal"
tabindex="-1"
aria-labelledby="taskModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
<h4 class="modal-title" id="taskModalLabel">{% trans 'Schedule' %}</h4>
<button class="btn p-0 text-body-quaternary fs-6"
data-bs-dismiss="modal"
aria-label="Close">
<span class="fas fa-times"></span>
</button>
</div>
<div class="modal-body">
<form action="{% url 'schedule_event' request.dealer.slug content_type slug %}"
method="post"
class="add_schedule_form">
{% csrf_token %}
{{ schedule_form|crispy }}
<button type="submit" class="btn btn-phoenix-success w-100">{% trans 'Save' %}</button>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,27 +1,35 @@
{% load static i18n crispy_forms_tags %}
<!-- task Modal -->
<style>
.completed-task {
text-decoration: line-through;
opacity: 0.7;
}
.completed-task {
text-decoration: line-through;
opacity: 0.7;
}
</style>
<div class="modal fade" id="taskModal" tabindex="-1" aria-labelledby="taskModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
<h4 class="modal-title" id="taskModalLabel">{% trans 'Task' %}</h4>
<button class="btn p-0 text-body-quaternary fs-6" data-bs-dismiss="modal" aria-label="Close">
<span class="fas fa-times"></span>
</button>
</div>
<div class="modal-body">
<form action="{% url 'add_task' request.dealer.slug content_type slug %}" method="post" class="add_task_form">
{% csrf_token %}
{{ staff_task_form|crispy }}
<button type="submit" class="btn btn-phoenix-success w-100">{% trans 'Save' %}</button>
</form>
</div>
<div class="modal fade"
id="taskModal"
tabindex="-1"
aria-labelledby="taskModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header justify-content-between align-items-start gap-5 px-4 pt-4 pb-3 border-0">
<h4 class="modal-title" id="taskModalLabel">{% trans 'Task' %}</h4>
<button class="btn p-0 text-body-quaternary fs-6"
data-bs-dismiss="modal"
aria-label="Close">
<span class="fas fa-times"></span>
</button>
</div>
<div class="modal-body">
<form action="{% url 'add_task' request.dealer.slug content_type slug %}"
method="post"
class="add_task_form">
{% csrf_token %}
{{ staff_task_form|crispy }}
<button type="submit" class="btn btn-phoenix-success w-100">{% trans 'Save' %}</button>
</form>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,6 +1,5 @@
{% extends 'base.html' %}
{% load i18n static crispy_forms_filters %}
{% block content %}
<h1>Add Activity to {{ lead.first_name }} {{ lead.last_name }}</h1>
<form method="post">
@ -8,4 +7,4 @@
{{ form|crispy }}
<button class="btn btn-phoenix-primary" type="submit">Add Activity</button>
</form>
{% endblock %}
{% endblock %}

View File

@ -1,38 +1,38 @@
{% extends 'base.html' %}
{% load static %}
{% block content %}
<div class="row">
<div class="table-responsive border-translucent">
<table class="table table-sm fs-9">
<thead>
<tr>
<th>Customer</th>
<th>Service</th>
<th>Date</th>
<th>Start Time</th>
<th>End Time</th>
<th>Staff</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
{% for appointment in appointments %}
<tr>
<td>{{ appointment.get_client_name }}</td>
<td>{{ appointment.get_service }}</td>
<td>{{ appointment.appointment_request.date|date:"Y-m-d" }}</td>
<td>{{ appointment.appointment_request.start_time }}</td>
<td>{{ appointment.appointment_request.end_time }}</td>
<td>{{ appointment.get_staff_member_name }}</td>
<td></td>
<td>
<a href="{% url 'appointment:display_appointment' appointment.id %}">view</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="row">
<div class="table-responsive border-translucent">
<table class="table table-sm fs-9">
<thead>
<tr>
<th>Customer</th>
<th>Service</th>
<th>Date</th>
<th>Start Time</th>
<th>End Time</th>
<th>Staff</th>
<th>Status</th>
<th></th>
</tr>
</thead>
<tbody>
{% for appointment in appointments %}
<tr>
<td>{{ appointment.get_client_name }}</td>
<td>{{ appointment.get_service }}</td>
<td>{{ appointment.appointment_request.date|date:"Y-m-d" }}</td>
<td>{{ appointment.appointment_request.start_time }}</td>
<td>{{ appointment.appointment_request.end_time }}</td>
<td>{{ appointment.get_staff_member_name }}</td>
<td></td>
<td>
<a href="{% url 'appointment:display_appointment' appointment.id %}">view</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}

View File

@ -4,7 +4,5 @@
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
<body></body>
</html>

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More