damned-lies r1280 - in trunk: . media/css people templates templates/people



Author: stephaner
Date: Tue Dec 30 20:57:14 2008
New Revision: 1280
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1280&view=rev

Log:
2008-12-30  StÃphane Raimbault  <stephane raimbault gmail com>

	Add the password change form.
	
	* media/css/login.css: .submit-row is not used.
	* media/css/main.css: Adjust .right_actions
	* media/css/style.css: Remove input and option CSS attributes.
	* people/models.py: Add __unicode__ method to return the name
	property.
	* people/urls.py: Add URLs to change the password using the
	Django contrib view.	
	* templates/base.html: Nicer user name and 'Log Out' button. 
	* templates/login.html: Removed obsolete logout_form.html.
	* templates/logout_form.html: Deleted.
	* templates/people/password_change_done.html: Added.
	* templates/people/password_change_form.html: Added.
	* templates/people/person_detail.html: New right menu.
	* templates/register.html: Removed obsolete logout_form.html.


Added:
   trunk/templates/people/password_change_done.html
   trunk/templates/people/password_change_form.html
Removed:
   trunk/templates/logout_form.html
Modified:
   trunk/ChangeLog
   trunk/media/css/login.css
   trunk/media/css/main.css
   trunk/media/css/style.css
   trunk/people/models.py
   trunk/people/urls.py
   trunk/templates/base.html
   trunk/templates/login.html
   trunk/templates/people/person_detail.html
   trunk/templates/register.html

Modified: trunk/media/css/login.css
==============================================================================
--- trunk/media/css/login.css	(original)
+++ trunk/media/css/login.css	Tue Dec 30 20:57:14 2008
@@ -6,4 +6,3 @@
 .login .form-row { padding:4px 0; float:left; width:100%; }
 .login .form-row label { float:left; width:11em; padding-right:0.5em; line-height:1.1em; text-align:right; font-size:1em; color:#333; }
 .login .form-row #id_username, .login .form-row #id_password { width:14em; }
-.login .submit-row { clear:both; padding:1em 0 0 11.4em; }

Modified: trunk/media/css/main.css
==============================================================================
--- trunk/media/css/main.css	(original)
+++ trunk/media/css/main.css	Tue Dec 30 20:57:14 2008
@@ -129,11 +129,16 @@
   color: #aaaaaa;
 }
 
-div.right_actions {
- float: right;
- text-align: right;
- padding: 5px;
- background: #DCEAF7;
+.right_actions {
+  float: right;
+  text-align: right;
+  padding: 6px;
+  background: #DCEAF7;
+  font-size: small;
+}
+
+.right_actions ul {
+  list-style: none;
 }
 
 div.col1 { float: left }

Modified: trunk/media/css/style.css
==============================================================================
--- trunk/media/css/style.css	(original)
+++ trunk/media/css/style.css	Tue Dec 30 20:57:14 2008
@@ -91,29 +91,6 @@
   color: #3f3f3f;
 }
 
-/* styling form widgets like bugzilla.gnome.org */
-input,textarea {
-  border: 1px solid #6f6f6f;
-/* background: #dddddd; */
-}
-
-input.login_small {
-  border-style: none;
-}
-
-input:focus,textarea:focus {
-  background-color: #f7f2d0;
-  color: #000000;
-}
-
-option {
-  border: 0px none #ffffff;
-}
-
-input[type=radio] {
-  margin-left: 1em;
-}
-
 /* footer */
 
 #footer {

Modified: trunk/people/models.py
==============================================================================
--- trunk/people/models.py	(original)
+++ trunk/people/models.py	Tue Dec 30 20:57:14 2008
@@ -79,6 +79,9 @@
         else:
             return self.username
 
+    def __unicode__(self):
+        return self.name
+
     @models.permalink
     def get_absolute_url(self):
         return ('person', [self.username])

Modified: trunk/people/urls.py
==============================================================================
--- trunk/people/urls.py	(original)
+++ trunk/people/urls.py	Tue Dec 30 20:57:14 2008
@@ -16,3 +16,9 @@
     url(r'^(?P<slug>[\w \ \-]+)/$', 'people.views.person_detail_from_username', name='person'),
     url(r'^(?P<slug>[\w \ \-]+)/edit/$', 'people.views.person_detail_from_username', {'edit_profile': True}, name='person_edit'),
 )
+
+# FIXME Not possible to give the pageSection
+urlpatterns += patterns('django.contrib.auth.views',
+    url(r'^password_change$', 'password_change', {'template_name': 'people/password_change_form.html'}, name='password-change-view'),
+    (r'^password_change_done$', 'password_change_done', {'template_name': 'people/password_change_done.html'}),
+)

Modified: trunk/templates/base.html
==============================================================================
--- trunk/templates/base.html	(original)
+++ trunk/templates/base.html	Tue Dec 30 20:57:14 2008
@@ -22,27 +22,13 @@
 <body>
   <div id="page">
     <ul id="general">
-      <li id="siteaction-gnome_home" class="home">
-        <a href="http://www.gnome.org/";>{% trans "Home" %}</a>
-      </li>
-      <li id="siteaction-gnome_news">
-        <a href="http://news.gnome.org";>{% trans "News" %}</a>
-      </li>
-      <li id="siteaction-gnome_projects">
-        <a href="http://www.gnome.org/projects/";>{% trans "Projects" %}</a>
-      </li>
-      <li id="siteaction-gnome_art">
-        <a href="http://art.gnome.org";>{% trans "Art" %}</a>
-      </li>
-      <li id="siteaction-gnome_support">
-        <a href="http://www.gnome.org/support/";>{% trans "Support" %}</a>
-      </li>
-      <li id="siteaction-gnome_development">
-        <a href="http://developer.gnome.org";>{% trans "Development" %}</a>
-      </li>
-      <li id="siteaction-gnome_community">
-        <a href="http://www.gnome.org/community/";>{% trans "Community" %}</a>
-      </li>
+      <li id="siteaction-gnome_home" class="home"><a href="http://www.gnome.org/";>{% trans "Home" %}</a></li>
+      <li id="siteaction-gnome_news"><a href="http://news.gnome.org";>{% trans "News" %}</a></li>
+      <li id="siteaction-gnome_projects"><a href="http://www.gnome.org/projects/";>{% trans "Projects" %}</a></li>
+      <li id="siteaction-gnome_art"><a href="http://art.gnome.org";>{% trans "Art" %}</a></li>
+      <li id="siteaction-gnome_support"><a href="http://www.gnome.org/support/";>{% trans "Support" %}</a></li>
+      <li id="siteaction-gnome_development"><a href="http://developer.gnome.org";>{% trans "Development" %}</a></li>
+      <li id="siteaction-gnome_community"><a href="http://www.gnome.org/community/";>{% trans "Community" %}</a></li>
     </ul>
     <div id="header">
       <h1>{% trans "Damned Lies" %}</h1>
@@ -78,13 +64,17 @@
       </div> <!-- end of #tabs -->
     </div> <!-- end of #header -->
   </div>
-<!-- end site header -->
+  <!-- end site header -->
   <div id="authenticated">
-  {% if user.is_authenticated %}
-    {% blocktrans with user|linked_with:user.username|safe as username %}Logged in as: {{ username }}{% endblocktrans %}
-  {% else %}
+    {% if user.is_authenticated %}
+    <form action="{% url login %}" method="post">
+      <a href="{{ user.get_absolute_url }}"><img src="{{ MEDIA_URL }}img/person.png" alt="Person"/>&nbsp;{{ user.person }}</a> &bull;
+      <input type="hidden" name="logout" value="1" />
+      <input type="submit" value="{% trans 'Log Out' %}" />
+    </form>
+    {% else %}
     <a href="{% url login %}">{% trans "Log in" %}</a>
-  {% endif %}
+    {% endif %}
   </div>
 
   <div class="body">

Modified: trunk/templates/login.html
==============================================================================
--- trunk/templates/login.html	(original)
+++ trunk/templates/login.html	Tue Dec 30 20:57:14 2008
@@ -8,7 +8,6 @@
 
 {% if user.is_authenticated %}
   <p>{% blocktrans with user.username as username %}You are already logged in as {{ username }}.{% endblocktrans %}</p>
-  {% include "logout_form.html" %}
 {% else %}
 {% url register as link %}
 <p>{% blocktrans %}If you do not own an account on this site, you can <a href='{{ link }}'>register</a> for a new account.{% endblocktrans %}</p>

