savannah-cvs
[Top][All Lists]
Advanced

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

[Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. c


From: Sylvain Beucler
Subject: [Savannah-cvs] [SCM] Savane-cleanup framework branch, master, updated. c4ceff7901173a6cffecebade6b626daeeff6609
Date: Sat, 24 Jul 2010 15:04:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Savane-cleanup framework".

The branch, master has been updated
       via  c4ceff7901173a6cffecebade6b626daeeff6609 (commit)
       via  92665fb8993cf2db9dc01e8cb150631e4fa3a881 (commit)
       via  f08061cf057bdeab3f24568e770bb3d9b2a2c642 (commit)
      from  a3cdef07de462e20576a4c64890e3d88329ed665 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=c4ceff7901173a6cffecebade6b626daeeff6609

commit c4ceff7901173a6cffecebade6b626daeeff6609
Author: Sylvain Beucler <address@hidden>
Date:   Sat Jul 24 17:02:12 2010 +0200

    Infrastructure for the top-level menu

diff --git a/savane/svmain/templatetags/__init__.py 
b/savane/svmain/templatetags/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/savane/svmain/templatetags/svpagemenu.py 
b/savane/svmain/templatetags/svpagemenu.py
new file mode 100644
index 0000000..5c8a3bb
--- /dev/null
+++ b/savane/svmain/templatetags/svpagemenu.py
@@ -0,0 +1,54 @@
+# Top-level menu
+# Copyright (C) 2010  Sylvain Beucler
+#
+# This file is part of Savane.
+# 
+# Savane is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+# 
+# Savane is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+from django import template
+from django.core.urlresolvers import reverse
+
+register = template.Library()
+
address@hidden('svmain/svpagemenu.html', takes_context=True)
+def svpagemenu(context):
+    if context['menu_name'] == 'group':
+        entries = []
+        entry_home = { 'text' : 'Home',
+                   'href' : reverse('savane.svmain.group_detail', 
args=[context['group']]),
+                   'title': "Project Main Page at %s" % 'this website'}
+        entry_home['children'] = []
+        entry_home['children'].append({'text' : 1.1, 'href' : 1.1, 'title': 
1.1 })
+        if (context['user'].groups.filter(name=context['group']).count()):
+            entry_home['children'].append({'separator' : True })
+            entry_home['children'].append({'text' : "I'm a member", 'href' : 
1.2, 'title': 1.2 })
+
+        entry_test = {
+                    'text' : 2, 'href' : 2, 'title': 2, 'children':
+                    [
+                        {'text' : 2.1, 'href' : 2.1, 'title': 2.1 },
+                    ]
+                }
+        entries.append(entry_home)
+        entries.append(entry_test)
+        return { 'entries' : entries,
+                 'menu_name': context['menu_name'],
+        }
+    elif context['menu_name'] == 'my':
+        return {
+            'entries':
+            [
+            ],
+            'menu_name': context['menu_name'],
+        }
diff --git a/savane/svmain/urls.py b/savane/svmain/urls.py
index 95638e3..1b7c62c 100644
--- a/savane/svmain/urls.py
+++ b/savane/svmain/urls.py
@@ -81,6 +81,7 @@ urlpatterns += patterns ('',
   url(r'^pr/(?P<slug>[-\w]+)/$', views.group_redir),
   url(r'^projects/(?P<slug>[-\w]+)/$', views.group_redir),
   url(r'^p/(?P<slug>[-\w]+)/join/$', views.group_join),
+  url(r'^p/(?P<slug>[-\w]+)/admin/$', views.group_admin),
 
   url(r'^license/$', 'django.views.generic.list_detail.object_list',
       { 'queryset' : svmain_models.License.objects.all(),
diff --git a/savane/svmain/views.py b/savane/svmain/views.py
index 3b159d5..efa2650 100644
--- a/savane/svmain/views.py
+++ b/savane/svmain/views.py
@@ -22,6 +22,7 @@ from django.core.urlresolvers import reverse
 import django.contrib.auth.models as auth_models
 from django.contrib import messages
 import models as svmain_models
+from annoying.decorators import render_to
 
 def user_redir(request, slug):
     u = get_object_or_404(auth_models.User, username=slug)
@@ -40,3 +41,13 @@ def group_join(request, slug):
         # TODO: send e-mail notification to group admins
         messages.success(request, u"Request for inclusion sent to project 
administrators")
     return HttpResponseRedirect('../')
+
address@hidden('svmain/group_admin.html', mimetype=None)
+def group_admin(request, slug, extra_context={}):
+    group = get_object_or_404(auth_models.Group, name=slug)
+
+    context = {
+        'group' : group,
+        }
+    context.update(extra_context)
+    return context
diff --git a/static_media/savane/css/Savannah.css 
b/static_media/savane/css/Savannah.css
index aa65864..6400580 100644
--- a/static_media/savane/css/Savannah.css
+++ b/static_media/savane/css/Savannah.css
@@ -1040,6 +1040,7 @@ h5 {
        border-bottom: thin solid #000000;
        border-right: none;
        width: auto;
+       padding: 0;
 }
 
 
diff --git a/templates/base.html b/templates/base.html
index fcee0a5..3c886fe 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -25,7 +25,6 @@
           <li class="menuitem"><a href="{% url django.contrib.auth.views.login 
%}">Login</a></li>
           <li class="menuitem"><a href="{% url registration_register %}">New 
user</a></li>
         {% endif %}
-        <!-- /sitemenu -->
 
        <li class="menutitle">Search</li>
         <li class="menuitem"><a href="{% url savane.svmain.user_list 
%}">Users</a></li>
@@ -33,13 +32,14 @@
 
        <li class="menutitle">Site help</li>
         <li class="menuitem"><a href="{% url contact %}">Contact us</a></li>
+        <!-- /sitemenu -->
       </ul>
 
       <div class="main"><a name="top"></a>
        <h1>{% include "title.html" %}</h1>
 
-        <!-- pagemenu -->
-        <!-- /pagemenu -->
+       {% block pagemenu %}{% endblock %}
+
         <div class="content">
         {% if messages %}
         <ul class="messagelist">{% for message in messages %}<li>{{ message 
}}</li>{% endfor %}</ul>
diff --git a/templates/svmain/group_admin.html 
b/templates/svmain/group_admin.html
new file mode 100644
index 0000000..521b226
--- /dev/null
+++ b/templates/svmain/group_admin.html
@@ -0,0 +1,27 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load svpagemenu %}
+
+{% block pagemenu %}
+  {% with "group" as menu_name %}
+  {% svpagemenu %}
+  {% endwith %}
+{% endblock %}
+
+{% block content %}
+
+<p>
+Group: {{group.name}}<br />
+</p>
+
+<p>Manage members</p>
+
+{% endblock %}
+
+{% comment %}
+Local Variables: **
+mode: django-html **
+tab-width: 4 **
+indent-tabs-mode: nil **
+End: **
+{% endcomment %}
diff --git a/templates/svmain/group_list.html b/templates/svmain/group_list.html
index 0a08990..c61391f 100644
--- a/templates/svmain/group_list.html
+++ b/templates/svmain/group_list.html
@@ -5,7 +5,7 @@
 {% include "svmain/pagination.inc.html" %}
 
 <form action="." method="GET">
-  Rechercher: <input type="text" name="q" value="{{q}}" />
+  Search: <input type="text" name="q" value="{{q}}" />
 </form>
 
 {% if object_list %}
diff --git a/templates/svmain/svpagemenu.html b/templates/svmain/svpagemenu.html
new file mode 100644
index 0000000..ab75e21
--- /dev/null
+++ b/templates/svmain/svpagemenu.html
@@ -0,0 +1,17 @@
+<ul class="topmenu" id="topmenu">
+{% for l1 in entries %}
+  <li class="topmenuitemmainitem">
+    <a class="tabs" href="{{l1.href}}" title="{{l1.title}}">{{ l1.text }}</a>
+    <ul id="submenu{{forloop.counter}}" class="topmenuitemsubmenu">
+    {% for l2 in l1.children %}
+      {% if l2.separator %}
+         <li class="topmenuitemsubmenuseparator">&nbsp;</li>
+         {% else %}
+      <li class="topmenuitemsubmenu"><a href="{{l2.href}}" 
title="{{l2.title}}">{{ l2.text }}</a></li>
+         {% endif %}
+    {% endfor %}
+    </ul>
+  </li>
+{% endfor %}
+</ul>
+<div id="topmenunooverlap"></div><div id="topmenunooverlapbis"></div>

http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=92665fb8993cf2db9dc01e8cb150631e4fa3a881

commit 92665fb8993cf2db9dc01e8cb150631e4fa3a881
Author: Sylvain Beucler <address@hidden>
Date:   Sat Jul 24 12:49:40 2010 +0200

    Doc fixes

diff --git a/doc/DJANGO b/doc/DJANGO
index 1b57252..b27be10 100644
--- a/doc/DJANGO
+++ b/doc/DJANGO
@@ -29,3 +29,7 @@ Stuff of interest:
   EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
   This will direct all mails to the console, which means you won't
   risk sending real e-mails to real people by mistake when testing.
+
+- http://code.google.com/p/django-treemenus/ may be nice to implement
+  the left menu, which is mostly static.  The context menu however is
+  dynamic so it's not a good idea to implement it with TreeMenus.
diff --git a/savane/svmain/urls.py b/savane/svmain/urls.py
index 156d554..95638e3 100644
--- a/savane/svmain/urls.py
+++ b/savane/svmain/urls.py
@@ -32,6 +32,7 @@ urlpatterns += patterns ('',
       { 'template' : 'index.html',
         'extra_context' : { 'has_left_menu': False } },
       name='homepage'),
+  # TODO: add a web interface to edit some static content (using Django 
template notation?)
   url(r'^contact/$', 'django.views.generic.simple.direct_to_template',
       { 'template' : 'svmain/text.html',
         'extra_context' : { 'title' : 'Contact', }, },
diff --git a/templates/svmain/pagination.inc.html 
b/templates/svmain/pagination.inc.html
index d795d27..5d79fba 100644
--- a/templates/svmain/pagination.inc.html
+++ b/templates/svmain/pagination.inc.html
@@ -26,7 +26,7 @@
             - Page {{ page_obj.number }} sur {{ paginator.num_pages }} 
({{paginator.count}})
         </span>
       {% else %}
-       ({{paginator.count}} élément(s))
+       ({{paginator.count}} element(s))
       {% endif %}
     </span>
 </div>

http://git.savannah.gnu.org/cgit/savane-cleanup/framework.git/commit/?id=f08061cf057bdeab3f24568e770bb3d9b2a2c642

commit f08061cf057bdeab3f24568e770bb3d9b2a2c642
Author: Sylvain Beucler <address@hidden>
Date:   Sat Jul 24 11:34:54 2010 +0200

    Use Django's password change and reset views; drop ours; fix page titles; 
pre-fill contact info forms

diff --git a/TODO b/TODO
index bf959e9..c02e094 100644
--- a/TODO
+++ b/TODO
@@ -13,11 +13,11 @@ improve it.
 
 [/] Implement high priority web screens
 
-    [/] User account registration
+    [X] User account registration
 
         [X] Account creation
 
-        [ ] Password recovery
+        [X] Password recovery
 
     [/] User page
 
@@ -27,8 +27,7 @@ improve it.
 
     [/] Account conf
 
-        [/] e-mail TODO: send mail to verify it, pre-fill the field
-           with the current value
+        [/] e-mail TODO: send mail to verify it
 
         [X] password
 
diff --git a/savane/my/urls.py b/savane/my/urls.py
index 1d9c226..d078972 100644
--- a/savane/my/urls.py
+++ b/savane/my/urls.py
@@ -50,9 +50,12 @@ urlpatterns = decorated_patterns ('', login_required,
       { 'template' : 'my/index.html',
         'extra_context' : { 'title' : 'My account', }, },
       name='savane.my.views.index'),
-  url('^conf/$', views.sv_conf),
-  url('^conf/resume_skill/$', views.sv_resume_skill),
-  url('^conf/ssh_gpg/$', views.sv_ssh_gpg),
+  url('^conf/$', views.sv_conf,
+      { 'extra_context' : {'title' : 'Contact info', } }),
+  url('^conf/resume_skill/$', views.sv_resume_skill,
+      { 'extra_context' : {'title' : 'Resume & skills', } }),
+  url('^conf/ssh_gpg/$', views.sv_ssh_gpg,
+      { 'extra_context' : {'title' : 'SSH & GPG', } }),
   url('^conf/ssh_gpg/delete/$', views.sv_ssh_delete),
   url(r'^groups/$', only_mine(object_list),
       { 'queryset' : auth_models.Group.objects.all(),
diff --git a/savane/my/views.py b/savane/my/views.py
index ae06630..6b2e369 100644
--- a/savane/my/views.py
+++ b/savane/my/views.py
@@ -29,18 +29,15 @@ from savane.utils import *
 from annoying.decorators import render_to
 
 @login_required()
-def sv_conf( request ):
-    form_pass = PasswordForm ()
-    form_mail = MailForm ()
-    form_identity = IdentityForm ()
+def sv_conf(request, extra_context={}):
+    form_mail = MailForm(initial={'email' : request.user.email})
+    form_identity = IdentityForm(initial={'name' : request.user.first_name,
+                                          'last_name' : 
request.user.last_name})
     form = None
 
     if request.method == 'POST':
         action = request.POST['action']
-        if action == 'update_password':
-            form_pass = PasswordForm(request.POST)
-            form = form_pass
-        elif action == 'update_mail':
+        if action == 'update_mail':
             form_mail = MailForm(request.POST)
             form = form_mail
         elif action == 'update_identity':
@@ -48,42 +45,34 @@ def sv_conf( request ):
             form = form_identity
 
         if form is not None and form.is_valid():
-            if action == 'update_password':
-                if request.user.check_password(request.POST['old_password']):
-                    request.user.set_password(request.POST['new_password']);
-                    request.user.save()
-                    messages.success(request, u"Password was successfully 
changed.")
-                    form_pass = PasswordForm()
-                else:
-                    messages.error(request, u"Old password didn't match.")
-            elif action == 'update_mail':
+            if action == 'update_mail':
                 new_email = request.POST['email']
                 request.user.email = new_email
                 request.user.save()
-                form_mail = MailForm()
                 messages.success(request, u"The E-Mail address was succesfully 
updated. New E-Mail address is <%s>" % new_email)
             elif action == 'update_identity':
                 request.user.first_name = request.POST['name']
                 request.user.last_name = request.POST['last_name']
                 request.user.save()
                 messages.success(request, u"Personal information changed.")
-                form_identity = IdentityForm()
 
+    context = { 'form_mail' : form_mail,
+                'form_identity' : form_identity,
+                }
+    context.update(extra_context)
     return render_to_response('my/conf.html',
-                              { 'form_pass' : form_pass,
-                                'form_mail' : form_mail,
-                                'form_identity' : form_identity,
-                                },
+                              context,
                               context_instance=RequestContext(request))
 
 @login_required()
-def sv_resume_skill( request ):
+def sv_resume_skill(request, extra_context={}):
     return render_to_response('my/resume_skill.html',
-                               context_instance=RequestContext(request))
+                              extra_context,
+                              context_instance=RequestContext(request))
 
 @login_required()
-def sv_ssh_gpg( request ):
-    info = get_object_or_404(SvUserInfo, user=request.user)
+def sv_ssh_gpg(request, extra_context={}):
+    info = request.user.svuserinfo
 
     error_msg = None
     success_msg = None
@@ -156,19 +145,20 @@ def sv_ssh_gpg( request ):
             ssh_keys[key.pk] =  ssh_key_fingerprint( key.ssh_key )
 
 
+    context = { 'form_gpg' : form_gpg,
+                'form_ssh' : form_ssh,
+                'ssh_keys' : ssh_keys,
+                'error_msg' : error_msg,
+                'success_msg' : success_msg,
+                }
+    context.update(extra_context)
     return render_to_response('my/ssh_gpg.html',
-                              { 'form_gpg' : form_gpg,
-                                'form_ssh' : form_ssh,
-                                'ssh_keys' : ssh_keys,
-                                'error_msg' : error_msg,
-                                'success_msg' : success_msg,
-                                },
+                              context,
                               context_instance=RequestContext(request))
 
 @login_required()
 @render_to('svmain/generic_confirm.html', mimetype=None)
 def sv_ssh_delete(request):
-    eu = get_object_or_404(ExtendedUser, pk=request.user.pk)
     if request.method == 'POST':
         try:
             ssh_key = 
request.user.sshkey_set.get(pk=request.POST.get('key_pk', 0))
@@ -183,17 +173,6 @@ class MailForm( forms.Form ):
     email = forms.EmailField(required=True)
     action = forms.CharField( widget=forms.HiddenInput, required=True, 
initial='update_mail' )
 
-class PasswordForm( forms.Form ):
-    old_password = forms.CharField(widget=forms.PasswordInput,required=True)
-    new_password = forms.CharField(widget=forms.PasswordInput,required=True)
-    repated_password = 
forms.CharField(widget=forms.PasswordInput,required=True)
-    action = forms.CharField( widget=forms.HiddenInput, required=True, 
initial='update_password' )
-
-    def clean( self ):
-        cleaned_data = self.cleaned_data
-        new_password = cleaned_data.get('new_password')
-        old_password = cleaned_data.get('old_password')
-
 class IdentityForm( forms.Form ):
     name = forms.CharField( required = True )
     last_name = forms.CharField( required = False )
diff --git a/templates/base.html b/templates/base.html
index 8823de7..fcee0a5 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -36,6 +36,8 @@
       </ul>
 
       <div class="main"><a name="top"></a>
+       <h1>{% include "title.html" %}</h1>
+
         <!-- pagemenu -->
         <!-- /pagemenu -->
         <div class="content">
@@ -43,8 +45,6 @@
         <ul class="messagelist">{% for message in messages %}<li>{{ message 
}}</li>{% endfor %}</ul>
         {% endif %}
 
-         <h1>{% include "title.html" %}</h1>
-
           {% block content %}
           {% endblock %}
         </div>
diff --git a/templates/my/conf.html b/templates/my/conf.html
index 9ba4f1d..f8363f8 100644
--- a/templates/my/conf.html
+++ b/templates/my/conf.html
@@ -2,22 +2,9 @@
 
 {% block content %}
 <div class="box">
-  <div class="boxtitle">Change Password</div>
-  <div class="boxitem">
-    <form method="post">{% csrf_token %}
-      <table>
-      {{ form_pass.as_table }}
-      </table>
-      <input type="submit" value="Update" />
-    </form>
-  </div>
-</div>
-
-<div class="box">
   <div class="boxtitle">Change E-Mail</div>
   <div class="boxitem">
     <form method="post">{% csrf_token %}
-      <p>Current: {{ user.email }}</p>
       <table>
       {{ form_mail.as_table }}
       </table>
diff --git a/templates/my/index.html b/templates/my/index.html
index f9c27a0..74afc2d 100644
--- a/templates/my/index.html
+++ b/templates/my/index.html
@@ -6,11 +6,12 @@
     <p>Configure</p>
 
     <p>
-      <a href="{% url savane.my.views.sv_conf %}">Authentication &amp; 
contact</a><br />
+      <a href="{% url savane.my.views.sv_conf %}">Contact info</a><br />
       <a href="{% url savane.my.views.sv_ssh_gpg %}">SSH &amp; GPG</a><br />
       <a href="{% url savane.my.views.sv_resume_skill %}">My resume &amp; 
skills</a><br />
       <a href="{% url savane.my.group_list %}">My groups</a><br />
       <a href="{% url savane.my.membership_list %}">My memberships</a><br />
+      <a href="{% url django.contrib.auth.views.password_change %}">Change my 
password</a><br />
     </p>
   </div>
 
diff --git a/templates/registration/login.html 
b/templates/registration/login.html
index a19e992..2bda744 100644
--- a/templates/registration/login.html
+++ b/templates/registration/login.html
@@ -1,4 +1,5 @@
 {% extends "base.html" %}
+{% load i18n %}
 
 {% block title %}Login{% endblock %}
 
@@ -8,4 +9,6 @@
 <input type="submit" name="login" value="Login" />
 </form>
 
+<p>[<a href="{% url django.contrib.auth.views.password_reset %}">{% trans 
"Lost your password?" %}</a>]</p>
+
 {% endblock %}
diff --git a/templates/registration/password_change_done.html 
b/templates/registration/password_change_done.html
new file mode 100644
index 0000000..2785daa
--- /dev/null
+++ b/templates/registration/password_change_done.html
@@ -0,0 +1,10 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password change successful' %}{% endblock %}
+
+{% block content %}
+
+<p>{% trans 'Your password was changed.' %}</p>
+
+{% endblock %}
diff --git a/templates/registration/password_change_form.html 
b/templates/registration/password_change_form.html
new file mode 100644
index 0000000..fbb578f
--- /dev/null
+++ b/templates/registration/password_change_form.html
@@ -0,0 +1,45 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password change' %}{% endblock %}
+
+{% block content %}
+
+<form action="" method="post">{% csrf_token %}
+<div>
+{% if form.errors %}
+    <p class="errornote">
+    {% blocktrans count form.errors.items|length as counter %}Please correct 
the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
+    </p>
+{% endif %}
+
+<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>
+
+<fieldset class="module aligned wide">
+
+<div class="form-row">
+    {{ form.old_password.errors }}
+    <label for="id_old_password" class="required">{% trans 'Old password' 
%}:</label>{{ form.old_password }}
+</div>
+
+<div class="form-row">
+    {{ form.new_password1.errors }}
+    <label for="id_new_password1" class="required">{% trans 'New password' 
%}:</label>{{ form.new_password1 }}
+</div>
+
+<div class="form-row">
+{{ form.new_password2.errors }}
+    <label for="id_new_password2" class="required">{% trans 'Password (again)' 
%}:</label>{{ form.new_password2 }}
+</div>
+
+</fieldset>
+
+<div class="submit-row">
+    <input type="submit" value="{% trans 'Change my password' %}" 
class="default" />
+</div>
+
+<script 
type="text/javascript">document.getElementById("id_old_password").focus();</script>
+</div>
+</form></div>
+
+{% endblock %}
diff --git a/templates/registration/password_reset_complete.html 
b/templates/registration/password_reset_complete.html
new file mode 100644
index 0000000..973c482
--- /dev/null
+++ b/templates/registration/password_reset_complete.html
@@ -0,0 +1,12 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password reset complete' %}{% endblock %}
+
+{% block content %}
+
+<p>{% trans "Your password has been set.  You may go ahead and log in now." 
%}</p>
+
+<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
+
+{% endblock %}
diff --git a/templates/registration/password_reset_confirm.html 
b/templates/registration/password_reset_confirm.html
new file mode 100644
index 0000000..f6788bc
--- /dev/null
+++ b/templates/registration/password_reset_confirm.html
@@ -0,0 +1,30 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password reset' %}{% endblock %}
+
+{% block content %}
+
+{% if validlink %}
+
+<h2>{% trans 'Enter new password' %}</h2>
+
+<p>{% trans "Please enter your new password twice so we can verify you typed 
it in correctly." %}</p>
+
+<form action="" method="post">{% csrf_token %}
+{{ form.new_password1.errors }}
+<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' 
%}</label>{{ form.new_password1 }}</p>
+{{ form.new_password2.errors }}
+<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm 
password:' %}</label>{{ form.new_password2 }}</p>
+<p><input type="submit" value="{% trans 'Change my password' %}" /></p>
+</form>
+
+{% else %}
+
+<h2>{% trans 'Password reset unsuccessful' %}</h2>
+
+<p>{% trans "The password reset link was invalid, possibly because it has 
already been used.  Please request a new password reset." %}</p>
+
+{% endif %}
+
+{% endblock %}
diff --git a/templates/registration/password_reset_done.html 
b/templates/registration/password_reset_done.html
new file mode 100644
index 0000000..89fb562
--- /dev/null
+++ b/templates/registration/password_reset_done.html
@@ -0,0 +1,10 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password reset successful' %}{% endblock %}
+
+{% block content %}
+
+<p>{% trans "We've e-mailed you instructions for setting your password to the 
e-mail address you submitted. You should be receiving it shortly." %}</p>
+
+{% endblock %}
diff --git a/templates/registration/password_reset_email.html 
b/templates/registration/password_reset_email.html
new file mode 100644
index 0000000..77fe4c2
--- /dev/null
+++ b/templates/registration/password_reset_email.html
@@ -0,0 +1,15 @@
+{% load i18n %}{% autoescape off %}
+{% trans "You're receiving this e-mail because you requested a password reset" 
%}
+{% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}.
+
+{% trans "Please go to the following page and choose a new password:" %}
+{% block reset_link %}
+{{ protocol }}://{{ domain }}{% url 
django.contrib.auth.views.password_reset_confirm uidb36=uid token=token %}
+{% endblock %}
+{% trans "Your username, in case you've forgotten:" %} {{ user.username }}
+
+{% trans "Thanks for using our site!" %}
+
+{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
+
+{% endautoescape %}
diff --git a/templates/registration/password_reset_form.html 
b/templates/registration/password_reset_form.html
new file mode 100644
index 0000000..fa6058b
--- /dev/null
+++ b/templates/registration/password_reset_form.html
@@ -0,0 +1,15 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans "Password reset" %}{% endblock %}
+
+{% block content %}
+
+<p>{% trans "Forgotten your password? Enter your e-mail address below, and 
we'll e-mail instructions for setting a new one." %}</p>
+
+<form action="" method="post">{% csrf_token %}
+{{ form.email.errors }}
+<p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email 
}} <input type="submit" value="{% trans 'Reset my password' %}" /></p>
+</form>
+
+{% endblock %}

-----------------------------------------------------------------------

Summary of changes:
 TODO                                               |    7 +-
 doc/DJANGO                                         |    4 +
 savane/my/urls.py                                  |    9 ++-
 savane/my/views.py                                 |   69 +++++++-------------
 .../svmain/templatetags/__init__.py                |    0
 savane/svmain/templatetags/svpagemenu.py           |   54 +++++++++++++++
 savane/svmain/urls.py                              |    2 +
 savane/svmain/views.py                             |   11 +++
 static_media/savane/css/Savannah.css               |    1 +
 templates/base.html                                |   10 ++--
 templates/my/conf.html                             |   13 ----
 templates/my/index.html                            |    3 +-
 templates/registration/login.html                  |    3 +
 templates/registration/password_change_done.html   |   10 +++
 templates/registration/password_change_form.html   |   45 +++++++++++++
 .../registration/password_reset_complete.html      |   12 ++++
 templates/registration/password_reset_confirm.html |   30 +++++++++
 templates/registration/password_reset_done.html    |   10 +++
 templates/registration/password_reset_email.html   |   15 ++++
 templates/registration/password_reset_form.html    |   15 ++++
 templates/svmain/group_admin.html                  |   27 ++++++++
 templates/svmain/group_list.html                   |    2 +-
 templates/svmain/pagination.inc.html               |    2 +-
 templates/svmain/svpagemenu.html                   |   17 +++++
 24 files changed, 298 insertions(+), 73 deletions(-)
 copy __init__.py => savane/svmain/templatetags/__init__.py (100%)
 create mode 100644 savane/svmain/templatetags/svpagemenu.py
 create mode 100644 templates/registration/password_change_done.html
 create mode 100644 templates/registration/password_change_form.html
 create mode 100644 templates/registration/password_reset_complete.html
 create mode 100644 templates/registration/password_reset_confirm.html
 create mode 100644 templates/registration/password_reset_done.html
 create mode 100644 templates/registration/password_reset_email.html
 create mode 100644 templates/registration/password_reset_form.html
 create mode 100644 templates/svmain/group_admin.html
 create mode 100644 templates/svmain/svpagemenu.html


hooks/post-receive
-- 
Savane-cleanup framework



reply via email to

[Prev in Thread] Current Thread [Next in Thread]