diff --git a/Auth/templates/Auth/base.html b/Auth/templates/Auth/base.html index 0288768..0db35d0 100644 --- a/Auth/templates/Auth/base.html +++ b/Auth/templates/Auth/base.html @@ -1,6 +1,7 @@ {% load static %} + @@ -8,22 +9,24 @@ + -{% include 'alert.html' %} + {% include 'alert.html' %} -
-
- -
- {% block content %} - {% endblock %} +
+
+ +
+ {% block content %} + {% endblock %} +
-
- + - + + \ No newline at end of file diff --git a/Auth/templates/Auth/forgot_password.html b/Auth/templates/Auth/forgot_password.html index 753f99f..cfdb311 100644 --- a/Auth/templates/Auth/forgot_password.html +++ b/Auth/templates/Auth/forgot_password.html @@ -3,17 +3,22 @@ {% block title %}GreenCart | Forgot password?{% endblock %} {% block content %} -

Forgot your password?

-
- {% csrf_token %} -
- {{ form.email.label_tag }} - {{ form.email }} -
-
- -
-
-

Remembered your password? Sign in

+

Forgot your password?

+
+ {% csrf_token %} +
+ + {{ form.email }} +
+
+ +
+
+

Remembered your password? Sign in

{% endblock %} \ No newline at end of file diff --git a/Auth/templates/Auth/login.html b/Auth/templates/Auth/login.html index 0b0a830..a9faf5a 100644 --- a/Auth/templates/Auth/login.html +++ b/Auth/templates/Auth/login.html @@ -1,31 +1,39 @@ -{% extends 'Auth/base.html' %} +{% extends 'Auth/base.html' %} {% block title %}GreenCart | Login{% endblock %} {% block content %} -

Welcome Back

-
- {% csrf_token %} -
- {{ form.email.label_tag }} - {{ form.email }} -
-
- {{ form.password.label_tag }} - {{ form.password }} -
-
-
- {{ form.remember_me }} - {{ form.remember_me.label_tag }} -
- -
-
- -
-
-

Don't have an account? Sign up

+

Welcome Back

+
+ {% csrf_token %} +
+ + {{ form.email }} +
+
+ + {{ form.password }} +
+
+
+ {{ form.remember_me }} + {{ form.remember_me.label_tag }} +
+ +
+
+ +
+
+

Don't have an account? Sign up

{% endblock %} \ No newline at end of file diff --git a/Auth/templates/Auth/reset_password.html b/Auth/templates/Auth/reset_password.html index 9f06b6c..aa75b68 100644 --- a/Auth/templates/Auth/reset_password.html +++ b/Auth/templates/Auth/reset_password.html @@ -3,20 +3,44 @@ {% block title %}GreenCart | Reset Password{% endblock %} {% block content %} -

Reset Password

-
- {% csrf_token %} - {{ form.email }} -
- {{ form.password1.label_tag }} - {{ form.password1 }} +

Reset Password

+ + {% csrf_token %} + {{ form.email }} +
+ + {{ form.password1 }} + {% if form.password1.errors %} +
+
    + {% for error in form.password1.errors %} +
  • {{ error|escape }}
  • + {% endfor %} +
-
- {{ form.password2.label_tag }} - {{ form.password2 }} -
-
- + {% endif %} + +
+
+ + {{ form.password2 }} + {% if form.password2.errors %} +
+
    + {% for error in form.password2.errors %} +
  • {{ error|escape }}
  • + {% endfor %} +
- + {% endif %} +
+
+ +
+ {% endblock %} \ No newline at end of file diff --git a/Auth/templates/Auth/signup.html b/Auth/templates/Auth/signup.html index 3390513..6be67c9 100644 --- a/Auth/templates/Auth/signup.html +++ b/Auth/templates/Auth/signup.html @@ -2,32 +2,92 @@ {% block title %}GreenCart | Signup{% endblock %} {% block content %} -

Create Your Account

-
- {% csrf_token %} -
- {{ form.first_name.label_tag }} - {{ form.first_name }} +

Create Your Account

+ + {% csrf_token %} +
+ + {{ form.first_name }} + {% if form.first_name.errors %} +
+
    + {% for error in form.first_name.errors %} +
  • {{ error|escape }}
  • + {% endfor %} +
