diff --git a/assets/pasted-20251217-195346-608f0fd1.png b/assets/pasted-20251217-195346-608f0fd1.png new file mode 100644 index 0000000..3eb6574 Binary files /dev/null and b/assets/pasted-20251217-195346-608f0fd1.png differ diff --git a/assets/pasted-20251217-200213-f5b1aa31.png b/assets/pasted-20251217-200213-f5b1aa31.png new file mode 100644 index 0000000..5817b3d Binary files /dev/null and b/assets/pasted-20251217-200213-f5b1aa31.png differ diff --git a/assets/pasted-20251217-200627-20278c49.png b/assets/pasted-20251217-200627-20278c49.png new file mode 100644 index 0000000..5074729 Binary files /dev/null and b/assets/pasted-20251217-200627-20278c49.png differ diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc index 0864d42..72645ab 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 57df135..f3c53bf 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 cbb0ef3..004f16c 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 f917e0d..41a8881 100644 --- a/core/forms.py +++ b/core/forms.py @@ -1,5 +1,6 @@ from django import forms from .models import Project, Client +from django.contrib.auth.forms import AuthenticationForm class ProjectForm(forms.ModelForm): class Meta: @@ -21,4 +22,8 @@ class ClientForm(forms.ModelForm): 'name': forms.TextInput(attrs={'class': 'form-control'}), 'email': forms.EmailInput(attrs={'class': 'form-control'}), 'phone': forms.TextInput(attrs={'class': 'form-control'}), - } \ No newline at end of file + } + +class LoginForm(AuthenticationForm): + username = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Username'})) + password = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'form-control', 'placeholder': 'Password'})) \ No newline at end of file diff --git a/core/templates/core/add_project.html b/core/templates/core/add_project.html index aae1338..29d628e 100644 --- a/core/templates/core/add_project.html +++ b/core/templates/core/add_project.html @@ -14,38 +14,12 @@
{% csrf_token %} -
-
-
- {{ form.name }} - -
-
-
-
- {{ form.client }} - -
-
-
-
-
-
- {{ form.start_date }} - -
-
-
-
- {{ form.end_date }} - -
-
-
+ {% for field in form %}
- {{ form.status }} - + {{ field }} +
+ {% endfor %}
Cancel diff --git a/core/templates/core/register.html b/core/templates/core/register.html index 9b6df3a..b78591e 100644 --- a/core/templates/core/register.html +++ b/core/templates/core/register.html @@ -18,22 +18,12 @@

Create Account

{% csrf_token %} -
- {{ form.username }} - -
-
- {{ form.email }} - -
-
- {{ form.password }} - -
-
- {{ form.password2 }} - -
+ {% for field in form %} +
+ {{ field }} + +
+ {% endfor %}
diff --git a/core/urls.py b/core/urls.py index 7c3ac0a..7cb3bbb 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,6 +1,6 @@ from django.urls import path -from .views import index, add_project, register, edit_project, delete_project, projects, clients, add_client -from django.contrib.auth.views import LoginView, LogoutView +from .views import index, add_project, register, edit_project, delete_project, projects, clients, add_client, CustomLoginView +from django.contrib.auth.views import LogoutView urlpatterns = [ path('', index, name='index'), @@ -9,7 +9,7 @@ urlpatterns = [ path('clients/add/', add_client, name='add_client'), path('add-project/', add_project, name='add_project'), path('register/', register, name='register'), - path('login/', LoginView.as_view(template_name='core/login.html'), name='login'), + path('login/', CustomLoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('edit-project//', edit_project, name='edit_project'), path('delete-project//', delete_project, name='delete_project'), diff --git a/core/views.py b/core/views.py index aa2a090..3232d65 100644 --- a/core/views.py +++ b/core/views.py @@ -4,7 +4,11 @@ from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.views import LoginView, LogoutView from .models import Project, Client -from .forms import ProjectForm, ClientForm +from .forms import ProjectForm, ClientForm, LoginForm + +class CustomLoginView(LoginView): + form_class = LoginForm + template_name = 'core/login.html' def index(request): if request.user.is_authenticated: