Skip to content

Commit

Permalink
Merge branch 'master' into feat/add-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hetvi2010 authored Jul 1, 2024
2 parents 21ac671 + be972bb commit 49628b9
Show file tree
Hide file tree
Showing 63 changed files with 1,177 additions and 177 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,6 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/

.DS_Store
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Auth/.DS_Store
Binary file not shown.
22 changes: 11 additions & 11 deletions Auth/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class LoginForm(forms.Form):
email = forms.EmailField(
widget=forms.EmailInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'Email',
'id': 'email',
'required': True
Expand All @@ -14,7 +14,7 @@ class LoginForm(forms.Form):
)
password = forms.CharField(
widget=forms.PasswordInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'Password',
'id': 'password',
'required': True
Expand All @@ -24,7 +24,7 @@ class LoginForm(forms.Form):
remember_me = forms.BooleanField(
required=False,
widget=forms.CheckboxInput(attrs={
'class': 'h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded',
'class': 'h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded',
'id': 'remember_me'
}),
label='Remember me'
Expand All @@ -35,39 +35,39 @@ class SignupForm(UserCreationForm):
max_length=30,
required=True,
widget=forms.TextInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-greem-500 focus:border-green-500 sm:text-sm',
'placeholder': 'First Name'
})
)
last_name = forms.CharField(
max_length=30,
required=True,
widget=forms.TextInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'Last Name'
})
)
email = forms.EmailField(
max_length=254,
required=True,
widget=forms.EmailInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'Email'
})
)
password1 = forms.CharField(
label="Password",
strip=False,
widget=forms.PasswordInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'Password'
})
)
password2 = forms.CharField(
label="Confirm Password",
strip=False,
widget=forms.PasswordInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'Confirm Password'
})
)
Expand All @@ -80,7 +80,7 @@ class Meta:
class ForgotPasswordForm(forms.Form):
email = forms.EmailField(
widget=forms.EmailInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'Email',
'id': 'email',
'required': True
Expand All @@ -106,15 +106,15 @@ def __init__(self, *args, **kwargs):
label="New Password",
strip=False,
widget=forms.PasswordInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'New Password'
})
)
password2 = forms.CharField(
label="Confirm Password",
strip=False,
widget=forms.PasswordInput(attrs={
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',
'class': 'mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-green-500 focus:border-green-500 sm:text-sm',
'placeholder': 'Confirm New Password'
})
)
Expand Down
25 changes: 14 additions & 11 deletions Auth/templates/Auth/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@
<title>{% block title %}{% endblock %}</title>
<script src="https://cdn.tailwindcss.com/"></script>
<link rel="stylesheet" href="{% static 'css/app.css' %}">
<script src="https://unpkg.com/@dotlottie/player-component@latest/dist/dotlottie-player.mjs" type="module"></script>
</head>

<body class="bg-gray-100 flex items-center justify-center h-screen">
<body class="bg-green-900 flex items-center justify-center min-h-screen">

{% include 'alert.html' %}

<div class="bg-white shadow-lg rounded-lg overflow-hidden w-full max-w-4xl">
<div class="md:flex">
<div class="hidden md:block md:w-1/2">
<img class="object-cover h-full w-full" src="{% static 'images/logo.png' %}" alt="Random Image">
</div>
<div class="w-full md:w-1/2 p-8">
{% block content %}
{% endblock %}
</div>
<div class="w-full h-full flex">
<div hidden class="md:flex md:w-1/2 items-center justify-center bg-gray-50 object-fill relative">
<dotlottie-player class="md-w-10 object-fill" src="{% block lottie_src %}{% endblock %}" background="white" speed="1" style="width: 100%; height: 100%;" loop autoplay></dotlottie-player>

</div>
<div class="w-full md:w-1/2 p-8 md:p-12 flex items-center justify-center bg-green-100">
<div class="max-w-md w-full space-y-8">

<img id="logo" src="{% static 'images/logo.png' %}" alt="GreenCart Logo" class="mx-auto h-auto w-auto">
{% block content %}

{% endblock %}
</div>
</div>

Expand Down
14 changes: 9 additions & 5 deletions Auth/templates/Auth/forgot_password.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@

{% block title %}GreenCart | Forgot password?{% endblock %}

{% block lottie_src %}
https://lottie.host/c5befc64-e06d-465d-b724-278ada3d5e2a/oNE6A5dy42.json
{% endblock %}

{% block content %}
<h2 class="text-2xl font-bold text-gray-800 mb-6">Forgot your password?</h2>
<h2 class="text-2xl font-bold text-green-800 mb-6">Forgot your password?</h2>
<form method="post">
{% csrf_token %}
<div class="mb-4">
<label for="{{ form.email.id_for_label }}" class="block text-sm font-medium text-gray-700">
<label for="{{ form.email.id_for_label }}" class="block text-sm font-medium text-green-700">
{{ form.email.label }}{% if form.email.field.required %}<span class="text-red-500">*</span>{% endif %}
</label>
{{ form.email }}
</div>
<div class="mt-6">
<button type="submit"
class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Reset
class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-gray-600 hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">Reset
Password</button>
</div>
</form>
<p class="mt-4 text-sm text-center text-gray-600">Remembered your password? <a href="{% url 'Auth:login' %}"
class="font-medium text-indigo-600 hover:text-indigo-500">Sign in</a></p>
<p class="mt-4 text-sm text-center text-black-600">Remembered your password? <a href="{% url 'Auth:login' %}"
class="font-medium text-green-600 hover:text-green-500">Sign in</a></p>