Added: trunk/templates/people/password_change_done.html
==============================================================================
--- (empty file)
+++ trunk/templates/people/password_change_done.html	Tue Dec 30 20:57:14 2008
@@ -0,0 +1,11 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password change successful' %}{% endblock %}
+
+{% block content %}
+<div class="mainpage">
+  <h1>{% trans 'Password change successful' %}</h1>
+  <p>{% trans 'Your password was changed.' %}</p>
+<div>
+{% endblock %}

Added: trunk/templates/people/password_change_form.html
==============================================================================
--- (empty file)
+++ trunk/templates/people/password_change_form.html	Tue Dec 30 20:57:14 2008
@@ -0,0 +1,39 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password change' %}{% endblock %}
+
+{% block content %}
+<div class="mainpage">
+
+<h2>{% trans 'Password change' %}</h2>
+
+<p>{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</p>
+
+<form action="" method="post">
+  <table>
+  <tr>
+    <td colspan="2">{{ form.old_password.errors }}</td>
+  <tr>
+    <td><label for="id_old_password">{% trans 'Old password:' %}</label></td><td>{{ form.old_password }}</td>
+  </tr>
+  <tr>
+    <td colspan="2">{{ form.new_password1.errors }}</td>
+  </tr>
+  <tr>
+    <td><label for="id_new_password1">{% trans 'New password:' %}</label></td><td>{{ form.new_password1 }}</td>
+  </tr>
+  <tr>
+    <td colspan="2">{{ form.new_password2.errors }}</td>
+  </tr>
+  <tr>
+    <td><label for="id_new_password2">{% trans 'Confirm password:' %}</label></td><td>{{ form.new_password2 }}</td>
+  </tr>
+  <tr>
+    <td></td><td><input type="submit" value="{% trans 'Change my password' %}" /></td>
+  </tr>
+  </table>
+</form>
+
+<div>
+{% endblock %}

Modified: trunk/templates/people/person_detail.html
==============================================================================
--- trunk/templates/people/person_detail.html	(original)
+++ trunk/templates/people/person_detail.html	Tue Dec 30 20:57:14 2008
@@ -8,24 +8,24 @@
 <div class="mainpage">
   <h2>{{ person.name }}</h2>
   {% if user.is_authenticated %}
-    {% ifequal user.username person.username %}
-      <div class="right_actions">
-        {% include "logout_form.html" %}<br />
-        {% if not profile_form %}
-        <a href="{% url person_edit slug=person.username %}">
-          <img src="/media/img/edit.png" alt="{% trans "Edit" %}" title="{% trans "Edit" %}" /></a>
-        {% endif %}
-      </div>
-    {% endifequal %}
+  {% ifequal user.username person.username %}
+  <div class="right_actions">
+    <ul>
+      <li><a href="{% url person_edit slug=person.username %}">{% trans "Change your details" %}</a></li>
+      <li><a href="{% url password-change-view %}">{% trans "Change your password" %}</a></li>
+    </ul>
+  </div>
+  {% endifequal %}
   {% endif %}
 
   {% if profile_form %}
     <div class="maintainer">
-    <form action="." method="POST" class="djform"><table>
-    {{ profile_form.as_table }}
-    <tr><td colspan="2" align="center"><input type="submit" value="{% trans "Save" %}"></td></tr>
-    <input type="hidden" name="edit_profile_form" value="1" />
-    </form></table>
+    <form action="." method="POST" class="djform">
+      <table>{{ profile_form.as_table }}
+        <tr><td colspan="2" align="center"><input type="submit" value="{% trans "Save" %}"></td></tr>
+      </table>
+        <input type="hidden" name="edit_profile_form" value="1" />
+    </form>
     </div>
   {% else %}
     {% include "person_base.html" %}

Modified: trunk/templates/register.html
==============================================================================
--- trunk/templates/register.html	(original)
+++ trunk/templates/register.html	Tue Dec 30 20:57:14 2008
@@ -9,7 +9,6 @@
 <h2>{% trans "Account Registration" %}</h2>
 {% if user.is_authenticated %}
   <p>{% blocktrans with user.username as username %}You are already logged in as {{ username }}.{% endblocktrans %}</p>
-  {% include "logout_form.html" %}
 {% else %}
 <p>{% trans "You can register here for an account on this site. This is only useful if you plan to contribute to GNOME translations." %}</p>
 <p>{% trans "After registration and connection, you will be able to join an existing team from your profile page." %}</p>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]