damned-lies r1479 - in trunk: . common media/css people stats templates templates/registration vertimus



Author: claudep
Date: Sat Mar  7 14:07:07 2009
New Revision: 1479
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1479&view=rev

Log:
2009-03-07  Claude Paroz  <claude 2xlibre net>

	* common/views.py:
	* templates/register.html:
	* templates/register_success.html: Moved templates into registration
	folder.
	* templates/registration/password_reset*: Customize 'reset password'
	templates from contrib/admin/templates/registration.
	* media/css/layout.css: Unite link colors.
	* settings_sample.py:
	* stats/utils.py:
	* vertimus/models.py:
	* people/forms.py: Renamed SERVER_EMAIL to Django standard
	DEFAULT_FROM_EMAIL.
	* templates/login.html: Add link to forgotten password page.
	* urls.py: Add new urls for forgotten password functionality.

Added:
   trunk/templates/registration/
   trunk/templates/registration/password_reset_complete.html
   trunk/templates/registration/password_reset_confirm.html
   trunk/templates/registration/password_reset_done.html
   trunk/templates/registration/password_reset_form.html
   trunk/templates/registration/register.html   (props changed)
      - copied unchanged from r1475, /trunk/templates/register.html
   trunk/templates/registration/register_success.html   (props changed)
      - copied unchanged from r1475, /trunk/templates/register_success.html
Removed:
   trunk/templates/register.html
   trunk/templates/register_success.html
Modified:
   trunk/ChangeLog
   trunk/common/views.py
   trunk/media/css/layout.css
   trunk/people/forms.py
   trunk/settings_sample.py
   trunk/stats/utils.py
   trunk/templates/login.html
   trunk/urls.py
   trunk/vertimus/models.py

Modified: trunk/common/views.py
==============================================================================
--- trunk/common/views.py	(original)
+++ trunk/common/views.py	Sat Mar  7 14:07:07 2009
@@ -98,7 +98,7 @@
         'form': form,
         'openid_path': openid_path,
     }
-    return render_to_response('register.html', context, context_instance=RequestContext(request))
+    return render_to_response('registration/register.html', context, context_instance=RequestContext(request))
 
 def activate_account(request, key):
     """ Activate an account through the link a requestor has received by email """

Modified: trunk/media/css/layout.css
==============================================================================
--- trunk/media/css/layout.css	(original)
+++ trunk/media/css/layout.css	Sat Mar  7 14:07:07 2009
@@ -19,11 +19,11 @@
 }
 
 a {
-  color: #0000ff;
+  color: #3465a4;
 }
 
 a:visited {
-  color: #551a8b;
+  color: #3465a4;
 }
 
 a:active {

Modified: trunk/people/forms.py
==============================================================================
--- trunk/people/forms.py	(original)
+++ trunk/people/forms.py	Sat Mar  7 14:07:07 2009
@@ -67,7 +67,7 @@
         message += "\n\nhttp://%s%s\n\n"; % (current_site.domain, str(reverse("register_activation", kwargs={'key': activation_key}))) 
         message += _(u"Administrators of %s" % current_site.name)
 
-        send_mail(subject, message, settings.SERVER_EMAIL,
+        send_mail(subject, message, settings.DEFAULT_FROM_EMAIL,
                   (email,), fail_silently=False)
 
         return new_user

Modified: trunk/settings_sample.py
==============================================================================
--- trunk/settings_sample.py	(original)
+++ trunk/settings_sample.py	Sat Mar  7 14:07:07 2009
@@ -39,7 +39,7 @@
 EMAIL_HOST_USER = ''
 EMAIL_HOST_PASSWORD = ''
 EMAIL_SUBJECT_PREFIX = '[Damned Lies]'
-SERVER_EMAIL = 'gnomeweb gnome org'
+DEFAULT_FROM_EMAIL = 'gnomeweb gnome org'
 # When in STRINGFREEZE, where to send notifications (gnome-i18n gnome org) on any POT changes
 NOTIFICATIONS_TO = ['gnome-i18n gnome org']
 

Modified: trunk/stats/utils.py
==============================================================================
--- trunk/stats/utils.py	(original)
+++ trunk/stats/utils.py	Sat Mar  7 14:07:07 2009
@@ -387,7 +387,7 @@
 
     send_mail(subject="String additions to '%s'" % (out_domain),
               message=text,
-              from_email="GNOME Status Pages <%s>" % (settings.SERVER_EMAIL),
+              from_email="GNOME Status Pages <%s>" % (settings.DEFAULT_FROM_EMAIL),
               recipient_list=settings.NOTIFICATIONS_TO)
 
 def url_join(base, *args):

Modified: trunk/templates/login.html
==============================================================================
--- trunk/templates/login.html	(original)
+++ trunk/templates/login.html	Sat Mar  7 14:07:07 2009
@@ -18,7 +18,9 @@
     <label for="id_username">{% trans 'Username:' %}</label> <input type="text" name="username" id="id_username" />
   </div>
   <div class="form-row">
-    <label for="id_password">{% trans 'Password:' %}</label> <input type="password" name="password" id="id_password" />
+    <label for="id_password">{% trans 'Password:' %}</label> <input type="password" name="password" id="id_password" /> 
+    <span class="help"><a href="/password_reset/">{% trans 'Have you forgotten your password?' %}</a></span>
+
     <input type="hidden" name="this_is_the_login_form" value="1" />
     <input type="hidden" name="post_data" value="{{ post_data }}" />
     <input type="hidden" name="referer" value="{{ referer|default:"" }}" />

Added: trunk/templates/registration/password_reset_complete.html
==============================================================================
--- (empty file)
+++ trunk/templates/registration/password_reset_complete.html	Sat Mar  7 14:07:07 2009
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password reset complete' %}{% endblock %}
+
+{% block content %}
+<div class="mainpage">
+<h1>{% trans 'Password reset complete' %}</h1>
+
+<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>
+</div>
+{% endblock %}

Added: trunk/templates/registration/password_reset_confirm.html
==============================================================================
--- (empty file)
+++ trunk/templates/registration/password_reset_confirm.html	Sat Mar  7 14:07:07 2009
@@ -0,0 +1,30 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password reset' %}{% endblock %}
+
+{% block content %}
+<div class="mainpage">
+
+{% if validlink %}
+<h1>{% trans 'Enter new password' %}</h1>
+
+<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
+
+<form action="" method="post">
+{% if form.new_password1.errors %}{{ form.new_password1.errors }}{% endif %}
+<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
+{% if form.new_password2.errors %}{{ form.new_password2.errors }}{% endif %}
+<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 %}
+
+<h1>{% trans 'Password reset unsuccessful' %}</h1>
+
+<p>{% trans "The password reset link was invalid, possibly because it has already been used.  Please request a new password reset." %}
+
+{% endif %}
+</div>
+{% endblock %}

Added: trunk/templates/registration/password_reset_done.html
==============================================================================
--- (empty file)
+++ trunk/templates/registration/password_reset_done.html	Sat Mar  7 14:07:07 2009
@@ -0,0 +1,13 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans 'Password reset successful' %}{% endblock %}
+
+{% block content %}
+<div class="mainpage">
+
+<h1>{% trans 'Password reset successful' %}</h1>
+
+<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>
+</div>
+{% endblock %}

