diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 625a9a3..2aa9bed 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/settings.py b/config/settings.py index fbbd525..abd7cb1 100644 --- a/config/settings.py +++ b/config/settings.py @@ -189,3 +189,5 @@ if EMAIL_USE_SSL: # https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +LOGIN_REDIRECT_URL = 'dashboard' +LOGOUT_REDIRECT_URL = 'index' diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc index e8430d1..b5c40e3 100644 Binary files a/core/__pycache__/forms.cpython-311.pyc and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 4e4db3b..0676643 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index eaa4220..d97f88e 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/forms.py b/core/forms.py index 278dc97..a49a99b 100644 --- a/core/forms.py +++ b/core/forms.py @@ -1,7 +1,7 @@ from django import forms from django.contrib.auth.models import User from django.utils.translation import gettext_lazy as _ -from .models import Profile +from .models import Profile, Parcel class UserRegistrationForm(forms.ModelForm): password = forms.CharField(widget=forms.PasswordInput, label=_("Password")) @@ -36,4 +36,25 @@ class UserRegistrationForm(forms.ModelForm): role=self.cleaned_data['role'], phone_number=self.cleaned_data['phone_number'] ) - return user \ No newline at end of file + return user + +class ParcelForm(forms.ModelForm): + class Meta: + model = Parcel + fields = ['description', 'weight', 'pickup_address', 'delivery_address', 'receiver_name', 'receiver_phone'] + widgets = { + 'description': forms.Textarea(attrs={'rows': 3, 'class': 'form-control', 'placeholder': _('What are you sending?')}), + 'weight': forms.NumberInput(attrs={'class': 'form-control', 'step': '0.1'}), + 'pickup_address': forms.TextInput(attrs={'class': 'form-control', 'placeholder': _('123 Street, City')}), + 'delivery_address': forms.TextInput(attrs={'class': 'form-control', 'placeholder': _('456 Avenue, City')}), + 'receiver_name': forms.TextInput(attrs={'class': 'form-control'}), + 'receiver_phone': forms.TextInput(attrs={'class': 'form-control'}), + } + labels = { + 'description': _('Package Description'), + 'weight': _('Weight (kg)'), + 'pickup_address': _('Pickup Address'), + 'delivery_address': _('Delivery Address'), + 'receiver_name': _('Receiver Name'), + 'receiver_phone': _('Receiver Phone'), + } diff --git a/core/templates/base.html b/core/templates/base.html index 6fef6cc..5fc0e5a 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,4 +1,4 @@ -{% load i18n static %} +{% load i18n static i18n_urls %} {% get_current_language as LANGUAGE_CODE %} {% get_language_info for LANGUAGE_CODE as lang %} @@ -39,6 +39,10 @@ margin-left: auto !important; margin-right: 0 !important; } + .dropdown-menu-end { + left: 0 !important; + right: auto !important; + } {% endif %} @@ -58,6 +62,9 @@ {% trans "How it Works" %} {% if user.is_authenticated %} +