make registration views prettier (fix missing trans, layout improvments and code cleanup) #119

This commit is contained in:
elnappo 2014-10-28 17:10:53 +01:00
parent 886919ac83
commit b617396f2a
4 changed files with 24 additions and 21 deletions

View File

@ -2,13 +2,14 @@
{% load i18n %}{% load bootstrap %}
{% url 'auth_login' as auth_login_url %}
{% block title %}{% if account %}{% trans "Activation complete" %}{% else %}{% trans "Activation problem" %}{% endif %}{% endblock %}
{% block content %}
{% if account %}
{% blocktrans %}
Thanks {{ account }}, activation complete!
You may now <a href='{{ auth_login_url }}'>login</a> using the username and password you set at registration.
{% endblocktrans %}
<h2>{% trans 'Thanks, activation complete!' %}</h2>
<p>{% trans 'You may now login using the username and password you set at registration.' %}</p>
<p><a href="{{ login_url }}"><button class="btn btn-primary" type="button">{% trans "Log in" %}</button></a></p>
{% else %}
{% blocktrans %}Oops -- it seems that your activation key is invalid. Please check the url again.{% endblocktrans %}
<h2>{% trans 'Oops' %}</h2>
<p>{% trans 'it seems that your activation key is invalid. Please check the url again.' %}</p>
{% endif %}
{% endblock %}

View File

@ -1,9 +1,9 @@
{% extends "registration/registration_base.html" %}
{% load i18n %}{% load bootstrap %}
{% block title %}Activation complete{% endblock %}
{% block title %}{% trans 'Activation complete' %}{% endblock %}
{% block content %}
<h1>Thanks, activation complete!</h1>
<p>You may now <a href="{% url 'django.contrib.auth.views.login' %}">login</a> using the username and password you set at registration.</p>
<h2>{% trans 'Thanks, activation complete!' %}</h2>
<p>{% trans 'You may now login using the username and password you set at registration.' %}</p>
<p><a href="{{ login_url }}"><button class="btn btn-primary" type="button">{% trans "Log in" %}</button></a></p>
{% endblock %}

View File

@ -1,8 +1,8 @@
{% extends "registration/registration_base.html" %}
{% load i18n %}{% load bootstrap %}
{% block title %}{% trans "Activation email sent" %}{% endblock %}
{% block content %}
{% blocktrans %}An activation email has been sent.
Please check your email and click on the link to activate your account.{% endblocktrans %}
{% endblock %}
{% block title %}{% trans 'Activation email sent' %}{% endblock %}
{% block content %}
<h2>{% trans 'An activation email has been sent.' %}</h2>
<p>{% trans 'Please check your email and click on the link to activate your account.' %}</p>
{% endblock %}

View File

@ -1,10 +1,10 @@
{% extends "registration/registration_base.html" %}
{% load i18n %}{% load bootstrap %}
{% load bootstrap %}
{% block title %}{% trans "Register for an account" %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-6">
<div class="col-md-5">
<h2>{% trans "No registration required for testing" %}</h2>
<p>
{% trans "You can easily test the service and see what you get." %}
@ -34,7 +34,7 @@
finishing your initial evaluation.{% endblocktrans %}
</p>
</div>
<div class="col-md-6">
<div class="col-md-7">
<h2>{% trans "Register new account" %}</h2>
<p>
{% blocktrans %}
@ -43,15 +43,17 @@
E-Mail address: must be a <em>working</em> one, we'll send you an activation E-Mail there.<br>
Password: please use a sane one, we trust you.{% endblocktrans %}
</p>
<form class="form-horizontal" role="form" method="post" action="">
<br>
<form class="form-horizontal jumbotron" role="form" method="post" action="">
{% csrf_token %}
{{ form|bootstrap_horizontal }}
{{ form|bootstrap_horizontal:"col-sm-3 col-lg-3" }}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="col-sm-offset-3 col-sm-9">
<input type="submit" class="btn btn-primary" value="{% trans "Send activation email" %}" />
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">document.getElementById("id_username").focus();</script>
{% endblock %}