Added: trunk/templates/registration/password_reset_form.html
==============================================================================
--- (empty file)
+++ trunk/templates/registration/password_reset_form.html	Sat Mar  7 14:07:07 2009
@@ -0,0 +1,18 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %}{% trans "Password reset" %}{% endblock %}
+
+{% block content %}
+<div class="mainpage">
+
+<h1>{% trans "Password reset" %}</h1>
+
+<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">
+{% if form.email.errors %}{{ form.email.errors }}{% endif %}
+<p><label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }} <input type="submit" value="{% trans 'Reset my password' %}" /></p>
+</form>
+</div>
+{% endblock %}

Modified: trunk/urls.py
==============================================================================
--- trunk/urls.py	(original)
+++ trunk/urls.py	Sat Mar  7 14:07:07 2009
@@ -8,8 +8,12 @@
     url(r'^$', 'common.views.index', name='home'),
     url(r'^login/$', 'common.views.site_login', name='login'),
     url(r'^register/$', 'common.views.site_register', name='register'),
-    url(r'^register/success$', 'django.views.generic.simple.direct_to_template', {'template': 'register_success.html'}, name='register_success'),
+    url(r'^register/success$', 'django.views.generic.simple.direct_to_template', {'template': 'registration/register_success.html'}, name='register_success'),
     url(r'^register/activate/(?P<key>\w+)$', 'common.views.activate_account', name='register_activation'),
+    (r'^password_reset/$', 'django.contrib.auth.views.password_reset', {'template_name':'registration/password_reset_form.html'}),
+    (r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done', {'template_name':'registration/password_reset_done.html'}),
+    (r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm'),
+    (r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
     (r'^teams/', include('teams.urls')),
     (r'^people/', include('people.urls')),
     # users is the hardcoded url in the contrib.auth User class, making it identical to /people

Modified: trunk/vertimus/models.py
==============================================================================
--- trunk/vertimus/models.py	(original)
+++ trunk/vertimus/models.py	Sat Mar  7 14:07:07 2009
@@ -471,7 +471,7 @@
             message += self.comment or ugettext("Without comment")
             message += "\n\n" + self.person.name
             message += "\n--\n" + _(u"This is an automated message sent from %s.") % current_site.domain
-            mail.send_mail(subject, message, settings.SERVER_EMAIL, recipient_list)
+            mail.send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list)
             activate(current_lang)
 
 
@@ -521,7 +521,7 @@
             message += comment or ugettext("Without comment")
             message += "\n\n" + person.name
             message += "\n--\n" + _(u"This is an automated message sent from %s.") % current_site.domain
-            mail.send_mail(subject, message, settings.SERVER_EMAIL, translator_emails)
+            mail.send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, translator_emails)
             activate(current_lang)
 
         return self._new_state()



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