Refactoring things and doing stuff in a MVP way. #15

Merged
valberg merged 23 commits from vidir_refactor into master 2021-03-12 16:20:53 +00:00
4 changed files with 45 additions and 26 deletions
Showing only changes of commit 5b7b95d426 - Show all commits

View file

@ -3,8 +3,6 @@
{% load static %} {% load static %}
{% block non_login_content %} {% block non_login_content %}
<img class="mb-4" src="https://new.data.coop/static/img/logo_da.svg" alt=""
width="260" height="160">
{% if form.non_field_errors %} {% if form.non_field_errors %}
{% for error in form.non_field_errors %} {% for error in form.non_field_errors %}
@ -24,7 +22,7 @@
<input type="text" <input type="text"
id="id_username" id="id_username"
name="login" name="login"
class="form-control" class="form-control mb-lg-2"
placeholder="{% trans "Username/e-mail" %}" placeholder="{% trans "Username/e-mail" %}"
required required
autofocus> autofocus>
@ -35,13 +33,17 @@
<input type="password" <input type="password"
id="id_password" id="id_password"
name="password" name="password"
class="form-control" class="form-control mb-lg-2"
placeholder="{% trans "Password" %}" placeholder="{% trans "Password" %}"
required> required>
<button class="w-100 btn btn-lg btn-primary" <button class="w-100 mb-lg-2 btn btn-lg btn-primary"
type="submit">{% trans "Sign in" %}</button> type="submit">{% trans "Sign in" %}</button>
</form> </form>
<a href="{% url "account_reset_password" %}"
class="w-100 btn btn-lg btn-outline-info">
{% trans "Forgot password?" %}
</a>
<hr class="hr-text" data-content="{% trans "Or"|upper %}"> <hr class="hr-text" data-content="{% trans "Or"|upper %}">
@ -50,4 +52,5 @@
href="{% url "account_signup" %}"> href="{% url "account_signup" %}">
{% trans "Become a member" %} {% trans "Become a member" %}
</a> </a>
{% endblock %} {% endblock %}

View file

@ -1,13 +1,14 @@
{% extends "account/base.html" %} {% extends "account/pre_login_base.html" %}
{% load i18n %} {% load i18n %}
{% load account %} {% load account %}
{% block head_title %}{% trans "Password Reset" %}{% endblock %} {% block head_title %}{% trans "Password Reset" %}{% endblock %}
{% block content %} {% block non_login_content %}
<h1 class="h3 mb-3 fw-normal">{% trans "Password Reset" %}</h1>
<h1>{% trans "Password Reset" %}</h1>
{% if user.is_authenticated %} {% if user.is_authenticated %}
{% include "account/snippets/already_logged_in.html" %} {% include "account/snippets/already_logged_in.html" %}
{% endif %} {% endif %}
@ -16,9 +17,33 @@
<form method="POST" action="{% url 'account_reset_password' %}" class="password_reset"> <form method="POST" action="{% url 'account_reset_password' %}" class="password_reset">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} <label for="id_email" class="visually-hidden">
<input type="submit" value="{% trans 'Reset My Password' %}" /> {% trans "E-mail address" %}
</label>
<input type="email"
id="id_email"
name="email"
class="form-control mb-lg-2 {% if form.email.errors %}is-invalid{% elif form.is_bound %}is-valid{% endif %}"
placeholder="{% trans "E-mail address" %}"
required>
{% if form.email.errors %}
{% for error in form.email.errors %}
<div class="invalid-feedback mb-lg-2">
{{ error }}
</div>
{% endfor %}
{% endif %}
<input class="w-100 btn btn-lg btn-primary"
type="submit" value="{% trans 'Reset My Password' %}" />
</form> </form>
<p>{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}</p> <p>{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}</p>
<hr>
<a class="w-100"
type="submit"
href="{% url "account_login" %}">
{% trans "To login" %}
</a>
{% endblock %} {% endblock %}

View file

@ -49,18 +49,6 @@
z-index: 2; z-index: 2;
} }
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.hr-text:after { .hr-text:after {
content: attr(data-content); content: attr(data-content);
padding: 0 4px; padding: 0 4px;
@ -75,6 +63,9 @@
<body class="text-center"> <body class="text-center">
<main class="form-signin"> <main class="form-signin">
<img class="mb-4" src="https://new.data.coop/static/img/logo_da.svg" alt=""
width="260" height="160">
{% block non_login_content %} {% block non_login_content %}
{% endblock %} {% endblock %}
</main> </main>

View file

@ -3,8 +3,6 @@
{% load static %} {% load static %}
{% block non_login_content %} {% block non_login_content %}
<img class="mb-4" src="https://new.data.coop/static/img/logo_da.svg" alt=""
width="260" height="160">
<h1 class="h3 mb-3 fw-normal">{% trans "Become a member" %}</h1> <h1 class="h3 mb-3 fw-normal">{% trans "Become a member" %}</h1>
{% if form.non_field_errors %} {% if form.non_field_errors %}
@ -18,6 +16,8 @@
{{ form.email.errors }} {{ form.email.errors }}
{{ form.password1.errors }} {{ form.password1.errors }}
<p>{% trans "To become a member, you need to have an account. Create one here." %}</p>
<form method="post" action=""> <form method="post" action="">
{% csrf_token %} {% csrf_token %}
@ -28,7 +28,7 @@
<input type="email" <input type="email"
id="id_email" id="id_email"
name="email" name="email"
class="form-control {% if form.password1.errors %}is-invalid{% elif form.is_bound %}is-valid{% endif %}" class="form-control mb-lg-2 {% if form.email.errors %}is-invalid{% elif form.is_bound %}is-valid{% endif %}"
placeholder="{% trans "E-mail" %}" placeholder="{% trans "E-mail" %}"
required required
autofocus> autofocus>
@ -46,7 +46,7 @@
<input type="password" <input type="password"
id="id_password" id="id_password"
name="password1" name="password1"
class="form-control {% if form.password1.errors %}is-invalid{% elif form.is_bound %}is-valid{% endif %}" class="form-control mb-lg-2 {% if form.password1.errors %}is-invalid{% elif form.is_bound %}is-valid{% endif %}"
placeholder="{% trans "Password" %}" placeholder="{% trans "Password" %}"
required> required>
{% if form.password1.errors %} {% if form.password1.errors %}