{% endblock %}
36 changes: 19 additions & 17 deletions Auth/templates/Auth/login.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
{% extends 'Auth/base.html' %}
{% block title %}GreenCart | Login{% endblock %}

{% block content %}
{% block lottie_src %}
https://lottie.host/54dad616-5c33-413f-8af8-e62aa9daf0cd/2RhLNcNx1Q.json
{% endblock %}

<h2 class="text-2xl font-bold text-gray-800 mb-6">Welcome Back</h2>
<form method="post" action="{% url 'Auth:login' %}">
{% block content %}
<h2 class="text-4xl font-bold text-green-800 mb-6 text-center">Welcome back to 💚🛒</h2>
<form method="post" action="{% url 'Auth:login' %}" class="space-y-6">
{% csrf_token %}
<div class="mb-4">
<label for="{{ form.email.id_for_label }}" class="block text-sm font-medium text-gray-700">
<div class="space-y-1">
<label for="{{ form.email.id_for_label }}" class="block text-sm font-medium text-green-700">
{{ form.email.label }}{% if form.email.field.required %}<span class="text-red-500">*</span>{% endif %}
</label>
{{ form.email }}
</div>
<div class="mb-6">
<label for="{{ form.password.id_for_label }}" class="block text-sm font-medium text-gray-700">
<div class="space-y-1">
<label for="{{ form.password.id_for_label }}" class="block text-sm font-medium text-green-700">
{{ form.password.label }}{% if form.password.field.required %}<span class="text-red-500">*</span>{% endif %}
</label>
{{ form.password }}
</div>
<div class="flex items-center justify-between">
<div class="flex items-center gap-1">
{{ form.remember_me }}
{{ form.remember_me.label_tag }}
<label for="remember_me" class="ml-2 block text-sm text-grey-700">{{ form.remember_me.label }}</label>
</div>
<div class="text-sm">
<a href="{% url 'Auth:forgot_password' %}" class="font-medium text-indigo-600 hover:text-indigo-500">Forgot
your password?</a>
<a href="{% url 'Auth:forgot_password' %}" class="font-medium text-green-600 hover:text-green-500">Forgot your password?</a>
</div>
</div>
<div class="mt-6">
<button type="submit"
class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Sign
in</button>
<div>
<button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">Sign in</button>
</div>
</form>
<p class="mt-4 text-sm text-center text-gray-600">Don't have an account? <a href="{% url 'Auth:signup' %}"
class="font-medium text-indigo-600 hover:text-indigo-500">Sign up</a></p>
{% endblock %}
<p class="mt-6 text-center text-sm text-gray-600">
Don't have an account?
<a href="{% url 'Auth:signup' %}" class="font-medium text-green-600 hover:text-green-500">Sign up</a>
</p>
{% endblock %}
13 changes: 9 additions & 4 deletions Auth/templates/Auth/reset_password.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

{% block title %}GreenCart | Reset Password{% endblock %}

{% block lottie_src %}

https://lottie.host/674a955d-bfca-42f5-9a07-333bb84cb6ce/pWe0kPBCRo.json
{% endblock %}

{% block content %}
<h2 class="text-2xl font-bold text-gray-800 mb-6">Reset Password</h2>
<h2 class="text-2xl font-bold text-green-800 mb-6">Reset Password</h2>
<form method="post">
{% csrf_token %}
{{ form.email }}
<div class="mb-4">
<label for="{{ form.password1.id_for_label }}" class="block text-sm font-medium text-gray-700">
<label for="{{ form.password1.id_for_label }}" class="block text-sm font-medium text-green-700">
{{ form.password1.label }}{% if form.password1.field.required %}<span class="text-red-500">*</span>{% endif %}
</label>
{{ form.password1 }}
Expand All @@ -24,7 +29,7 @@ <h2 class="text-2xl font-bold text-gray-800 mb-6">Reset Password</h2>

</div>
<div class="mb-4">
<label for="{{ form.password2.id_for_label }}" class="block text-sm font-medium text-gray-700">
<label for="{{ form.password2.id_for_label }}" class="block text-sm font-medium text-green-700">
{{ form.password2.label }}{% if form.password2.field.required %}<span class="text-red-500">*</span>{% endif %}
</label>
{{ form.password2 }}
Expand All @@ -40,7 +45,7 @@ <h2 class="text-2xl font-bold text-gray-800 mb-6">Reset Password</h2>
</div>
<div class="mt-6">
<button type="submit"
class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Submit</button>
class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-gray-600 hover:bg-black focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500">Submit</button>
</div>
</form>
{% endblock %}
Loading

0 comments on commit 49628b9

Please sign in to comment.