generated from Code-Institute-Org/ci-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Django's account templates with our own style templates
- Loading branch information
Showing
8 changed files
with
379 additions
and
153 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,103 @@ | ||
{% extends "account/base_entrance.html" %} | ||
{% load i18n %} | ||
{% load allauth account %} | ||
|
||
{% block head_title %} | ||
{% trans "Sign In" %} | ||
{% trans "Sign In" %} | ||
{% endblock head_title %} | ||
|
||
{% block content %} | ||
{% element h1 %} | ||
{% trans "Sign In" %} | ||
{% endelement %} | ||
{% if not SOCIALACCOUNT_ONLY %} | ||
{% setvar link %} | ||
<a href="{{ signup_url }}"> | ||
{% endsetvar %} | ||
{% setvar end_link %} | ||
</a> | ||
{% endsetvar %} | ||
{% element p %} | ||
{% blocktranslate %}If you have not created an account yet, then please {{ link }}sign up{{ end_link }} first.{% endblocktranslate %} | ||
{% endelement %} | ||
{% url 'account_login' as login_url %} | ||
{% element form form=form method="post" action=login_url tags="entrance,login" %} | ||
{% slot body %} | ||
<div class="container d-flex justify-content-center align-items-center min-vh-100 mt-3 mb-3"> | ||
<div class="card p-4 shadow-lg min-vw-20 max-vw-40"> | ||
<div class="card-body"> | ||
<!-- Heading --> | ||
<h2 class="card-title text-center mb-4"> | ||
{% trans "Sign In" %} | ||
</h2> | ||
|
||
<!-- Sign-up prompt --> | ||
{% if not SOCIALACCOUNT_ONLY %} | ||
<p class="text-center"> | ||
{% blocktrans with signup_url=signup_url %} | ||
If you have not created an account yet, please <a href="{{ signup_url }}" | ||
class="text-decoration-underline">sign up</a> first. | ||
{% endblocktrans %} | ||
</p> | ||
{% endif %} | ||
|
||
<!-- Login Form --> | ||
<form method="post" action="{% url 'account_login' %}" class="mt-3"> | ||
{% csrf_token %} | ||
{% element fields form=form unlabeled=True %} | ||
{% endelement %} | ||
{{ redirect_field }} | ||
{% endslot %} | ||
{% slot actions %} | ||
{% element button type="submit" tags="prominent,login" %} | ||
{% trans "Sign In" %} | ||
{% endelement %} | ||
{% endslot %} | ||
{% endelement %} | ||
{% endif %} | ||
{% if LOGIN_BY_CODE_ENABLED or PASSKEY_LOGIN_ENABLED %} | ||
{% element hr %} | ||
{% endelement %} | ||
{% element button_group vertical=True %} | ||
|
||
<!-- Username Field --> | ||
<div class="mb-3"> | ||
<label for="id_login" class="form-label">{% trans "Login:" %}</label> | ||
<input type="text" name="login" id="id_login" class="form-control" | ||
placeholder="{% trans 'Enter your username or login' %}" required> | ||
</div> | ||
|
||
<!-- Password Field --> | ||
<div class="mb-3"> | ||
<label for="id_password" class="form-label">{% trans "Password:" %}</label> | ||
<input type="password" name="password" id="id_password" class="form-control" | ||
placeholder="{% trans 'Enter your password' %}" required> | ||
</div> | ||
|
||
<!-- Forgot Password --> | ||
<div class="text-start mb-1"> | ||
<a href="{% url 'account_reset_password' %}" class="text-decoration-underline text-primary"> | ||
{% trans "Forgot your password?" %} | ||
</a> | ||
</div> | ||
|
||
<!-- Remember Me --> | ||
<div class="form-check mt-4 mb-3"> | ||
<label for="id_remember" class="form-check-label"> | ||
{% trans "Remember Me" %} | ||
</label> | ||
<input type="checkbox" name="remember" id="id_remember" class="form-check-input"> | ||
</div> | ||
|
||
<!-- Submit Button --> | ||
<div class="d-grid gap-2"></div> | ||
<button type="submit" class="btn btn-custom-color w-100"> | ||
{% trans 'Sign In' %} | ||
</button> | ||
</div> | ||
</form> | ||
|
||
<!-- Alternative Sign-in Methods --> | ||
{% if LOGIN_BY_CODE_ENABLED or PASSKEY_LOGIN_ENABLED %} | ||
<hr class="my-4"> | ||
<div class="d-grid gap-2"> | ||
{% if PASSKEY_LOGIN_ENABLED %} | ||
{% element button type="submit" form="mfa_login" id="passkey_login" tags="prominent,login,outline,primary" %} | ||
{% trans "Sign in with a passkey" %} | ||
{% endelement %} | ||
<button type="button" form="mfa_login" id="passkey_login" class="btn btn-outline-primary"> | ||
<i class="fa-solid fa-key me-2"></i>{% trans "Sign in with a passkey" %} | ||
</button> | ||
{% endif %} | ||
{% if LOGIN_BY_CODE_ENABLED %} | ||
{% element button href=request_login_code_url tags="prominent,login,outline,primary" %} | ||
{% trans "Mail me a sign-in code" %} | ||
{% endelement %} | ||
<a href="{{ request_login_code_url }}" class="btn btn-outline-primary"> | ||
<i class="fa-solid fa-envelope me-2"></i>{% trans "Mail me a sign-in code" %} | ||
</a> | ||
{% endif %} | ||
{% endelement %} | ||
{% endif %} | ||
{% if SOCIALACCOUNT_ENABLED %} | ||
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %} | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
|
||
<!-- Social Login Section --> | ||
{% if SOCIALACCOUNT_ENABLED %} | ||
<hr class="my-4"> | ||
<div class="d-grid gap-2"> | ||
{% include "socialaccount/snippets/login.html" with page_layout="entrance" %} | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock content %} | ||
|
||
{% block extra_body %} | ||
{{ block.super }} | ||
{% if PASSKEY_LOGIN_ENABLED %} | ||
{% include "mfa/webauthn/snippets/login_script.html" with button_id="passkey_login" %} | ||
{% endif %} | ||
{% endblock %} | ||
{{ block.super }} | ||
{% if PASSKEY_LOGIN_ENABLED %} | ||
{% include "mfa/webauthn/snippets/login_script.html" with button_id="passkey_login" %} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
{% extends "account/base_manage.html" %} | ||
{% extends "account/base_entrance.html" %} | ||
{% load allauth i18n %} | ||
{% block head_title %} | ||
{% trans "Sign Out" %} | ||
{% trans "Sign Out" %} | ||
{% endblock head_title %} | ||
|
||
{% block content %} | ||
{% element h1 %} | ||
{% trans "Sign Out" %} | ||
{% endelement %} | ||
{% element p %} | ||
{% trans 'Are you sure you want to sign out?' %} | ||
{% endelement %} | ||
{% url 'account_logout' as action_url %} | ||
{% element form method="post" action=action_url no_visible_fields=True %} | ||
{% slot body %} | ||
{% csrf_token %} | ||
{{ redirect_field }} | ||
{% endslot %} | ||
{% slot actions %} | ||
{% element button type="submit" %} | ||
{% trans 'Sign Out' %} | ||
{% endelement %} | ||
{% endslot %} | ||
{% endelement %} | ||
{% endblock content %} | ||
<div class="container d-flex justify-content-center align-items-center min-vh-100 mt-3 mb-3"> | ||
<div class="card p-4 shadow-lg min-vw-20 max-vw-40"> | ||
<div class="card-body"> | ||
<!-- Heading --> | ||
<h2 class="card-title text-center mb-4"> | ||
{% trans "Sign Out" %} | ||
</h2> | ||
|
||
<!-- Confirmation Message --> | ||
<p class="text-center"> | ||
{% trans 'Are you sure you want to sign out?' %} | ||
</p> | ||
|
||
<!-- Logout Form --> | ||
{% url 'account_logout' as action_url %} | ||
<form method="post" action="{{ action_url }}" class="mt-3"> | ||
{% csrf_token %} | ||
{{ redirect_field }} | ||
|
||
<!-- Submit Button --> | ||
<div class="d-grid gap-2"> | ||
<button type="submit" class="btn btn-custom-color w-100"> | ||
{% trans 'Sign Out' %} | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,62 @@ | ||
{% extends "account/base_entrance.html" %} | ||
{% load i18n allauth account %} | ||
|
||
{% block head_title %} | ||
{% trans "Password Reset" %} | ||
{% trans "Password Reset" %} | ||
{% endblock head_title %} | ||
|
||
{% block content %} | ||
{% element h1 %} | ||
{% trans "Password Reset" %} | ||
{% endelement %} | ||
{% if user.is_authenticated %} | ||
{% include "account/snippets/already_logged_in.html" %} | ||
{% endif %} | ||
{% element p %} | ||
{% trans "Forgotten your password? Enter your email address below, and we'll send you an email allowing you to reset it." %} | ||
{% endelement %} | ||
{% url 'account_reset_password' as reset_url %} | ||
{% element form form=form method="post" action=reset_url %} | ||
{% slot body %} | ||
{% csrf_token %} | ||
{% element fields form=form %} | ||
{% endelement %} | ||
{% endslot %} | ||
{% slot actions %} | ||
{% element button type="submit" %} | ||
{% trans 'Reset My Password' %} | ||
{% endelement %} | ||
{% endslot %} | ||
{% endelement %} | ||
{% element p %} | ||
{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %} | ||
{% endelement %} | ||
{% endblock content %} | ||
<div class="container d-flex justify-content-center align-items-center min-vh-100 mt-3 mb-3"> | ||
<div class="card p-4 shadow-lg min-vw-20 max-vw-40"> | ||
<div class="card-body"> | ||
<!-- Heading --> | ||
<h2 class="card-title text-center mb-4"> | ||
{% trans "Password Reset" %} | ||
</h2> | ||
|
||
<!-- If the user is already logged in --> | ||
{% if user.is_authenticated %} | ||
{% include "account/snippets/already_logged_in.html" %} | ||
{% endif %} | ||
|
||
<!-- Information Message --> | ||
<p class="text-center"> | ||
{% trans "Forgotten your password? Enter your email address below, and we'll send you an email allowing you to reset it." %} | ||
</p> | ||
|
||
<!-- Password Reset Form --> | ||
{% url 'account_reset_password' as reset_url %} | ||
<form method="post" action="{{ reset_url }}" class="mt-3"> | ||
{% csrf_token %} | ||
|
||
<!-- Email Field --> | ||
<div class="mb-3"> | ||
<label for="id_email" class="form-label">{% trans "Email Address" %}</label> | ||
<input type="email" name="email" id="id_email" class="form-control" | ||
placeholder="{% trans 'Enter your email address' %}" required> | ||
{% if form.email.errors %} | ||
<div class="text-danger"> | ||
{% for error in form.email.errors %} | ||
<p>{{ error }}</p> | ||
{% endfor %} | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
<!-- Submit Button --> | ||
<div class="d-grid gap-2"> | ||
<button type="submit" class="btn btn-custom-color w-100"> | ||
{% trans 'Reset My Password' %} | ||
</button> | ||
</div> | ||
</form> | ||
|
||
<!-- Additional Information --> | ||
<p class="text-center mt-4"> | ||
{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %} | ||
</p> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.