diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc index 7baa1a3..eb6fa69 100644 Binary files a/core/__pycache__/forms.cpython-311.pyc and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index f72d1f9..3c22c03 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 f971caf..556b2da 100644 --- a/core/forms.py +++ b/core/forms.py @@ -3,6 +3,13 @@ from django.contrib.auth.models import User from django.utils.translation import gettext_lazy as _ from django.utils.translation import get_language from .models import Profile, Parcel, Country, Governate, City, DriverRating, DriverReport, ParcelType +from django.contrib.auth.forms import AuthenticationForm + +class LoginForm(AuthenticationForm): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + for field in self.fields.values(): + field.widget.attrs.update({'class': 'form-control'}) class ContactForm(forms.Form): name = forms.CharField(max_length=100, label=_("Name"), widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': _('Your Name')})) @@ -412,4 +419,4 @@ class DriverReportForm(forms.ModelForm): labels = { 'reason': _('Reason for Reporting'), 'description': _('Details'), - } \ No newline at end of file + } diff --git a/core/templates/core/login.html b/core/templates/core/login.html index 03b6c07..24ad5c0 100644 --- a/core/templates/core/login.html +++ b/core/templates/core/login.html @@ -22,17 +22,40 @@
{% trans "Please login with your username and password" %}
+ {% if form.non_field_errors %} +