← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rvb/maas/maas-login-logout-design into lp:maas

 

Raphaël Badin has proposed merging lp:~rvb/maas/maas-login-logout-design into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~rvb/maas/maas-login-logout-design/+merge/90388

This branch integrate some of Huw's design for the login/logout page (I say "some" because the css itself is not properly finished but I'll leave that to Huw):
- it formats the login form using a <p> instead of a <table>
- it removes the {% load url from future %} that is not done by default (see src/maas/settings.py)
- it uses the message framework to display the "You have been logged out." message on the login page when we're redirected there after being logged out.
-- 
https://code.launchpad.net/~rvb/maas/maas-login-logout-design/+merge/90388
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/maas/maas-login-logout-design into lp:maas.
=== modified file 'src/maasserver/static/css/layout.css'
--- src/maasserver/static/css/layout.css	2012-01-24 08:36:41 +0000
+++ src/maasserver/static/css/layout.css	2012-01-27 09:00:47 +0000
@@ -66,3 +66,7 @@
     padding: 20px;
     background-color: #AEA79F;
     }
+#login-logout {
+    width: 300px;
+    margin:0px auto;
+    }

=== modified file 'src/maasserver/templates/registration/login.html'
--- src/maasserver/templates/registration/login.html	2012-01-23 23:11:50 +0000
+++ src/maasserver/templates/registration/login.html	2012-01-27 09:00:47 +0000
@@ -1,7 +1,20 @@
 {% extends "maasserver/base.html" %}
-{% load url from future %}
+
+{% block header %}
+<ul id="main-nav" class="nav">
+  <h1>MaaS Cluster</h1>
+  <div class="clear"></div>
+ </ul>
+{% endblock %}
 
 {% block content %}
+<div id="login-logout">
+
+{% if messages %}
+  {% for message in messages %}
+    <div>{{ message }}</div>
+  {% endfor %}
+{% endif %}
 
 <h2>Login</h2>
 {% if form.errors %}
@@ -9,21 +22,9 @@
 {% endif %}
 
 <form method="post" action="{% url 'django.contrib.auth.views.login' %}">
-  <table>
-    <tr>
-      <td>{{ form.username.label_tag }}</td>
-      <td>{{ form.username }}</td>
-    </tr>
-    <tr>
-      <td>{{ form.password.label_tag }}</td>
-      <td>{{ form.password }}</td>
-    </tr>
-    <tr>
-      <td></td><td><input type="submit" value="login" /></td>
-    </tr>
-  </table>
-
+  {{ form.as_p }}
+  <input type="submit" value="login" />
   <input type="hidden" name="next" value="{{ next }}" />
 </form>
-
+</div>
 {% endblock %}

=== modified file 'src/maasserver/views.py'
--- src/maasserver/views.py	2012-01-24 22:50:32 +0000
+++ src/maasserver/views.py	2012-01-27 09:00:47 +0000
@@ -15,6 +15,7 @@
     "NodesCreateView",
     ]
 
+from django.contrib import messages
 from django.contrib.auth.views import logout as dj_logout
 from django.core.urlresolvers import reverse
 from django.views.generic import (
@@ -25,7 +26,8 @@
 
 
 def logout(request):
-    return dj_logout(request, next_page='/')
+    messages.info(request, 'You have been logged out.')
+    return dj_logout(request, next_page=reverse('login'))
 
 
 class NodeListView(ListView):


Follow ups