Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
Fix for issue #320 - Crispy forms removed from templates
Browse files Browse the repository at this point in the history
  • Loading branch information
niklastheman committed Apr 5, 2023
1 parent e27a243 commit 1d35e70
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 29 deletions.
2 changes: 0 additions & 2 deletions templates/registration/password_change_done.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends 'common/common_base.html' %}
{% block title %}Change Password{% endblock %}

{% load crispy_forms_tags %}

{% block content %}
<!-- Begin Page Content -->
<div class="container">
Expand Down
76 changes: 50 additions & 26 deletions templates/registration/password_change_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,59 @@

{% block title %}Change Password - STACKn{% endblock %}

{% load crispy_forms_tags %}

{% block content %}
<!-- Begin Page Content -->
<div class="container">

<!-- Main Content Here -->
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body p-0">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-lg-6">
<div class="p-5">
<div class="text-center">
<h1 class="h4 text-gray-900 mb-4">Change Your Password</h1>
</div>
<form method="POST">
{% csrf_token %}
{{form | crispy}}
<button type="submit" class="btn btn-success btn-block">Change</button>
<button type="submit" class="btn btn-warning btn-block" onclick="window.location='/' ; return false;" value="Cancel">
Cancel
</button>
</form>
<hr>
</div>
<!-- Begin Page Content -->
<div class="container-sm py-5">
<!-- Main Content Here -->
<div class="card border-0 shadow p-4">
<div class="card-body">
<div class="row">

<div class="col">
<h4>
Change Your Password
</h4>

<form method="POST">
{% csrf_token %}

<div class="row pt-3">
<div class="col">
<label class="form-label" for="id_old_password">{{form.old_password.label}}</label>
<input required class="form-control" type="password" name="old_password" id="id_old_password">
</div>
</div>


<div class="row pt-3">
<div class="col-12 col-md-6">
<label class="form-label" for="id_new_password1">{{form.new_password1.label}}</label>
<input required class="form-control" type="password" name="new_password1" id="id_new_password1">
</div>
<div class="col-12 col-md-6">
<label class="form-label" for="id_new_password2">{{form.new_password2.label}}</label>
<input required class="form-control" type="password" name="new_password2" id="id_new_password2">
</div>
</div>
</div>

<div class="row pt-3">
<div class="col">

{{form.new_password1.help_text}}
</div>
</div>
<!-- old_password -->

<button type="submit" class="btn btn-success">Change</button>

<a class="btn btn-warning" href="/">
Cancel
</a>
</form>

</div>
</div>
</div>
</div>
</div>
{% endblock content %}
2 changes: 1 addition & 1 deletion templates/registration/password_reset_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="p-3">
<div class="row">
<div class="col d-flex justify-content-center">
<img src="{% static 'images/scaleout.png' %}" alt="STACKn Logo" width="200">
<img src="{% static 'images/logo.png' %}" alt="STACKn Logo" width="200">
</div>
</div>
<div class="row">
Expand Down

0 comments on commit 1d35e70

Please sign in to comment.