Skip to content

Commit

Permalink
feat: addresses #2, somestyling of login and account creation forms
Browse files Browse the repository at this point in the history
  • Loading branch information
erictheise committed Mar 6, 2020
1 parent b684563 commit 622c4ef
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 14 deletions.
3 changes: 3 additions & 0 deletions cmdi/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@
'lockdown.middleware.LockdownMiddleware',
]

# django-lockdown is being used to deter the curious during development.
# Keep it after launch should site access ever need to be disabled due to some emergency.
LOCKDOWN_PASSWORDS = ('six', '6',)
LOCKDOWN_ENABLED = True # Default is True. A quick way to make the site inaccessible.
LOCKDOWN_URL_EXCEPTIONS = (
r'^/organizations/$',
r'^/sectors/$',
Expand Down
4 changes: 2 additions & 2 deletions maps/templates/maps/header.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<header role="banner">
<div class="container">
<a class="link link--brand" aria-current="page" href="/maps/">
<a class="link link--brand" aria-current="page" href="{% url 'index' %}">
{% include './svg/pcc.svg' %}
<span class="brand__title screen-reader-text">Platform Cooperatives Worldwide</span></a>
<div class="inner">
Expand Down Expand Up @@ -65,7 +65,7 @@
href="/accounts/login/" class="menu__item">Login</a></li>
{% endif %}
<li class=" menu-item menu-item-type-post_type menu-item-object-page"><a
href="https://stage.commons.platform.coop/en/about/" class="menu__item">About</a></li>
href="#" class="menu__item">About</a></li>
<li class="menu-item menu-item--languages menu__submenu-wrapper">
<button class="menu__item" aria-expanded="false">

Expand Down
13 changes: 10 additions & 3 deletions templates/django_registration/activation_complete.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{# /accounts/activate/failed/ #}
{# /accounts/activate/complete/ #}

{% extends 'maps/base.html' %}

{% block content %}

Your account has been activated.
<div class="page-header">
<p>
<div class="spacer"></div><a class="link--inverse" href="{% url 'index' %}}">Home</a>
</p>
<h1>Success!</h1>
</div>
<p>
Your account has been activated. Please <a href="{% url 'login' %}">login</a>.
</p>

{% endblock %}
13 changes: 9 additions & 4 deletions templates/django_registration/activation_failed.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
{% extends 'maps/base.html' %}

{% block content %}

Your account could not be activated.

@todo: read documentation for activation_error
<div class="page-header">
<p>
<div class="spacer"></div><a class="link--inverse" href="{% url 'index' %}}">Home</a>
</p>
<h1>Creation failure</h1>
</div>
<p>
Your account could not be activated. {{ activation_error.message }}
</p>

{% endblock %}
11 changes: 9 additions & 2 deletions templates/django_registration/registration_closed.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
{% extends 'maps/base.html' %}

{% block content %}

Registration of new user accounts is disabled.
<div class="page-header">
<p>
<div class="spacer"></div><a class="link--inverse" href="{% url 'index' %}}">Home</a>
</p>
<h1>Registation closed</h1>
</div>
<p>
Registration of new user accounts is disabled at this time.
</p>

{% endblock %}
11 changes: 10 additions & 1 deletion templates/django_registration/registration_complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
{% extends 'maps/base.html' %}

{% block content %}
<div class="page-header">
<p>
<div class="spacer"></div><a class="link--inverse" href="{% url 'index' %}}">Home</a>
</p>
<h1>Account activation</h1>
</div>
<p>
Please check your email for a link to activate your account.
</p>

Please check your email for a link to activate your account.
<div class="spacer"></div>

{% endblock %}
18 changes: 17 additions & 1 deletion templates/django_registration/registration_form.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
{# /accounts/register/ #}

{% extends 'maps/base.html' %}

{% block content %}
<div class="page-header">
<p>
<div class="spacer"></div><a class="link--inverse" href="{% url 'index' %}}">Home</a>
</p>
<h1>Account creation</h1>
</div>
<p>
Accounts on the Directory are intended for people working in the Platform Co-operative ecosystem: actively managing
organization profiles, doing academic or grantmaking research, or providing technical services. Accounts are not
necessary to browse the directory.
</p>

<div class="spacer"></div>

<form method="post">
{% csrf_token %}
{{form}}
<input type="submit" value="Submit"/>
<div class="spacer"></div><button id="button" type="submit" class="button">
<span class="button__label">Create account</span></button>
</form>

{% endblock %}
14 changes: 13 additions & 1 deletion templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
{% endif %}
{% endif %}

<div class="page-header">
<p>
<div class="spacer"></div><a class="link--inverse" href="{% url 'index' %}">Home</a>
</p>
<h1>Account login</h1>
</div>

<div class="spacer"></div>

<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<table>
Expand All @@ -28,11 +37,14 @@
</tr>
</table>

<input type="submit" value="login">
<div class="spacer"></div><button id="button" type="submit" class="button">
<span class="button__label">Login</span></button>

<input type="hidden" name="next" value="{{ next }}">
</form>

{# Assumes you setup the password_reset view in your URLconf #}
<p><a href="{% url 'password_reset' %}">Lost password?</a></p>
<p><a href="{% url 'django_registration_register' %}">Create an account</a></p>

{% endblock %}

0 comments on commit 622c4ef

Please sign in to comment.