-
- {{ form.last_name.label_tag }} - {{ form.last_name }} + {% endif %} +
+
+ + {{ form.last_name }} + {% if form.last_name.errors %} +
+
    + {% for error in form.last_name.errors %} +
  • {{ error|escape }}
  • + {% endfor %} +
-
- {{ form.email.label_tag }} - {{ form.email }} + {% endif %} +
+
+ + {{ form.email }} + {% if form.email.errors %} +
+
    + {% for error in form.email.errors %} +
  • {{ error|escape }}
  • + {% endfor %} +
-
- {{ form.password1.label_tag }} - {{ form.password1 }} -
-
- {{ form.password2.label_tag }} - {{ form.password2 }} + {% endif %} +
+
+ + + {{ form.password1 }} + {% if form.password1.errors %} +
+
    + {% for error in form.password1.errors %} +
  • {{ error|escape }}
  • + {% endfor %} +
-
- + {% endif %} +
+
+ + {{ form.password2 }} + {% if form.password2.errors %} +
+
    + {% for error in form.password2.errors %} +
  • {{ error|escape }}
  • + {% endfor %} +
- -

Already have an account? Sign in

-{% endblock %} + {% endif %} +
+ +
+ +
+ +

Already have an account? Sign in

+{% endblock %} \ No newline at end of file diff --git a/Auth/views.py b/Auth/views.py index e8f9e93..69c442d 100644 --- a/Auth/views.py +++ b/Auth/views.py @@ -7,6 +7,8 @@ from .backend import getSecondsOfOneYear from .models import User from django.urls import reverse +from django.http import HttpResponse + @@ -48,9 +50,10 @@ def post(self, request): messages.success(request, str(form.cleaned_data.get('first_name'))+' account has been created successfully. Please login to continue.') return redirect('Auth:login') else: - messages.error(request, 'Please check your inputs') - return redirect('Auth:signup') - + response = HttpResponse() + response['Location'] = '/auth/signup/' + response = render(request, 'Auth/signup.html', {'form': form},status=400) + return response def forgot_password(request): form = ForgotPasswordForm() @@ -66,6 +69,7 @@ def forgot_password(request): def reset_password(request): email = request.GET.get('email') + form = ResetPasswordForm(email=email) if not email: messages.error(request, 'Invalid password reset link.') return redirect('forgot_password') @@ -78,9 +82,6 @@ def reset_password(request): user.save() messages.success(request, 'Your password has been successfully reset.') return redirect(reverse('Auth:login')) - else: - form = ResetPasswordForm(email=email) - return render(request, 'Auth/reset_password.html', {'form': form}) diff --git a/GreenCartEcom/templates/Dashboard/index.html b/GreenCartEcom/templates/Dashboard/index.html index 2e7cd2e..5518210 100644 --- a/GreenCartEcom/templates/Dashboard/index.html +++ b/GreenCartEcom/templates/Dashboard/index.html @@ -1,15 +1,84 @@ {% extends 'Dashboard/navbar.html' %} {% block title %}GreenCart | Dashboard{% endblock %} {% block content %} - + + + +
+
+ 1st image + 1st image + 1st image + 1st image + 1st image + 1st image +
+ + + {% endblock %} \ No newline at end of file diff --git a/GreenCartEcom/templates/Dashboard/navbar.html b/GreenCartEcom/templates/Dashboard/navbar.html index bee25af..de93310 100644 --- a/GreenCartEcom/templates/Dashboard/navbar.html +++ b/GreenCartEcom/templates/Dashboard/navbar.html @@ -8,8 +8,18 @@ {% block title %}{% endblock %} + - + +
{% include 'alert.html' %}
+ + -
+ +
{% block content %} {% endblock %} + + + {% include 'footer.html' %}
- {% include 'footer.html' %} + diff --git a/requirements.txt b/requirements.txt index 47adba6..7d99c10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,16 @@ asgiref==3.8.1 +astroid==3.2.2 +dill==0.3.8 Django==4.2.13 +gunicorn==22.0.0 +isort==5.13.2 +mccabe==0.7.0 +packaging==24.1 +platformdirs==4.2.2 +pylint==3.2.3 +pylint-django==2.5.5 +pylint-plugin-utils==0.8.2 sqlparse==0.5.0 +tomli==2.0.1 +tomlkit==0.12.5 typing_extensions==4.12.2 diff --git a/templates/footer.html b/templates/footer.html index a8359e7..169c721 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,24 +1,24 @@ -