Merge lp:~matiasb/canonical-identity-provider/refactored-branding into lp:canonical-identity-provider/release

Proposed by Matias Bordese
Status: Merged
Approved by: Ricardo Kirkner
Approved revision: no longer in the source branch.
Merged at revision: 542
Proposed branch: lp:~matiasb/canonical-identity-provider/refactored-branding
Merge into: lp:canonical-identity-provider/release
Diff against target: 2344 lines (+1131/-684)
53 files modified
django_project/config_dev/config/main.cfg (+10/-3)
identityprovider/branding.py (+0/-51)
identityprovider/context_processors.py (+0/-9)
identityprovider/models/authtoken.py (+15/-15)
identityprovider/models/emailaddress.py (+2/-3)
identityprovider/schema.py (+2/-1)
identityprovider/templates/404.html (+0/-24)
identityprovider/templates/500.html (+0/-38)
identityprovider/templates/launchpad/404.html (+24/-0)
identityprovider/templates/launchpad/500.html (+38/-0)
identityprovider/templates/launchpad/registration/bad_token.html (+18/-0)
identityprovider/templates/launchpad/registration/confirm_new_account.html (+35/-0)
identityprovider/templates/launchpad/registration/email_sent.html (+75/-0)
identityprovider/templates/launchpad/registration/forgot_password.html (+41/-0)
identityprovider/templates/launchpad/registration/logout.html (+1/-1)
identityprovider/templates/launchpad/registration/logout_to_confirm.html (+18/-0)
identityprovider/templates/launchpad/registration/new_account.html (+74/-0)
identityprovider/templates/launchpad/registration/old_confirm_new_account.html (+84/-0)
identityprovider/templates/launchpad/registration/reset_password.html (+74/-0)
identityprovider/templates/launchpad/registration/token.html (+15/-0)
identityprovider/templates/launchpad/server_info.html (+16/-0)
identityprovider/templates/registration/bad_token.html (+0/-18)
identityprovider/templates/registration/confirm_new_account.html (+0/-35)
identityprovider/templates/registration/email_sent.html (+0/-75)
identityprovider/templates/registration/forgot_password.html (+0/-41)
identityprovider/templates/registration/logout_to_confirm.html (+0/-18)
identityprovider/templates/registration/new_account.html (+0/-74)
identityprovider/templates/registration/old_confirm_new_account.html (+0/-84)
identityprovider/templates/registration/reset_password.html (+0/-74)
identityprovider/templates/registration/token.html (+0/-15)
identityprovider/templates/server_info.html (+0/-15)
identityprovider/templates/ubuntu/404.html (+24/-0)
identityprovider/templates/ubuntu/500.html (+38/-0)
identityprovider/templates/ubuntu/registration/bad_token.html (+18/-0)
identityprovider/templates/ubuntu/registration/confirm_new_account.html (+35/-0)
identityprovider/templates/ubuntu/registration/email_sent.html (+75/-0)
identityprovider/templates/ubuntu/registration/forgot_password.html (+41/-0)
identityprovider/templates/ubuntu/registration/login.html (+1/-1)
identityprovider/templates/ubuntu/registration/logout.html (+1/-1)
identityprovider/templates/ubuntu/registration/logout_to_confirm.html (+18/-0)
identityprovider/templates/ubuntu/registration/new_account.html (+74/-0)
identityprovider/templates/ubuntu/registration/old_confirm_new_account.html (+84/-0)
identityprovider/templates/ubuntu/registration/reset_password.html (+74/-0)
identityprovider/templates/ubuntu/registration/token.html (+15/-0)
identityprovider/templates/ubuntu/server_info.html (+16/-0)
identityprovider/tests/unit/test_branding.py (+0/-10)
identityprovider/tests/unit/test_dbfailover.py (+1/-2)
identityprovider/tests/unit/test_loginservice.py (+8/-6)
identityprovider/tests/unit/test_models_authtoken.py (+1/-2)
identityprovider/tests/unit/test_static.py (+55/-54)
identityprovider/urls.py (+3/-4)
identityprovider/views/errors.py (+0/-2)
identityprovider/views/ui.py (+7/-8)
To merge this branch: bzr merge lp:~matiasb/canonical-identity-provider/refactored-branding
Reviewer Review Type Date Requested Status
Ricardo Kirkner (community) Approve
Review via email: mp+136952@code.launchpad.net

Commit message

Removed global branding object and updated settings/views/templates accordingly.

Description of the change

- Split branded custom templates (registration, 404, 500, server_info); that should isolate launchpad templates during consolidation?
- Removed intermediate global branding object and new settings defined (brand name, template dir).
- Removed branding context processor and updated templates where needed.

To post a comment you must log in.
Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

MP looks good. All unit and acceptance tests passed. Manual verification looks good too. Approving.

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django_project/config_dev/config/main.cfg'
2--- django_project/config_dev/config/main.cfg 2012-10-29 12:55:00 +0000
3+++ django_project/config_dev/config/main.cfg 2012-12-03 20:22:21 +0000
4@@ -1,5 +1,7 @@
5 [__noschema__]
6 basedir = /srv/%(hostname)s/%(environment)s/canonical-identity-provider
7+branded_template_dir = ubuntu
8+# branded_template_dir = launchpad
9 db_engine = identityprovider.backend
10 db_host = localhost
11 db_name = identityprovider
12@@ -91,7 +93,6 @@
13 django.core.context_processors.static
14 identityprovider.context_processors.readonly
15 identityprovider.context_processors.i18n
16- identityprovider.context_processors.branding
17 django.core.context_processors.request
18 identityprovider.context_processors.detect_embedded
19 identityprovider.context_processors.google_analytics_id
20@@ -106,7 +107,6 @@
21 #
22
23 [__main__]
24-branded_template_dir = ubuntu
25 db_statement_timeout_millis = 10000
26 extra_pythonpath = %(basedir)s
27 includes =
28@@ -121,7 +121,14 @@
29 oauth_data_store = identityprovider.store.SSODataStore
30
31 [branding]
32-brand = Ubuntu
33+brand = ubuntu
34+brand_description = Ubuntu Single Sign On
35+brand_template_dir = %(branded_template_dir)s
36+
37+# launchpad
38+# brand = launchpad
39+# brand_description = Launchpad Login Service
40+# brand_template_dir = %(branded_template_dir)s
41
42 [captcha]
43 captcha_api_url = http://api.recaptcha.net
44
45=== removed file 'identityprovider/branding.py'
46--- identityprovider/branding.py 2012-10-19 15:40:37 +0000
47+++ identityprovider/branding.py 1970-01-01 00:00:00 +0000
48@@ -1,51 +0,0 @@
49-# Copyright 2010 Canonical Ltd. This software is licensed under the
50-# GNU Affero General Public License version 3 (see the file LICENSE).
51-
52-from django.conf import settings
53-from django.utils.translation import ugettext_lazy as _
54-
55-
56-class Launchpad(object):
57- template_dir = 'launchpad'
58- name = _('Launchpad Login Service')
59- provides_access = _('A Launchpad Login Service account is free and gives '
60- 'you access to Ubuntu One, the Ubuntu Shop '
61- 'and many more useful services.')
62- create_account = _('Create a Launchpad Login Service account')
63- server_info = _('This is the Launchpad login service, built on OpenID. '
64- 'The service enables you to use your Launchpad account '
65- 'to log into OpenID-enabled sites around the Internet.')
66- complete_reg = _('Complete your Launchpad Login Service registration')
67- reset_password = _('Reset your Launchpad Login Service password')
68- not_found_error = _('There\'s no page with this address in the Launchpad '
69- 'Login Service. Check that you entered the address '
70- 'correctly and try again.')
71- oops_error = _('Sorry, something just went wrong in Launchpad Login '
72- 'Service.')
73- logout = _('You are now logged out of the Launchpad Login Service '
74- 'website. However, you have not been automatically logged '
75- 'out of every website that uses this website.')
76-
77-
78-class Ubuntu(object):
79- template_dir = 'ubuntu'
80- name = _('Ubuntu Single Sign On')
81- provides_access = _('An Ubuntu Single Sign On account is free and gives '
82- 'you access to Ubuntu One, the Ubuntu Shop '
83- 'and many more useful services.')
84- create_account = _('Create an Ubuntu Single Sign On account')
85- server_info = _('This is the Ubuntu SSO service, built on OpenID. The '
86- 'service enables you to use your Ubuntu SSO account to '
87- 'log into various sites run by Canonical and Ubuntu.')
88- complete_reg = _('Complete your Ubuntu Single Sign On registration')
89- reset_password = _('Reset your Ubuntu Single Sign On password')
90- not_found_error = _('There\'s no page with this address in the Ubuntu '
91- 'Single Sign On service. Check that you entered the '
92- 'address correctly and try again.')
93- oops_error = _('Sorry, something just went wrong in Ubuntu Single Sign '
94- 'On.')
95- logout = _('You are now logged out of the Ubuntu Single Sign On (SSO) '
96- 'website. However, you have not been automatically logged '
97- 'out of every website that uses this SSO website.')
98-
99-current_brand = globals()[settings.BRAND]()
100
101=== modified file 'identityprovider/context_processors.py'
102--- identityprovider/context_processors.py 2012-10-12 21:23:31 +0000
103+++ identityprovider/context_processors.py 2012-12-03 20:22:21 +0000
104@@ -15,20 +15,11 @@
105
106 import identityprovider.signed as signed
107
108-from identityprovider.branding import current_brand
109-
110
111 def readonly(request):
112 return {'readonly': settings.READ_ONLY_MODE}
113
114
115-def branding(request):
116- return {
117- 'template_dir': current_brand.template_dir,
118- 'brand': current_brand,
119- }
120-
121-
122 supported = [(x, settings.LANGUAGE_NAMES[x])
123 for x in settings.SUPPORTED_LANGUAGES]
124
125
126=== modified file 'identityprovider/models/authtoken.py'
127--- identityprovider/models/authtoken.py 2012-10-24 18:19:07 +0000
128+++ identityprovider/models/authtoken.py 2012-12-03 20:22:21 +0000
129@@ -14,7 +14,6 @@
130 from django.template.loader import render_to_string
131 from django.utils.translation import ugettext_lazy as _
132
133-from identityprovider.branding import current_brand
134 from identityprovider.models.const import LoginTokenType
135 from identityprovider.models import Account, DisplaynameField, PasswordField
136 from identityprovider.utils import format_address
137@@ -104,33 +103,34 @@
138 'support_form_url': settings.SUPPORT_FORM_URL,
139 }
140 message = render_to_string('%s/email/validate-email.txt' %
141- current_brand.template_dir, replacements)
142- subject = u'%s: %s' % (current_brand.name,
143+ settings.BRAND_TEMPLATE_DIR, replacements)
144+ subject = u'%s: %s' % (_(settings.BRAND_DESCRIPTION),
145 _(": Validate your email address"))
146- self._send_email(u"%s Email Validator" % current_brand.name, subject,
147- message)
148+ self._send_email(u"%s Email Validator" % settings.BRAND_DESCRIPTION,
149+ subject, message)
150
151 def sendEmailValidationToken(self, template='email-validation-token.txt'):
152 replacements = {
153 'token': self.token,
154 'toaddress': self.email,
155 }
156- template_path = '%s/email/%s' % (current_brand.template_dir, template)
157+ template_path = '%s/email/%s' % (settings.BRAND_TEMPLATE_DIR, template)
158 message = render_to_string(template_path, replacements)
159- subject = u"%s: %s" % (current_brand.name,
160+ subject = u"%s: %s" % (_(settings.BRAND_DESCRIPTION),
161 _("Validate your email address"))
162- self._send_email(u"%s Email Validator" % current_brand.name, subject,
163- message)
164+ self._send_email(u"%s Email Validator" % _(settings.BRAND_DESCRIPTION),
165+ subject, message)
166
167 def sendPasswordResetEmail(self):
168 replacements = {
169 'token': self.token,
170 'token_url': self.get_absolute_url(),
171 }
172- from_name = unicode(current_brand.name)
173+ from_name = unicode(_(settings.BRAND_DESCRIPTION))
174 message = render_to_string('%s/email/forgottenpassword.txt' %
175- current_brand.template_dir, replacements)
176- subject = u"%s: %s" % (current_brand.name, _("Forgotten Password"))
177+ settings.BRAND_TEMPLATE_DIR, replacements)
178+ subject = u"%s: %s" % (_(settings.BRAND_DESCRIPTION),
179+ _("Forgotten Password"))
180 self._send_email(from_name, subject, message)
181
182 # {{workflow}} remove the `old` parameter
183@@ -142,10 +142,10 @@
184 'token_url': url,
185 'toaddress': self.email,
186 }
187- from_name = unicode(current_brand.name)
188- template_path = '%s/email/%s' % (current_brand.template_dir, template)
189+ from_name = unicode(_(settings.BRAND_DESCRIPTION))
190+ template_path = '%s/email/%s' % (settings.BRAND_TEMPLATE_DIR, template)
191 message = render_to_string(template_path, replacements)
192- subject = u"%s: %s" % (current_brand.name,
193+ subject = u"%s: %s" % (_(settings.BRAND_DESCRIPTION),
194 _("Finish your registration"))
195 self._send_email(from_name, subject, message)
196
197
198=== modified file 'identityprovider/models/emailaddress.py'
199--- identityprovider/models/emailaddress.py 2012-10-12 21:23:31 +0000
200+++ identityprovider/models/emailaddress.py 2012-12-03 20:22:21 +0000
201@@ -12,7 +12,6 @@
202 from django.template.loader import render_to_string
203 from django.utils.translation import ugettext_lazy as _
204
205-from identityprovider.branding import current_brand
206 from identityprovider.models import Account, Person
207 from identityprovider.models.const import EmailStatus
208 from identityprovider.utils import format_address
209@@ -57,13 +56,13 @@
210 def send_message(self, subject, message):
211 """Send an email to this token's email address."""
212 from_address = format_address(settings.NOREPLY_FROM_ADDRESS,
213- unicode(current_brand.name))
214+ unicode(_(settings.BRAND_DESCRIPTION)))
215 to_address = format_address(self.email)
216 send_mail(subject, message, from_address, [to_address])
217
218 def send_preferred_changed_notification(self, new_preferred):
219 replacements = {'new_preferred': new_preferred}
220 template_path = ('%s/email/preferred-changed.txt'
221- % current_brand.template_dir)
222+ % settings.BRAND_TEMPLATE_DIR)
223 message = render_to_string(template_path, replacements)
224 self.send_message(_('E-mail change notification'), message)
225
226=== modified file 'identityprovider/schema.py'
227--- identityprovider/schema.py 2012-10-30 11:57:54 +0000
228+++ identityprovider/schema.py 2012-12-03 20:22:21 +0000
229@@ -54,7 +54,6 @@
230
231 class SSOSchema(DjangoSchema):
232 # default
233- branded_template_dir = StringOption()
234 db_connections = ListOption(item=UpperCaseDictOption(
235 spec={'database_id': StringOption(),
236 'database_host': StringOption(),
237@@ -92,6 +91,8 @@
238 # branding
239 class branding(Section):
240 brand = StringOption()
241+ brand_description = StringOption()
242+ brand_template_dir = StringOption()
243
244 # captcha
245 class captcha(Section):
246
247=== removed file 'identityprovider/templates/404.html'
248--- identityprovider/templates/404.html 2010-07-12 19:11:15 +0000
249+++ identityprovider/templates/404.html 1970-01-01 00:00:00 +0000
250@@ -1,24 +0,0 @@
251-{% extends "base.html" %}
252-{% load i18n %}
253-
254-{% comment %}
255-Copyright 2010 Canonical Ltd. This software is licensed under the
256-GNU Affero General Public License version 3 (see the file LICENSE).
257-{% endcomment %}
258-
259-{% block title %}
260- {% trans "Not found" %}
261-{% endblock %}
262-
263-{% block text_title %}
264- <h1 class="main">Lost something?</h1>
265-{% endblock %}
266-
267-{% block content %}
268- <div>
269- <p>{{ brand.not_found_error }}</p>
270- <p>
271- {% blocktrans %}(Error <abbr>ID</abbr>: {{oopsid}}){% endblocktrans %}
272- </p>
273- </div>
274-{% endblock %}
275
276=== removed file 'identityprovider/templates/500.html'
277--- identityprovider/templates/500.html 2012-08-17 15:30:19 +0000
278+++ identityprovider/templates/500.html 1970-01-01 00:00:00 +0000
279@@ -1,38 +0,0 @@
280-{% extends "base.html" %}
281-{% load i18n %}
282-
283-{% comment %}
284-Copyright 2010 Canonical Ltd. This software is licensed under the
285-GNU Affero General Public License version 3 (see the file LICENSE).
286-{% endcomment %}
287-
288-{% block title %}
289- {% trans "Oops!" %}
290-{% endblock %}
291-
292-{% block text_title %}
293- <h1 class="main">Oops!</h1>
294-{% endblock %}
295-
296-{% block content %}
297- <div>
298- <h3>
299- {{ brand.oops_error }}
300- </h3>
301- {% if errormsg %}<p>{{errormsg}}</p>{% endif %}
302- <p>
303- {% blocktrans %}We&#8217;ve recorded what happened, and we&#8217;ll fix it as soon as possible. Apologies for the inconvenience.{% endblocktrans %}
304- </p>
305- <p>
306- OOPS <abbr>ID</abbr>: {{ oopsid }}
307- </p>
308- {% if request.sentry.id %}
309- <p>
310- Sentry <abbr>ID</abbr>: {{ request.sentry.id }}
311- </p>
312- {% endif %}
313- <pre style="overflow:auto">
314-{{traceback}}
315- </pre>
316- </div>
317-{% endblock %}
318
319=== added file 'identityprovider/templates/launchpad/404.html'
320--- identityprovider/templates/launchpad/404.html 1970-01-01 00:00:00 +0000
321+++ identityprovider/templates/launchpad/404.html 2012-12-03 20:22:21 +0000
322@@ -0,0 +1,24 @@
323+{% extends "base.html" %}
324+{% load i18n %}
325+
326+{% comment %}
327+Copyright 2010 Canonical Ltd. This software is licensed under the
328+GNU Affero General Public License version 3 (see the file LICENSE).
329+{% endcomment %}
330+
331+{% block title %}
332+ {% trans "Not found" %}
333+{% endblock %}
334+
335+{% block text_title %}
336+ <h1 class="main">Lost something?</h1>
337+{% endblock %}
338+
339+{% block content %}
340+ <div>
341+ <p>{% blocktrans %}There's no page with this address in the Launchpad Login Service service. Check that you entered the address correctly and try again.{% endblocktrans %}</p>
342+ <p>
343+ {% blocktrans %}(Error <abbr>ID</abbr>: {{oopsid}}){% endblocktrans %}
344+ </p>
345+ </div>
346+{% endblock %}
347
348=== added file 'identityprovider/templates/launchpad/500.html'
349--- identityprovider/templates/launchpad/500.html 1970-01-01 00:00:00 +0000
350+++ identityprovider/templates/launchpad/500.html 2012-12-03 20:22:21 +0000
351@@ -0,0 +1,38 @@
352+{% extends "base.html" %}
353+{% load i18n %}
354+
355+{% comment %}
356+Copyright 2010 Canonical Ltd. This software is licensed under the
357+GNU Affero General Public License version 3 (see the file LICENSE).
358+{% endcomment %}
359+
360+{% block title %}
361+ {% trans "Oops!" %}
362+{% endblock %}
363+
364+{% block text_title %}
365+ <h1 class="main">Oops!</h1>
366+{% endblock %}
367+
368+{% block content %}
369+ <div>
370+ <h3>
371+ {% blocktrans %}Sorry, something just went wrong in Launchpad Login Service.{% endblocktrans %}
372+ </h3>
373+ {% if errormsg %}<p>{{ errormsg }}</p>{% endif %}
374+ <p>
375+ {% blocktrans %}We&#8217;ve recorded what happened, and we&#8217;ll fix it as soon as possible. Apologies for the inconvenience.{% endblocktrans %}
376+ </p>
377+ <p>
378+ OOPS <abbr>ID</abbr>: {{ oopsid }}
379+ </p>
380+ {% if request.sentry.id %}
381+ <p>
382+ Sentry <abbr>ID</abbr>: {{ request.sentry.id }}
383+ </p>
384+ {% endif %}
385+ <pre style="overflow:auto">
386+{{traceback}}
387+ </pre>
388+ </div>
389+{% endblock %}
390
391=== added file 'identityprovider/templates/launchpad/registration/bad_token.html'
392--- identityprovider/templates/launchpad/registration/bad_token.html 1970-01-01 00:00:00 +0000
393+++ identityprovider/templates/launchpad/registration/bad_token.html 2012-12-03 20:22:21 +0000
394@@ -0,0 +1,18 @@
395+{% extends "base.html" %}
396+{% load i18n %}
397+
398+{% comment %}
399+Copyright 2010 Canonical Ltd. This software is licensed under the
400+GNU Affero General Public License version 3 (see the file LICENSE).
401+{% endcomment %}
402+
403+{% block title %}{% trans "Unauthorized confirmation code" %}{% endblock %}
404+
405+{% block text_title %}
406+ <h1 class="main">{% trans "Unauthorized confirmation code" %}</h1>
407+{% endblock %}
408+
409+{% block content %}
410+<p>{% blocktrans %}You are not authorized to use this confirmation code. If this URL was sent to you by email, please make sure you open it in the same browser where you requested it.{% endblocktrans %}</p>
411+{% endblock %}
412+
413
414=== added file 'identityprovider/templates/launchpad/registration/confirm_new_account.html'
415--- identityprovider/templates/launchpad/registration/confirm_new_account.html 1970-01-01 00:00:00 +0000
416+++ identityprovider/templates/launchpad/registration/confirm_new_account.html 2012-12-03 20:22:21 +0000
417@@ -0,0 +1,35 @@
418+{% extends "base.html" %}
419+{% load i18n %}
420+
421+{% comment %}
422+Copyright 2010 Canonical Ltd. This software is licensed under the
423+GNU Affero General Public License version 3 (see the file LICENSE).
424+{% endcomment %}
425+
426+{% block title %}{% trans "Complete your registration" %}{% endblock %}
427+
428+{% block extra_header_top %}
429+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
430+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
431+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
432+{% endblock %}
433+
434+{% block text_title %}
435+ <h1 class="main">{% blocktrans %}Complete your Launchpad Login Service registration{% endblocktrans %}</h1>
436+{% endblock %}
437+
438+{% block content_id %}auth{% endblock %}
439+
440+{% block content %}
441+<p>{% blocktrans %}The account for {{ email }} is ready to be created.{% endblocktrans %}</p>
442+
443+<form id="login-form" class="longfields" method="post" name="loginform">
444+ {% csrf_token %}
445+ <p class="actions">
446+ <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
447+ {% trans "or" %}
448+ <a href="/">{% trans "cancel" %}</a>
449+ </p>
450+ <div style="clear: both">&nbsp;</div>
451+</form>
452+{% endblock %}
453
454=== added file 'identityprovider/templates/launchpad/registration/email_sent.html'
455--- identityprovider/templates/launchpad/registration/email_sent.html 1970-01-01 00:00:00 +0000
456+++ identityprovider/templates/launchpad/registration/email_sent.html 2012-12-03 20:22:21 +0000
457@@ -0,0 +1,75 @@
458+{% extends "base.html" %}
459+{% load i18n %}
460+
461+{% comment %}
462+Copyright 2010 Canonical Ltd. This software is licensed under the
463+GNU Affero General Public License version 3 (see the file LICENSE).
464+{% endcomment %}
465+
466+{% block title %}{{ email_heading }}{% endblock %}
467+
468+{% block text_title %}
469+ <h1 class="main">{{ email_heading }}</h1>
470+{% endblock %}
471+
472+{% block content %}
473+{% if user.is_authenticated %}<div class="email-sent-auth">{% endif %}
474+
475+<div id="col1">
476+ <div>
477+ <p class="larger">{{ email_reason|safe }}</p>
478+{% if not readonly %}
479+ <p class="larger last">
480+ {% trans "We've sent you a 6 digit confirmation code. To continue, enter that code below." %}
481+ </p>
482+{% endif %}
483+ </div>
484+
485+{% if not readonly %}
486+ <form action="{% if token %}/{{ token }}{% endif %}/+enter_token" method="post" id="email_confirm">
487+ {% csrf_token %}
488+ <p>
489+ <label>{% trans "Confirmation code" %}</label><br />
490+ <input id="confirmation_code" name="confirmation_code" type="text" class="textType" />
491+ <input type="hidden" name="email" value="{{ email }}" />
492+ </p>
493+ <p><button id="submit" type="submit" class="btn" disabled="true">
494+ <span><span>{% trans "Continue" %}</span></span>
495+ </button>
496+ {% if user.is_authenticated %}{% blocktrans %} or, <a href="/+emails">return to email addresses</a>{% endblocktrans %}{% endif %}
497+ </p>
498+ </form>
499+{% endif %}
500+</div>
501+
502+<div id="col2">
503+ <h2 class="main">{% trans "Haven&rsquo;t received it?" %}</h2>
504+ <p>{% blocktrans %}If you don&rsquo;t receive the message within a few minutes, it might be because:{% endblocktrans %}</p>
505+ <ul>
506+ <li>{% blocktrans %}Your mail provider uses &ldquo;greylisting&rdquo; to reduce spam. If so, you&rsquo;ll need to wait an hour or two for the message to arrive.{% endblocktrans %}</li>
507+ <li>{% blocktrans %}Your mail provider mistakenly blocks messages from this site. Try signing up using a service like <a href="http://gmail.com/">Gmail</a> or <a href="http://mail.yahoo.com/">Yahoo Mail</a>.{% endblocktrans %} </li>
508+ {% if email_notreceived_extra %}
509+ <li>{{ email_notreceived_extra|safe }}</li>
510+ {% endif %}
511+ </ul>
512+ <p>{% blocktrans %}If neither of those work, <a href='https://forms.canonical.com/sso-support/' title='Contact Login Support' >our service might be having a problem.</a>{% endblocktrans %}
513+ </p>
514+</div>
515+<div style="clear: both"></div>
516+{% if user.is_authenticated %}</div>{% endif %}
517+<script type="text/javascript">
518+ YUI().use('node', function (Y) {
519+ Y.on('domready', function() {
520+ Y.one('#confirmation_code').on('keyup', function() {
521+ var code = Y.one('#confirmation_code').get('value');
522+ if (code.length === 0) {
523+ Y.one('#submit').setAttribute('disabled', 'true');
524+ } else {
525+ Y.one('#submit').removeAttribute('disabled');
526+ }
527+ });
528+ });
529+ });
530+</script>
531+
532+{% endblock %}
533
534=== added file 'identityprovider/templates/launchpad/registration/forgot_password.html'
535--- identityprovider/templates/launchpad/registration/forgot_password.html 1970-01-01 00:00:00 +0000
536+++ identityprovider/templates/launchpad/registration/forgot_password.html 2012-12-03 20:22:21 +0000
537@@ -0,0 +1,41 @@
538+{% extends "base.html" %}
539+{% load i18n %}
540+
541+{% comment %}
542+Copyright 2010 Canonical Ltd. This software is licensed under the
543+GNU Affero General Public License version 3 (see the file LICENSE).
544+{% endcomment %}
545+
546+{% block title %}{% trans "Reset password" %}{% endblock %}
547+
548+{% block text_title %}
549+ <h1 class="main">{% blocktrans %}Reset your Launchpad Login Service password{% endblocktrans %}</h1>
550+{% endblock %}
551+
552+{% block content_id %}auth{% endblock %}
553+
554+{% block content %}
555+ <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to reset your password.{% endblocktrans %}</p>
556+
557+ <form action="+forgot_password" method="post">
558+ {% csrf_token %}
559+ <p class="input-row{% if form.email.errors %} haserrors{% endif %}">
560+ <label for="id_email">{% trans "Email address" %}</label>
561+ <br />
562+ {{ form.email }}
563+ {% if form.email.errors %}
564+ <span class="error">{{ form.email.errors|first }}</span>
565+ {% endif %}
566+ </p>
567+ <p>
568+ <span id="captcha">
569+ {% include "widgets/recaptcha.html" %}
570+ </span>
571+ </p>
572+ <p class="actions">
573+ <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
574+ {% trans "or" %}
575+ <a href=".">{% trans "cancel" %}</a>
576+ </p>
577+ </form>
578+{% endblock %}
579
580=== modified file 'identityprovider/templates/launchpad/registration/logout.html'
581--- identityprovider/templates/launchpad/registration/logout.html 2010-11-16 11:00:25 +0000
582+++ identityprovider/templates/launchpad/registration/logout.html 2012-12-03 20:22:21 +0000
583@@ -13,7 +13,7 @@
584 {% endblock %}
585
586 {% block content %}
587- <p>{{ brand.logout }}</p>
588+ <p>{% blocktrans %}You are now logged out of the Launchpad Login Service website. However, you have not been automatically logged out of every website that uses this website.{% endblocktrans %}</p>
589
590 <p class="returnto">
591 {% if return_to_url %}
592
593=== added file 'identityprovider/templates/launchpad/registration/logout_to_confirm.html'
594--- identityprovider/templates/launchpad/registration/logout_to_confirm.html 1970-01-01 00:00:00 +0000
595+++ identityprovider/templates/launchpad/registration/logout_to_confirm.html 2012-12-03 20:22:21 +0000
596@@ -0,0 +1,18 @@
597+{% extends "base.html" %}
598+{% load i18n %}
599+
600+{% comment %}
601+Copyright 2010 Canonical Ltd. This software is licensed under the
602+GNU Affero General Public License version 3 (see the file LICENSE).
603+{% endcomment %}
604+
605+{% block title %}{% trans "Can not use confirmation code while logged in" %}{% endblock %}
606+
607+{% block text_title %}
608+ <h1 class="main">{% trans "Can not use confirmation code while logged in" %}</h1>
609+{% endblock %}
610+
611+{% block content %}
612+ <p>{% blocktrans %}You have attempted to confirm an account while logged in as someone else. We've cancelled your request. Please log out and create your new account again.{% endblocktrans %}</p>
613+{% endblock %}
614+
615
616=== added file 'identityprovider/templates/launchpad/registration/new_account.html'
617--- identityprovider/templates/launchpad/registration/new_account.html 1970-01-01 00:00:00 +0000
618+++ identityprovider/templates/launchpad/registration/new_account.html 2012-12-03 20:22:21 +0000
619@@ -0,0 +1,74 @@
620+{% extends "base.html" %}
621+{% load i18n %}
622+
623+{% comment %}
624+Copyright 2010 Canonical Ltd. This software is licensed under the
625+GNU Affero General Public License version 3 (see the file LICENSE).
626+{% endcomment %}
627+
628+{% block title %}{% trans "Create account" %}{% endblock %}
629+
630+{% block extra_header_top %}
631+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
632+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
633+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
634+{% endblock %}
635+
636+{% block extra_header %}
637+{% include "widgets/passwords_head_content.html" %}
638+{% endblock %}
639+
640+{% block text_title %}
641+ {% if rpconfig and rpconfig.logo_url %}
642+ <div id='rpconfig_logo'>
643+ <img src='{{ rpconfig.logo_url }}'/>
644+ </div>
645+ {% endif %}
646+ <h1 class="main">{% blocktrans %}Create an Launchpad Login Service account{% endblocktrans %}</h1>
647+{% endblock %}
648+
649+{% block content_id %}auth{% endblock %}
650+
651+{% block content %}
652+ <p>{% blocktrans %}Enter the following information, and we will send you instructions on how to confirm your account.{% endblocktrans %}</p>
653+
654+ <form action="+new_account" method="post" name="newaccountform">
655+ {% csrf_token %}
656+ <p class="input-row{% if form.displayname.errors %} haserrors{% endif %}">
657+ <label for="id_displayname">{% trans "Full name" %}</label>
658+ <br />
659+ {{ form.displayname }}
660+ {% if form.displayname.errors %}
661+ <span class="error">
662+ {{ form.displayname.errors|first }}
663+ </span>
664+ {% endif %}
665+ </p>
666+ <p class="input-row{% if form.email.errors %} haserrors{% endif %}">
667+ <label for="id_email">{% trans "Email address" %}</label>
668+ <br />
669+ {{ form.email }}
670+ {% if form.email.errors %}
671+ <span class="error">{{ form.email.errors|first }}</span>
672+ {% endif %}
673+ </p>
674+ {% include "widgets/passwords.html" %}
675+ <p>
676+ <span id="captcha">
677+ {% include "widgets/recaptcha.html" %}
678+ </span>
679+ </p>
680+ <p class="actions">
681+ {# {{workflow}} #}
682+ {% if old %}
683+ <input type="hidden" name="old" value="old">
684+ {% endif %}
685+ <button type="submit" class="btn" name="continue"><span><span>{% trans "Continue" %}</span></span></button>
686+ {% trans "or" %}
687+ <a href=".">{% trans "cancel" %}</a>
688+ </p>
689+ </form>
690+ <script type="text/javascript">
691+ document.newaccountform.displayname.focus();
692+ </script>
693+{% endblock %}
694
695=== added file 'identityprovider/templates/launchpad/registration/old_confirm_new_account.html'
696--- identityprovider/templates/launchpad/registration/old_confirm_new_account.html 1970-01-01 00:00:00 +0000
697+++ identityprovider/templates/launchpad/registration/old_confirm_new_account.html 2012-12-03 20:22:21 +0000
698@@ -0,0 +1,84 @@
699+{% extends "base.html" %}
700+{% load i18n %}
701+
702+{% comment %}
703+Copyright 2010 Canonical Ltd. This software is licensed under the
704+GNU Affero General Public License version 3 (see the file LICENSE).
705+{% endcomment %}
706+
707+{% block title %}{% trans "Complete your registration" %}{% endblock %}
708+
709+{% block extra_header_top %}
710+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
711+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
712+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
713+{% endblock %}
714+
715+{% block extra_header %}
716+<script type="text/javascript" src="{{ STATIC_URL }}lazr-js/lazr/lazr-meta.js"></script>
717+<script type="text/javascript">
718+ var LAZR_YUI_CONFIG = {
719+ filter: "min",
720+ base: "{{ STATIC_URL }}lazr-js/",
721+ modules: LAZR_MODULES,
722+ insertBefore: "style-overrides"
723+ };
724+ var LP = YUI(LAZR_YUI_CONFIG);
725+ LP.use('node', 'event', 'lazr.passwordmeter', function(Y){
726+ var passwordMeter = new Y.PasswordMeter({
727+ input: '#id_password',
728+ contentBox: '#password_strength',
729+ tabIndex: null,
730+ messages: ['{% trans "Strength: too short" %}',
731+ '{% trans "Strength: weak" %}',
732+ '{% trans "Strength: fair" %}',
733+ '{% trans "Strength: good" %}',
734+ '{% trans "Strength: strong" %}']
735+ });
736+ passwordMeter.render();
737+ });
738+</script>
739+<style id="style-overrides" type="text/css">
740+div.yui-passwordmeter {
741+ clear: left;
742+}
743+#password_strength {
744+ font-weight: bold;
745+}
746+</style>
747+{% endblock %}
748+
749+{% block text_title %}
750+ <h1 class="main">{% blocktrans %}Complete your Launchpad Login Service registration{% endblocktrans %}</h1>
751+{% endblock %}
752+
753+{% block content_id %}auth{% endblock %}
754+
755+{% block content %}
756+ <form id="login-form" class="longfields" method="post" name="loginform">
757+ {% csrf_token %}
758+ <p class="input-row{% if form.displayname.errors %} haserrors{% endif %}">
759+ <label for="id_displayname">{% trans "Full name" %}</label>
760+ <br />
761+ {{ form.displayname }}
762+ {% if form.displayname.errors %}
763+ <span class="error">
764+ {{ form.displayname.errors|first }}
765+ </span>
766+ {% endif %}
767+ </p>
768+ {% include "widgets/passwords.html" %}
769+ <p class="actions">
770+ <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
771+ {% trans "or" %}
772+ <a href="{% if token %}/{{ token }}{% endif %}/">
773+ {% trans "cancel" %}
774+ </a>
775+ </p>
776+ <div style="clear: both">&nbsp;</div>
777+ </form>
778+
779+<script type="text/javascript">
780+document.loginform.displayname.focus();
781+</script>
782+{% endblock %}
783
784=== added file 'identityprovider/templates/launchpad/registration/reset_password.html'
785--- identityprovider/templates/launchpad/registration/reset_password.html 1970-01-01 00:00:00 +0000
786+++ identityprovider/templates/launchpad/registration/reset_password.html 2012-12-03 20:22:21 +0000
787@@ -0,0 +1,74 @@
788+{% extends "base.html" %}
789+{% load i18n %}
790+
791+{% comment %}
792+Copyright 2010 Canonical Ltd. This software is licensed under the
793+GNU Affero General Public License version 3 (see the file LICENSE).
794+{% endcomment %}
795+
796+{% block title %}{% trans "Reset password" %}{% endblock %}
797+
798+{% block extra_header_top %}
799+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
800+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
801+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
802+{% endblock %}
803+
804+{% block extra_header %}
805+<script type="text/javascript" src="{{ STATIC_URL }}lazr-js/lazr/lazr-meta.js"></script>
806+<script type="text/javascript">
807+ var LAZR_YUI_CONFIG = {
808+ filter: "min",
809+ base: "{{ STATIC_URL }}lazr-js/",
810+ modules: LAZR_MODULES,
811+ insertBefore: "style-overrides"
812+ };
813+ var LP = YUI(LAZR_YUI_CONFIG);
814+ LP.use('node', 'event', 'lazr.passwordmeter', function(Y){
815+
816+ var passwordMeter = new Y.PasswordMeter({
817+ input: '#id_password',
818+ contentBox: '#password_strength',
819+ tabIndex: null,
820+ messages: ['{% trans "Strength: too short" %}',
821+ '{% trans "Strength: weak" %}',
822+ '{% trans "Strength: fair" %}',
823+ '{% trans "Strength: good" %}',
824+ '{% trans "Strength: strong" %}']
825+ });
826+
827+ passwordMeter.render();
828+ });
829+</script>
830+<style id="style-overrides" type="text/css">
831+ div.yui-passwordmeter {
832+ clear: left;
833+ }
834+ #password_strength {
835+ font-weight: bold;
836+ }
837+</style>
838+{% endblock %}
839+
840+{% block text_title %}
841+ <h1 class="main">{% blocktrans %}Reset your Launchpad Login Service password{% endblocktrans %}</h1>
842+{% endblock %}
843+
844+{% block content_id %}auth{% endblock %}
845+
846+{% block content %}
847+ <form id="login-form" class="longfields" method="post">
848+ {% csrf_token %}
849+ {% include "widgets/passwords.html" %}
850+ <p class="actions">
851+ <button type="submit" name="continue" class="btn">
852+ <span><span>{% trans "Continue" %}</span></span>
853+ </button>
854+ {% trans "or" %}
855+ <a href="{% if token %}/{{ token }}{% endif %}/">
856+ {% trans "cancel" %}
857+ </a>
858+ </p>
859+ <div style="clear: both">&nbsp;</div>
860+ </form>
861+{% endblock %}
862
863=== added file 'identityprovider/templates/launchpad/registration/token.html'
864--- identityprovider/templates/launchpad/registration/token.html 1970-01-01 00:00:00 +0000
865+++ identityprovider/templates/launchpad/registration/token.html 2012-12-03 20:22:21 +0000
866@@ -0,0 +1,15 @@
867+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
868+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
869+
870+{% comment %}
871+Copyright 2010 Canonical Ltd. This software is licensed under the
872+GNU Affero General Public License version 3 (see the file LICENSE).
873+{% endcomment %}
874+
875+<html>
876+ <body>
877+ <form>
878+ <input type="hidden" name="token" value="{{token}}">
879+ </form>
880+ </body>
881+</html>
882
883=== added file 'identityprovider/templates/launchpad/server_info.html'
884--- identityprovider/templates/launchpad/server_info.html 1970-01-01 00:00:00 +0000
885+++ identityprovider/templates/launchpad/server_info.html 2012-12-03 20:22:21 +0000
886@@ -0,0 +1,16 @@
887+{% extends "base.html" %}
888+{% load i18n %}
889+
890+{% comment %}
891+Copyright 2010 Canonical Ltd. This software is licensed under the
892+GNU Affero General Public License version 3 (see the file LICENSE).
893+{% endcomment %}
894+
895+{% block title %}{% trans "This is an OpenID server" %}{% endblock %}
896+
897+{% block content %}
898+ <p>{% blocktrans %}This is the Launchpad login service, built on OpenID. The service enables you to use your Launchpad account to log into OpenID-enabled sites around the Internet.{% endblocktrans %}
899+ </p>
900+ <p>{% blocktrans %}This page is meant to be called from an OpenID-enabled site and therefore has no user-facing functions.{% endblocktrans %}</p>
901+{% endblock %}
902+
903
904=== removed directory 'identityprovider/templates/registration'
905=== removed file 'identityprovider/templates/registration/bad_token.html'
906--- identityprovider/templates/registration/bad_token.html 2010-07-15 22:20:43 +0000
907+++ identityprovider/templates/registration/bad_token.html 1970-01-01 00:00:00 +0000
908@@ -1,18 +0,0 @@
909-{% extends "base.html" %}
910-{% load i18n %}
911-
912-{% comment %}
913-Copyright 2010 Canonical Ltd. This software is licensed under the
914-GNU Affero General Public License version 3 (see the file LICENSE).
915-{% endcomment %}
916-
917-{% block title %}{% trans "Unauthorized confirmation code" %}{% endblock %}
918-
919-{% block text_title %}
920- <h1 class="main">{% trans "Unauthorized confirmation code" %}</h1>
921-{% endblock %}
922-
923-{% block content %}
924-<p>{% blocktrans %}You are not authorized to use this confirmation code. If this URL was sent to you by email, please make sure you open it in the same browser where you requested it.{% endblocktrans %}</p>
925-{% endblock %}
926-
927
928=== removed file 'identityprovider/templates/registration/confirm_new_account.html'
929--- identityprovider/templates/registration/confirm_new_account.html 2011-09-15 21:02:31 +0000
930+++ identityprovider/templates/registration/confirm_new_account.html 1970-01-01 00:00:00 +0000
931@@ -1,35 +0,0 @@
932-{% extends "base.html" %}
933-{% load i18n %}
934-
935-{% comment %}
936-Copyright 2010 Canonical Ltd. This software is licensed under the
937-GNU Affero General Public License version 3 (see the file LICENSE).
938-{% endcomment %}
939-
940-{% block title %}{% trans "Complete your registration" %}{% endblock %}
941-
942-{% block extra_header_top %}
943-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
944-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
945-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
946-{% endblock %}
947-
948-{% block text_title %}
949- <h1 class="main">{{ brand.complete_reg }}</h1>
950-{% endblock %}
951-
952-{% block content_id %}auth{% endblock %}
953-
954-{% block content %}
955-<p>{% blocktrans %}The account for {{ email }} is ready to be created.{% endblocktrans %}</p>
956-
957-<form id="login-form" class="longfields" method="post" name="loginform">
958- {% csrf_token %}
959- <p class="actions">
960- <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
961- {% trans "or" %}
962- <a href="/">{% trans "cancel" %}</a>
963- </p>
964- <div style="clear: both">&nbsp;</div>
965-</form>
966-{% endblock %}
967
968=== removed file 'identityprovider/templates/registration/email_sent.html'
969--- identityprovider/templates/registration/email_sent.html 2012-11-06 17:28:50 +0000
970+++ identityprovider/templates/registration/email_sent.html 1970-01-01 00:00:00 +0000
971@@ -1,75 +0,0 @@
972-{% extends "base.html" %}
973-{% load i18n %}
974-
975-{% comment %}
976-Copyright 2010 Canonical Ltd. This software is licensed under the
977-GNU Affero General Public License version 3 (see the file LICENSE).
978-{% endcomment %}
979-
980-{% block title %}{{ email_heading }}{% endblock %}
981-
982-{% block text_title %}
983- <h1 class="main">{{ email_heading }}</h1>
984-{% endblock %}
985-
986-{% block content %}
987-{% if user.is_authenticated %}<div class="email-sent-auth">{% endif %}
988-
989-<div id="col1">
990- <div>
991- <p class="larger">{{ email_reason|safe }}</p>
992-{% if not readonly %}
993- <p class="larger last">
994- {% trans "We've sent you a 6 digit confirmation code. To continue, enter that code below." %}
995- </p>
996-{% endif %}
997- </div>
998-
999-{% if not readonly %}
1000- <form action="{% if token %}/{{ token }}{% endif %}/+enter_token" method="post" id="email_confirm">
1001- {% csrf_token %}
1002- <p>
1003- <label>{% trans "Confirmation code" %}</label><br />
1004- <input id="confirmation_code" name="confirmation_code" type="text" class="textType" />
1005- <input type="hidden" name="email" value="{{ email }}" />
1006- </p>
1007- <p><button id="submit" type="submit" class="btn" disabled="true">
1008- <span><span>{% trans "Continue" %}</span></span>
1009- </button>
1010- {% if user.is_authenticated %}{% blocktrans %} or, <a href="/+emails">return to email addresses</a>{% endblocktrans %}{% endif %}
1011- </p>
1012- </form>
1013-{% endif %}
1014-</div>
1015-
1016-<div id="col2">
1017- <h2 class="main">{% trans "Haven&rsquo;t received it?" %}</h2>
1018- <p>{% blocktrans %}If you don&rsquo;t receive the message within a few minutes, it might be because:{% endblocktrans %}</p>
1019- <ul>
1020- <li>{% blocktrans %}Your mail provider uses &ldquo;greylisting&rdquo; to reduce spam. If so, you&rsquo;ll need to wait an hour or two for the message to arrive.{% endblocktrans %}</li>
1021- <li>{% blocktrans %}Your mail provider mistakenly blocks messages from this site. Try signing up using a service like <a href="http://gmail.com/">Gmail</a> or <a href="http://mail.yahoo.com/">Yahoo Mail</a>.{% endblocktrans %} </li>
1022- {% if email_notreceived_extra %}
1023- <li>{{ email_notreceived_extra|safe }}</li>
1024- {% endif %}
1025- </ul>
1026- <p>{% blocktrans %}If neither of those work, <a href='https://forms.canonical.com/sso-support/' title='Contact Login Support' >our service might be having a problem.</a>{% endblocktrans %}
1027- </p>
1028-</div>
1029-<div style="clear: both"></div>
1030-{% if user.is_authenticated %}</div>{% endif %}
1031-<script type="text/javascript">
1032- YUI().use('node', function (Y) {
1033- Y.on('domready', function() {
1034- Y.one('#confirmation_code').on('keyup', function() {
1035- var code = Y.one('#confirmation_code').get('value');
1036- if (code.length === 0) {
1037- Y.one('#submit').setAttribute('disabled', 'true');
1038- } else {
1039- Y.one('#submit').removeAttribute('disabled');
1040- }
1041- });
1042- });
1043- });
1044-</script>
1045-
1046-{% endblock %}
1047
1048=== removed file 'identityprovider/templates/registration/forgot_password.html'
1049--- identityprovider/templates/registration/forgot_password.html 2012-05-24 13:32:45 +0000
1050+++ identityprovider/templates/registration/forgot_password.html 1970-01-01 00:00:00 +0000
1051@@ -1,41 +0,0 @@
1052-{% extends "base.html" %}
1053-{% load i18n %}
1054-
1055-{% comment %}
1056-Copyright 2010 Canonical Ltd. This software is licensed under the
1057-GNU Affero General Public License version 3 (see the file LICENSE).
1058-{% endcomment %}
1059-
1060-{% block title %}{% trans "Reset password" %}{% endblock %}
1061-
1062-{% block text_title %}
1063- <h1 class="main">{{ brand.reset_password }}</h1>
1064-{% endblock %}
1065-
1066-{% block content_id %}auth{% endblock %}
1067-
1068-{% block content %}
1069- <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to reset your password.{% endblocktrans %}</p>
1070-
1071- <form action="+forgot_password" method="post">
1072- {% csrf_token %}
1073- <p class="input-row{% if form.email.errors %} haserrors{% endif %}">
1074- <label for="id_email">{% trans "Email address" %}</label>
1075- <br />
1076- {{ form.email }}
1077- {% if form.email.errors %}
1078- <span class="error">{{ form.email.errors|first }}</span>
1079- {% endif %}
1080- </p>
1081- <p>
1082- <span id="captcha">
1083- {% include "widgets/recaptcha.html" %}
1084- </span>
1085- </p>
1086- <p class="actions">
1087- <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
1088- {% trans "or" %}
1089- <a href=".">{% trans "cancel" %}</a>
1090- </p>
1091- </form>
1092-{% endblock %}
1093
1094=== removed file 'identityprovider/templates/registration/logout_to_confirm.html'
1095--- identityprovider/templates/registration/logout_to_confirm.html 2010-07-15 22:20:43 +0000
1096+++ identityprovider/templates/registration/logout_to_confirm.html 1970-01-01 00:00:00 +0000
1097@@ -1,18 +0,0 @@
1098-{% extends "base.html" %}
1099-{% load i18n %}
1100-
1101-{% comment %}
1102-Copyright 2010 Canonical Ltd. This software is licensed under the
1103-GNU Affero General Public License version 3 (see the file LICENSE).
1104-{% endcomment %}
1105-
1106-{% block title %}{% trans "Can not use confirmation code while logged in" %}{% endblock %}
1107-
1108-{% block text_title %}
1109- <h1 class="main">{% trans "Can not use confirmation code while logged in" %}</h1>
1110-{% endblock %}
1111-
1112-{% block content %}
1113- <p>{% blocktrans %}You have attempted to confirm an account while logged in as someone else. We've cancelled your request. Please log out and create your new account again.{% endblocktrans %}</p>
1114-{% endblock %}
1115-
1116
1117=== removed file 'identityprovider/templates/registration/new_account.html'
1118--- identityprovider/templates/registration/new_account.html 2012-11-16 10:38:25 +0000
1119+++ identityprovider/templates/registration/new_account.html 1970-01-01 00:00:00 +0000
1120@@ -1,74 +0,0 @@
1121-{% extends "base.html" %}
1122-{% load i18n %}
1123-
1124-{% comment %}
1125-Copyright 2010 Canonical Ltd. This software is licensed under the
1126-GNU Affero General Public License version 3 (see the file LICENSE).
1127-{% endcomment %}
1128-
1129-{% block title %}{% trans "Create account" %}{% endblock %}
1130-
1131-{% block extra_header_top %}
1132-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
1133-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
1134-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
1135-{% endblock %}
1136-
1137-{% block extra_header %}
1138-{% include "widgets/passwords_head_content.html" %}
1139-{% endblock %}
1140-
1141-{% block text_title %}
1142- {% if rpconfig and rpconfig.logo_url %}
1143- <div id='rpconfig_logo'>
1144- <img src='{{ rpconfig.logo_url }}'/>
1145- </div>
1146- {% endif %}
1147- <h1 class="main">{{ brand.create_account }}</h1>
1148-{% endblock %}
1149-
1150-{% block content_id %}auth{% endblock %}
1151-
1152-{% block content %}
1153- <p>{% blocktrans %}Enter the following information, and we will send you instructions on how to confirm your account.{% endblocktrans %}</p>
1154-
1155- <form action="+new_account" method="post" name="newaccountform">
1156- {% csrf_token %}
1157- <p class="input-row{% if form.displayname.errors %} haserrors{% endif %}">
1158- <label for="id_displayname">{% trans "Full name" %}</label>
1159- <br />
1160- {{ form.displayname }}
1161- {% if form.displayname.errors %}
1162- <span class="error">
1163- {{ form.displayname.errors|first }}
1164- </span>
1165- {% endif %}
1166- </p>
1167- <p class="input-row{% if form.email.errors %} haserrors{% endif %}">
1168- <label for="id_email">{% trans "Email address" %}</label>
1169- <br />
1170- {{ form.email }}
1171- {% if form.email.errors %}
1172- <span class="error">{{ form.email.errors|first }}</span>
1173- {% endif %}
1174- </p>
1175- {% include "widgets/passwords.html" %}
1176- <p>
1177- <span id="captcha">
1178- {% include "widgets/recaptcha.html" %}
1179- </span>
1180- </p>
1181- <p class="actions">
1182- {# {{workflow}} #}
1183- {% if old %}
1184- <input type="hidden" name="old" value="old">
1185- {% endif %}
1186- <button type="submit" class="btn" name="continue"><span><span>{% trans "Continue" %}</span></span></button>
1187- {% trans "or" %}
1188- <a href=".">{% trans "cancel" %}</a>
1189- </p>
1190- </form>
1191- <script type="text/javascript">
1192- document.newaccountform.displayname.focus();
1193- </script>
1194-{% endblock %}
1195
1196=== removed file 'identityprovider/templates/registration/old_confirm_new_account.html'
1197--- identityprovider/templates/registration/old_confirm_new_account.html 2012-02-17 21:32:33 +0000
1198+++ identityprovider/templates/registration/old_confirm_new_account.html 1970-01-01 00:00:00 +0000
1199@@ -1,84 +0,0 @@
1200-{% extends "base.html" %}
1201-{% load i18n %}
1202-
1203-{% comment %}
1204-Copyright 2010 Canonical Ltd. This software is licensed under the
1205-GNU Affero General Public License version 3 (see the file LICENSE).
1206-{% endcomment %}
1207-
1208-{% block title %}{% trans "Complete your registration" %}{% endblock %}
1209-
1210-{% block extra_header_top %}
1211-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
1212-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
1213-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
1214-{% endblock %}
1215-
1216-{% block extra_header %}
1217-<script type="text/javascript" src="{{ STATIC_URL }}lazr-js/lazr/lazr-meta.js"></script>
1218-<script type="text/javascript">
1219- var LAZR_YUI_CONFIG = {
1220- filter: "min",
1221- base: "{{ STATIC_URL }}lazr-js/",
1222- modules: LAZR_MODULES,
1223- insertBefore: "style-overrides"
1224- };
1225- var LP = YUI(LAZR_YUI_CONFIG);
1226- LP.use('node', 'event', 'lazr.passwordmeter', function(Y){
1227- var passwordMeter = new Y.PasswordMeter({
1228- input: '#id_password',
1229- contentBox: '#password_strength',
1230- tabIndex: null,
1231- messages: ['{% trans "Strength: too short" %}',
1232- '{% trans "Strength: weak" %}',
1233- '{% trans "Strength: fair" %}',
1234- '{% trans "Strength: good" %}',
1235- '{% trans "Strength: strong" %}']
1236- });
1237- passwordMeter.render();
1238- });
1239-</script>
1240-<style id="style-overrides" type="text/css">
1241-div.yui-passwordmeter {
1242- clear: left;
1243-}
1244-#password_strength {
1245- font-weight: bold;
1246-}
1247-</style>
1248-{% endblock %}
1249-
1250-{% block text_title %}
1251- <h1 class="main">{{ brand.complete_reg }}</h1>
1252-{% endblock %}
1253-
1254-{% block content_id %}auth{% endblock %}
1255-
1256-{% block content %}
1257- <form id="login-form" class="longfields" method="post" name="loginform">
1258- {% csrf_token %}
1259- <p class="input-row{% if form.displayname.errors %} haserrors{% endif %}">
1260- <label for="id_displayname">{% trans "Full name" %}</label>
1261- <br />
1262- {{ form.displayname }}
1263- {% if form.displayname.errors %}
1264- <span class="error">
1265- {{ form.displayname.errors|first }}
1266- </span>
1267- {% endif %}
1268- </p>
1269- {% include "widgets/passwords.html" %}
1270- <p class="actions">
1271- <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
1272- {% trans "or" %}
1273- <a href="{% if token %}/{{ token }}{% endif %}/">
1274- {% trans "cancel" %}
1275- </a>
1276- </p>
1277- <div style="clear: both">&nbsp;</div>
1278- </form>
1279-
1280-<script type="text/javascript">
1281-document.loginform.displayname.focus();
1282-</script>
1283-{% endblock %}
1284
1285=== removed file 'identityprovider/templates/registration/reset_password.html'
1286--- identityprovider/templates/registration/reset_password.html 2012-02-17 21:32:33 +0000
1287+++ identityprovider/templates/registration/reset_password.html 1970-01-01 00:00:00 +0000
1288@@ -1,74 +0,0 @@
1289-{% extends "base.html" %}
1290-{% load i18n %}
1291-
1292-{% comment %}
1293-Copyright 2010 Canonical Ltd. This software is licensed under the
1294-GNU Affero General Public License version 3 (see the file LICENSE).
1295-{% endcomment %}
1296-
1297-{% block title %}{% trans "Reset password" %}{% endblock %}
1298-
1299-{% block extra_header_top %}
1300-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
1301-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
1302-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
1303-{% endblock %}
1304-
1305-{% block extra_header %}
1306-<script type="text/javascript" src="{{ STATIC_URL }}lazr-js/lazr/lazr-meta.js"></script>
1307-<script type="text/javascript">
1308- var LAZR_YUI_CONFIG = {
1309- filter: "min",
1310- base: "{{ STATIC_URL }}lazr-js/",
1311- modules: LAZR_MODULES,
1312- insertBefore: "style-overrides"
1313- };
1314- var LP = YUI(LAZR_YUI_CONFIG);
1315- LP.use('node', 'event', 'lazr.passwordmeter', function(Y){
1316-
1317- var passwordMeter = new Y.PasswordMeter({
1318- input: '#id_password',
1319- contentBox: '#password_strength',
1320- tabIndex: null,
1321- messages: ['{% trans "Strength: too short" %}',
1322- '{% trans "Strength: weak" %}',
1323- '{% trans "Strength: fair" %}',
1324- '{% trans "Strength: good" %}',
1325- '{% trans "Strength: strong" %}']
1326- });
1327-
1328- passwordMeter.render();
1329- });
1330-</script>
1331-<style id="style-overrides" type="text/css">
1332- div.yui-passwordmeter {
1333- clear: left;
1334- }
1335- #password_strength {
1336- font-weight: bold;
1337- }
1338-</style>
1339-{% endblock %}
1340-
1341-{% block text_title %}
1342- <h1 class="main">{{ brand.reset_password }}</h1>
1343-{% endblock %}
1344-
1345-{% block content_id %}auth{% endblock %}
1346-
1347-{% block content %}
1348- <form id="login-form" class="longfields" method="post">
1349- {% csrf_token %}
1350- {% include "widgets/passwords.html" %}
1351- <p class="actions">
1352- <button type="submit" name="continue" class="btn">
1353- <span><span>{% trans "Continue" %}</span></span>
1354- </button>
1355- {% trans "or" %}
1356- <a href="{% if token %}/{{ token }}{% endif %}/">
1357- {% trans "cancel" %}
1358- </a>
1359- </p>
1360- <div style="clear: both">&nbsp;</div>
1361- </form>
1362-{% endblock %}
1363
1364=== removed file 'identityprovider/templates/registration/token.html'
1365--- identityprovider/templates/registration/token.html 2010-07-12 19:11:15 +0000
1366+++ identityprovider/templates/registration/token.html 1970-01-01 00:00:00 +0000
1367@@ -1,15 +0,0 @@
1368-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1369- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1370-
1371-{% comment %}
1372-Copyright 2010 Canonical Ltd. This software is licensed under the
1373-GNU Affero General Public License version 3 (see the file LICENSE).
1374-{% endcomment %}
1375-
1376-<html>
1377- <body>
1378- <form>
1379- <input type="hidden" name="token" value="{{token}}">
1380- </form>
1381- </body>
1382-</html>
1383
1384=== removed file 'identityprovider/templates/server_info.html'
1385--- identityprovider/templates/server_info.html 2010-07-12 19:11:15 +0000
1386+++ identityprovider/templates/server_info.html 1970-01-01 00:00:00 +0000
1387@@ -1,15 +0,0 @@
1388-{% extends "base.html" %}
1389-{% load i18n %}
1390-
1391-{% comment %}
1392-Copyright 2010 Canonical Ltd. This software is licensed under the
1393-GNU Affero General Public License version 3 (see the file LICENSE).
1394-{% endcomment %}
1395-
1396-{% block title %}{% trans "This is an OpenID server" %}{% endblock %}
1397-
1398-{% block content %}
1399- <p>{{ brand.server_info }}</p>
1400- <p>{% blocktrans %}This page is meant to be called from an OpenID-enabled site and therefore has no user-facing functions.{% endblocktrans %}</p>
1401-{% endblock %}
1402-
1403
1404=== added file 'identityprovider/templates/ubuntu/404.html'
1405--- identityprovider/templates/ubuntu/404.html 1970-01-01 00:00:00 +0000
1406+++ identityprovider/templates/ubuntu/404.html 2012-12-03 20:22:21 +0000
1407@@ -0,0 +1,24 @@
1408+{% extends "base.html" %}
1409+{% load i18n %}
1410+
1411+{% comment %}
1412+Copyright 2010 Canonical Ltd. This software is licensed under the
1413+GNU Affero General Public License version 3 (see the file LICENSE).
1414+{% endcomment %}
1415+
1416+{% block title %}
1417+ {% trans "Not found" %}
1418+{% endblock %}
1419+
1420+{% block text_title %}
1421+ <h1 class="main">Lost something?</h1>
1422+{% endblock %}
1423+
1424+{% block content %}
1425+ <div>
1426+ <p>{% blocktrans %}There's no page with this address in the Ubuntu Single Sign On service. Check that you entered the address correctly and try again.{% endblocktrans %}</p>
1427+ <p>
1428+ {% blocktrans %}(Error <abbr>ID</abbr>: {{oopsid}}){% endblocktrans %}
1429+ </p>
1430+ </div>
1431+{% endblock %}
1432
1433=== added file 'identityprovider/templates/ubuntu/500.html'
1434--- identityprovider/templates/ubuntu/500.html 1970-01-01 00:00:00 +0000
1435+++ identityprovider/templates/ubuntu/500.html 2012-12-03 20:22:21 +0000
1436@@ -0,0 +1,38 @@
1437+{% extends "base.html" %}
1438+{% load i18n %}
1439+
1440+{% comment %}
1441+Copyright 2010 Canonical Ltd. This software is licensed under the
1442+GNU Affero General Public License version 3 (see the file LICENSE).
1443+{% endcomment %}
1444+
1445+{% block title %}
1446+ {% trans "Oops!" %}
1447+{% endblock %}
1448+
1449+{% block text_title %}
1450+ <h1 class="main">Oops!</h1>
1451+{% endblock %}
1452+
1453+{% block content %}
1454+ <div>
1455+ <h3>
1456+ {% blocktrans %}Sorry, something just went wrong in Ubuntu Single Sign On.{% endblocktrans %}
1457+ </h3>
1458+ {% if errormsg %}<p>{{ errormsg }}</p>{% endif %}
1459+ <p>
1460+ {% blocktrans %}We&#8217;ve recorded what happened, and we&#8217;ll fix it as soon as possible. Apologies for the inconvenience.{% endblocktrans %}
1461+ </p>
1462+ <p>
1463+ OOPS <abbr>ID</abbr>: {{ oopsid }}
1464+ </p>
1465+ {% if request.sentry.id %}
1466+ <p>
1467+ Sentry <abbr>ID</abbr>: {{ request.sentry.id }}
1468+ </p>
1469+ {% endif %}
1470+ <pre style="overflow:auto">
1471+{{traceback}}
1472+ </pre>
1473+ </div>
1474+{% endblock %}
1475
1476=== added file 'identityprovider/templates/ubuntu/registration/bad_token.html'
1477--- identityprovider/templates/ubuntu/registration/bad_token.html 1970-01-01 00:00:00 +0000
1478+++ identityprovider/templates/ubuntu/registration/bad_token.html 2012-12-03 20:22:21 +0000
1479@@ -0,0 +1,18 @@
1480+{% extends "base.html" %}
1481+{% load i18n %}
1482+
1483+{% comment %}
1484+Copyright 2010 Canonical Ltd. This software is licensed under the
1485+GNU Affero General Public License version 3 (see the file LICENSE).
1486+{% endcomment %}
1487+
1488+{% block title %}{% trans "Unauthorized confirmation code" %}{% endblock %}
1489+
1490+{% block text_title %}
1491+ <h1 class="main">{% trans "Unauthorized confirmation code" %}</h1>
1492+{% endblock %}
1493+
1494+{% block content %}
1495+<p>{% blocktrans %}You are not authorized to use this confirmation code. If this URL was sent to you by email, please make sure you open it in the same browser where you requested it.{% endblocktrans %}</p>
1496+{% endblock %}
1497+
1498
1499=== added file 'identityprovider/templates/ubuntu/registration/confirm_new_account.html'
1500--- identityprovider/templates/ubuntu/registration/confirm_new_account.html 1970-01-01 00:00:00 +0000
1501+++ identityprovider/templates/ubuntu/registration/confirm_new_account.html 2012-12-03 20:22:21 +0000
1502@@ -0,0 +1,35 @@
1503+{% extends "base.html" %}
1504+{% load i18n %}
1505+
1506+{% comment %}
1507+Copyright 2010 Canonical Ltd. This software is licensed under the
1508+GNU Affero General Public License version 3 (see the file LICENSE).
1509+{% endcomment %}
1510+
1511+{% block title %}{% trans "Complete your registration" %}{% endblock %}
1512+
1513+{% block extra_header_top %}
1514+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
1515+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
1516+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
1517+{% endblock %}
1518+
1519+{% block text_title %}
1520+ <h1 class="main">{% blocktrans %}Complete your Ubuntu Single Sign On registration{% endblocktrans %}</h1>
1521+{% endblock %}
1522+
1523+{% block content_id %}auth{% endblock %}
1524+
1525+{% block content %}
1526+<p>{% blocktrans %}The account for {{ email }} is ready to be created.{% endblocktrans %}</p>
1527+
1528+<form id="login-form" class="longfields" method="post" name="loginform">
1529+ {% csrf_token %}
1530+ <p class="actions">
1531+ <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
1532+ {% trans "or" %}
1533+ <a href="/">{% trans "cancel" %}</a>
1534+ </p>
1535+ <div style="clear: both">&nbsp;</div>
1536+</form>
1537+{% endblock %}
1538
1539=== added file 'identityprovider/templates/ubuntu/registration/email_sent.html'
1540--- identityprovider/templates/ubuntu/registration/email_sent.html 1970-01-01 00:00:00 +0000
1541+++ identityprovider/templates/ubuntu/registration/email_sent.html 2012-12-03 20:22:21 +0000
1542@@ -0,0 +1,75 @@
1543+{% extends "base.html" %}
1544+{% load i18n %}
1545+
1546+{% comment %}
1547+Copyright 2010 Canonical Ltd. This software is licensed under the
1548+GNU Affero General Public License version 3 (see the file LICENSE).
1549+{% endcomment %}
1550+
1551+{% block title %}{{ email_heading }}{% endblock %}
1552+
1553+{% block text_title %}
1554+ <h1 class="main">{{ email_heading }}</h1>
1555+{% endblock %}
1556+
1557+{% block content %}
1558+{% if user.is_authenticated %}<div class="email-sent-auth">{% endif %}
1559+
1560+<div id="col1">
1561+ <div>
1562+ <p class="larger">{{ email_reason|safe }}</p>
1563+{% if not readonly %}
1564+ <p class="larger last">
1565+ {% trans "We've sent you a 6 digit confirmation code. To continue, enter that code below." %}
1566+ </p>
1567+{% endif %}
1568+ </div>
1569+
1570+{% if not readonly %}
1571+ <form action="{% if token %}/{{ token }}{% endif %}/+enter_token" method="post" id="email_confirm">
1572+ {% csrf_token %}
1573+ <p>
1574+ <label>{% trans "Confirmation code" %}</label><br />
1575+ <input id="confirmation_code" name="confirmation_code" type="text" class="textType" />
1576+ <input type="hidden" name="email" value="{{ email }}" />
1577+ </p>
1578+ <p><button id="submit" type="submit" class="btn" disabled="true">
1579+ <span><span>{% trans "Continue" %}</span></span>
1580+ </button>
1581+ {% if user.is_authenticated %}{% blocktrans %} or, <a href="/+emails">return to email addresses</a>{% endblocktrans %}{% endif %}
1582+ </p>
1583+ </form>
1584+{% endif %}
1585+</div>
1586+
1587+<div id="col2">
1588+ <h2 class="main">{% trans "Haven&rsquo;t received it?" %}</h2>
1589+ <p>{% blocktrans %}If you don&rsquo;t receive the message within a few minutes, it might be because:{% endblocktrans %}</p>
1590+ <ul>
1591+ <li>{% blocktrans %}Your mail provider uses &ldquo;greylisting&rdquo; to reduce spam. If so, you&rsquo;ll need to wait an hour or two for the message to arrive.{% endblocktrans %}</li>
1592+ <li>{% blocktrans %}Your mail provider mistakenly blocks messages from this site. Try signing up using a service like <a href="http://gmail.com/">Gmail</a> or <a href="http://mail.yahoo.com/">Yahoo Mail</a>.{% endblocktrans %} </li>
1593+ {% if email_notreceived_extra %}
1594+ <li>{{ email_notreceived_extra|safe }}</li>
1595+ {% endif %}
1596+ </ul>
1597+ <p>{% blocktrans %}If neither of those work, <a href='https://forms.canonical.com/sso-support/' title='Contact Login Support' >our service might be having a problem.</a>{% endblocktrans %}
1598+ </p>
1599+</div>
1600+<div style="clear: both"></div>
1601+{% if user.is_authenticated %}</div>{% endif %}
1602+<script type="text/javascript">
1603+ YUI().use('node', function (Y) {
1604+ Y.on('domready', function() {
1605+ Y.one('#confirmation_code').on('keyup', function() {
1606+ var code = Y.one('#confirmation_code').get('value');
1607+ if (code.length === 0) {
1608+ Y.one('#submit').setAttribute('disabled', 'true');
1609+ } else {
1610+ Y.one('#submit').removeAttribute('disabled');
1611+ }
1612+ });
1613+ });
1614+ });
1615+</script>
1616+
1617+{% endblock %}
1618
1619=== added file 'identityprovider/templates/ubuntu/registration/forgot_password.html'
1620--- identityprovider/templates/ubuntu/registration/forgot_password.html 1970-01-01 00:00:00 +0000
1621+++ identityprovider/templates/ubuntu/registration/forgot_password.html 2012-12-03 20:22:21 +0000
1622@@ -0,0 +1,41 @@
1623+{% extends "base.html" %}
1624+{% load i18n %}
1625+
1626+{% comment %}
1627+Copyright 2010 Canonical Ltd. This software is licensed under the
1628+GNU Affero General Public License version 3 (see the file LICENSE).
1629+{% endcomment %}
1630+
1631+{% block title %}{% trans "Reset password" %}{% endblock %}
1632+
1633+{% block text_title %}
1634+ <h1 class="main">{% blocktrans %}Reset your Ubuntu Single Sign On password{% endblocktrans %}</h1>
1635+{% endblock %}
1636+
1637+{% block content_id %}auth{% endblock %}
1638+
1639+{% block content %}
1640+ <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to reset your password.{% endblocktrans %}</p>
1641+
1642+ <form action="+forgot_password" method="post">
1643+ {% csrf_token %}
1644+ <p class="input-row{% if form.email.errors %} haserrors{% endif %}">
1645+ <label for="id_email">{% trans "Email address" %}</label>
1646+ <br />
1647+ {{ form.email }}
1648+ {% if form.email.errors %}
1649+ <span class="error">{{ form.email.errors|first }}</span>
1650+ {% endif %}
1651+ </p>
1652+ <p>
1653+ <span id="captcha">
1654+ {% include "widgets/recaptcha.html" %}
1655+ </span>
1656+ </p>
1657+ <p class="actions">
1658+ <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
1659+ {% trans "or" %}
1660+ <a href=".">{% trans "cancel" %}</a>
1661+ </p>
1662+ </form>
1663+{% endblock %}
1664
1665=== modified file 'identityprovider/templates/ubuntu/registration/login.html'
1666--- identityprovider/templates/ubuntu/registration/login.html 2012-10-09 20:38:27 +0000
1667+++ identityprovider/templates/ubuntu/registration/login.html 2012-12-03 20:22:21 +0000
1668@@ -111,7 +111,7 @@
1669 </p>
1670 {% endif %}
1671 <p class="last">
1672- {{ brand.provides_access }}
1673+ {% blocktrans %}An Ubuntu Single Sign On account is free and gives you access to Ubuntu One, the Ubuntu Shop and many more useful services.{% endblocktrans %}
1674 </p>
1675 {% if not readonly %}
1676 <p>
1677
1678=== modified file 'identityprovider/templates/ubuntu/registration/logout.html'
1679--- identityprovider/templates/ubuntu/registration/logout.html 2010-11-16 11:00:25 +0000
1680+++ identityprovider/templates/ubuntu/registration/logout.html 2012-12-03 20:22:21 +0000
1681@@ -13,7 +13,7 @@
1682 {% endblock %}
1683
1684 {% block content %}
1685- <p>{{ brand.logout }}</p>
1686+ <p>{% blocktrans %}You are now logged out of the Ubuntu Single Sign On (SSO) website. However, you have not been automatically logged out of every website that uses this SSO website.{% endblocktrans %}</p>
1687
1688 {% if return_to_url %}
1689 {% blocktrans with return_to_url as url and return_to_site_name as site_name %}
1690
1691=== added file 'identityprovider/templates/ubuntu/registration/logout_to_confirm.html'
1692--- identityprovider/templates/ubuntu/registration/logout_to_confirm.html 1970-01-01 00:00:00 +0000
1693+++ identityprovider/templates/ubuntu/registration/logout_to_confirm.html 2012-12-03 20:22:21 +0000
1694@@ -0,0 +1,18 @@
1695+{% extends "base.html" %}
1696+{% load i18n %}
1697+
1698+{% comment %}
1699+Copyright 2010 Canonical Ltd. This software is licensed under the
1700+GNU Affero General Public License version 3 (see the file LICENSE).
1701+{% endcomment %}
1702+
1703+{% block title %}{% trans "Can not use confirmation code while logged in" %}{% endblock %}
1704+
1705+{% block text_title %}
1706+ <h1 class="main">{% trans "Can not use confirmation code while logged in" %}</h1>
1707+{% endblock %}
1708+
1709+{% block content %}
1710+ <p>{% blocktrans %}You have attempted to confirm an account while logged in as someone else. We've cancelled your request. Please log out and create your new account again.{% endblocktrans %}</p>
1711+{% endblock %}
1712+
1713
1714=== added file 'identityprovider/templates/ubuntu/registration/new_account.html'
1715--- identityprovider/templates/ubuntu/registration/new_account.html 1970-01-01 00:00:00 +0000
1716+++ identityprovider/templates/ubuntu/registration/new_account.html 2012-12-03 20:22:21 +0000
1717@@ -0,0 +1,74 @@
1718+{% extends "base.html" %}
1719+{% load i18n %}
1720+
1721+{% comment %}
1722+Copyright 2010 Canonical Ltd. This software is licensed under the
1723+GNU Affero General Public License version 3 (see the file LICENSE).
1724+{% endcomment %}
1725+
1726+{% block title %}{% trans "Create account" %}{% endblock %}
1727+
1728+{% block extra_header_top %}
1729+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
1730+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
1731+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
1732+{% endblock %}
1733+
1734+{% block extra_header %}
1735+{% include "widgets/passwords_head_content.html" %}
1736+{% endblock %}
1737+
1738+{% block text_title %}
1739+ {% if rpconfig and rpconfig.logo_url %}
1740+ <div id='rpconfig_logo'>
1741+ <img src='{{ rpconfig.logo_url }}'/>
1742+ </div>
1743+ {% endif %}
1744+ <h1 class="main">{% blocktrans %}Create an Ubuntu Single Sign On account{% endblocktrans %}</h1>
1745+{% endblock %}
1746+
1747+{% block content_id %}auth{% endblock %}
1748+
1749+{% block content %}
1750+ <p>{% blocktrans %}Enter the following information, and we will send you instructions on how to confirm your account.{% endblocktrans %}</p>
1751+
1752+ <form action="+new_account" method="post" name="newaccountform">
1753+ {% csrf_token %}
1754+ <p class="input-row{% if form.displayname.errors %} haserrors{% endif %}">
1755+ <label for="id_displayname">{% trans "Full name" %}</label>
1756+ <br />
1757+ {{ form.displayname }}
1758+ {% if form.displayname.errors %}
1759+ <span class="error">
1760+ {{ form.displayname.errors|first }}
1761+ </span>
1762+ {% endif %}
1763+ </p>
1764+ <p class="input-row{% if form.email.errors %} haserrors{% endif %}">
1765+ <label for="id_email">{% trans "Email address" %}</label>
1766+ <br />
1767+ {{ form.email }}
1768+ {% if form.email.errors %}
1769+ <span class="error">{{ form.email.errors|first }}</span>
1770+ {% endif %}
1771+ </p>
1772+ {% include "widgets/passwords.html" %}
1773+ <p>
1774+ <span id="captcha">
1775+ {% include "widgets/recaptcha.html" %}
1776+ </span>
1777+ </p>
1778+ <p class="actions">
1779+ {# {{workflow}} #}
1780+ {% if old %}
1781+ <input type="hidden" name="old" value="old">
1782+ {% endif %}
1783+ <button type="submit" class="btn" name="continue"><span><span>{% trans "Continue" %}</span></span></button>
1784+ {% trans "or" %}
1785+ <a href=".">{% trans "cancel" %}</a>
1786+ </p>
1787+ </form>
1788+ <script type="text/javascript">
1789+ document.newaccountform.displayname.focus();
1790+ </script>
1791+{% endblock %}
1792
1793=== added file 'identityprovider/templates/ubuntu/registration/old_confirm_new_account.html'
1794--- identityprovider/templates/ubuntu/registration/old_confirm_new_account.html 1970-01-01 00:00:00 +0000
1795+++ identityprovider/templates/ubuntu/registration/old_confirm_new_account.html 2012-12-03 20:22:21 +0000
1796@@ -0,0 +1,84 @@
1797+{% extends "base.html" %}
1798+{% load i18n %}
1799+
1800+{% comment %}
1801+Copyright 2010 Canonical Ltd. This software is licensed under the
1802+GNU Affero General Public License version 3 (see the file LICENSE).
1803+{% endcomment %}
1804+
1805+{% block title %}{% trans "Complete your registration" %}{% endblock %}
1806+
1807+{% block extra_header_top %}
1808+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
1809+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
1810+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
1811+{% endblock %}
1812+
1813+{% block extra_header %}
1814+<script type="text/javascript" src="{{ STATIC_URL }}lazr-js/lazr/lazr-meta.js"></script>
1815+<script type="text/javascript">
1816+ var LAZR_YUI_CONFIG = {
1817+ filter: "min",
1818+ base: "{{ STATIC_URL }}lazr-js/",
1819+ modules: LAZR_MODULES,
1820+ insertBefore: "style-overrides"
1821+ };
1822+ var LP = YUI(LAZR_YUI_CONFIG);
1823+ LP.use('node', 'event', 'lazr.passwordmeter', function(Y){
1824+ var passwordMeter = new Y.PasswordMeter({
1825+ input: '#id_password',
1826+ contentBox: '#password_strength',
1827+ tabIndex: null,
1828+ messages: ['{% trans "Strength: too short" %}',
1829+ '{% trans "Strength: weak" %}',
1830+ '{% trans "Strength: fair" %}',
1831+ '{% trans "Strength: good" %}',
1832+ '{% trans "Strength: strong" %}']
1833+ });
1834+ passwordMeter.render();
1835+ });
1836+</script>
1837+<style id="style-overrides" type="text/css">
1838+div.yui-passwordmeter {
1839+ clear: left;
1840+}
1841+#password_strength {
1842+ font-weight: bold;
1843+}
1844+</style>
1845+{% endblock %}
1846+
1847+{% block text_title %}
1848+ <h1 class="main">{% blocktrans %}Complete your Ubuntu Single Sign On registration{% endblocktrans %}</h1>
1849+{% endblock %}
1850+
1851+{% block content_id %}auth{% endblock %}
1852+
1853+{% block content %}
1854+ <form id="login-form" class="longfields" method="post" name="loginform">
1855+ {% csrf_token %}
1856+ <p class="input-row{% if form.displayname.errors %} haserrors{% endif %}">
1857+ <label for="id_displayname">{% trans "Full name" %}</label>
1858+ <br />
1859+ {{ form.displayname }}
1860+ {% if form.displayname.errors %}
1861+ <span class="error">
1862+ {{ form.displayname.errors|first }}
1863+ </span>
1864+ {% endif %}
1865+ </p>
1866+ {% include "widgets/passwords.html" %}
1867+ <p class="actions">
1868+ <button type="submit" name="continue" class="btn"><span><span>{% trans "Continue" %}</span></span></button>
1869+ {% trans "or" %}
1870+ <a href="{% if token %}/{{ token }}{% endif %}/">
1871+ {% trans "cancel" %}
1872+ </a>
1873+ </p>
1874+ <div style="clear: both">&nbsp;</div>
1875+ </form>
1876+
1877+<script type="text/javascript">
1878+document.loginform.displayname.focus();
1879+</script>
1880+{% endblock %}
1881
1882=== added file 'identityprovider/templates/ubuntu/registration/reset_password.html'
1883--- identityprovider/templates/ubuntu/registration/reset_password.html 1970-01-01 00:00:00 +0000
1884+++ identityprovider/templates/ubuntu/registration/reset_password.html 2012-12-03 20:22:21 +0000
1885@@ -0,0 +1,74 @@
1886+{% extends "base.html" %}
1887+{% load i18n %}
1888+
1889+{% comment %}
1890+Copyright 2010 Canonical Ltd. This software is licensed under the
1891+GNU Affero General Public License version 3 (see the file LICENSE).
1892+{% endcomment %}
1893+
1894+{% block title %}{% trans "Reset password" %}{% endblock %}
1895+
1896+{% block extra_header_top %}
1897+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssreset/reset-min.css"></link>
1898+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssfonts/fonts-min.css"></link>
1899+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lazr-js/cssbase/base-min.css"></link>
1900+{% endblock %}
1901+
1902+{% block extra_header %}
1903+<script type="text/javascript" src="{{ STATIC_URL }}lazr-js/lazr/lazr-meta.js"></script>
1904+<script type="text/javascript">
1905+ var LAZR_YUI_CONFIG = {
1906+ filter: "min",
1907+ base: "{{ STATIC_URL }}lazr-js/",
1908+ modules: LAZR_MODULES,
1909+ insertBefore: "style-overrides"
1910+ };
1911+ var LP = YUI(LAZR_YUI_CONFIG);
1912+ LP.use('node', 'event', 'lazr.passwordmeter', function(Y){
1913+
1914+ var passwordMeter = new Y.PasswordMeter({
1915+ input: '#id_password',
1916+ contentBox: '#password_strength',
1917+ tabIndex: null,
1918+ messages: ['{% trans "Strength: too short" %}',
1919+ '{% trans "Strength: weak" %}',
1920+ '{% trans "Strength: fair" %}',
1921+ '{% trans "Strength: good" %}',
1922+ '{% trans "Strength: strong" %}']
1923+ });
1924+
1925+ passwordMeter.render();
1926+ });
1927+</script>
1928+<style id="style-overrides" type="text/css">
1929+ div.yui-passwordmeter {
1930+ clear: left;
1931+ }
1932+ #password_strength {
1933+ font-weight: bold;
1934+ }
1935+</style>
1936+{% endblock %}
1937+
1938+{% block text_title %}
1939+ <h1 class="main">{% blocktrans %}Reset your Ubuntu Single Sign On password{% endblocktrans %}</h1>
1940+{% endblock %}
1941+
1942+{% block content_id %}auth{% endblock %}
1943+
1944+{% block content %}
1945+ <form id="login-form" class="longfields" method="post">
1946+ {% csrf_token %}
1947+ {% include "widgets/passwords.html" %}
1948+ <p class="actions">
1949+ <button type="submit" name="continue" class="btn">
1950+ <span><span>{% trans "Continue" %}</span></span>
1951+ </button>
1952+ {% trans "or" %}
1953+ <a href="{% if token %}/{{ token }}{% endif %}/">
1954+ {% trans "cancel" %}
1955+ </a>
1956+ </p>
1957+ <div style="clear: both">&nbsp;</div>
1958+ </form>
1959+{% endblock %}
1960
1961=== added file 'identityprovider/templates/ubuntu/registration/token.html'
1962--- identityprovider/templates/ubuntu/registration/token.html 1970-01-01 00:00:00 +0000
1963+++ identityprovider/templates/ubuntu/registration/token.html 2012-12-03 20:22:21 +0000
1964@@ -0,0 +1,15 @@
1965+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1966+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1967+
1968+{% comment %}
1969+Copyright 2010 Canonical Ltd. This software is licensed under the
1970+GNU Affero General Public License version 3 (see the file LICENSE).
1971+{% endcomment %}
1972+
1973+<html>
1974+ <body>
1975+ <form>
1976+ <input type="hidden" name="token" value="{{token}}">
1977+ </form>
1978+ </body>
1979+</html>
1980
1981=== added file 'identityprovider/templates/ubuntu/server_info.html'
1982--- identityprovider/templates/ubuntu/server_info.html 1970-01-01 00:00:00 +0000
1983+++ identityprovider/templates/ubuntu/server_info.html 2012-12-03 20:22:21 +0000
1984@@ -0,0 +1,16 @@
1985+{% extends "base.html" %}
1986+{% load i18n %}
1987+
1988+{% comment %}
1989+Copyright 2010 Canonical Ltd. This software is licensed under the
1990+GNU Affero General Public License version 3 (see the file LICENSE).
1991+{% endcomment %}
1992+
1993+{% block title %}{% trans "This is an OpenID server" %}{% endblock %}
1994+
1995+{% block content %}
1996+ <p>{% blocktrans %}This is the Ubuntu SSO service, built on OpenID. The service enables you to use your Ubuntu SSO account to log into various sites run by Canonical and Ubuntu.{% endblocktrans %}
1997+ </p>
1998+ <p>{% blocktrans %}This page is meant to be called from an OpenID-enabled site and therefore has no user-facing functions.{% endblocktrans %}</p>
1999+{% endblock %}
2000+
2001
2002=== removed file 'identityprovider/tests/unit/test_branding.py'
2003--- identityprovider/tests/unit/test_branding.py 2012-01-10 21:17:33 +0000
2004+++ identityprovider/tests/unit/test_branding.py 1970-01-01 00:00:00 +0000
2005@@ -1,10 +0,0 @@
2006-from django.test import TestCase
2007-
2008-from identityprovider.branding import Ubuntu, Launchpad
2009-
2010-
2011-class BrandingTestCase(TestCase):
2012-
2013- def test_branding_class_has_logout_attribute(self):
2014- self.assertTrue(hasattr(Ubuntu, 'logout'))
2015- self.assertTrue(hasattr(Launchpad, 'logout'))
2016
2017=== modified file 'identityprovider/tests/unit/test_dbfailover.py'
2018--- identityprovider/tests/unit/test_dbfailover.py 2012-10-29 16:06:36 +0000
2019+++ identityprovider/tests/unit/test_dbfailover.py 2012-12-03 20:22:21 +0000
2020@@ -10,7 +10,6 @@
2021 from django.db import connection
2022 from mock import patch
2023
2024-from identityprovider.branding import current_brand
2025 from identityprovider.tests import mockdb
2026 from identityprovider.readonly import ReadOnlyManager
2027
2028@@ -92,7 +91,7 @@
2029 mockdb.fail_next_N_connections(6)
2030 response = self.client.get('/')
2031 apology = (u"Sorry, something just went wrong in %s." %
2032- current_brand.name)
2033+ settings.BRAND_DESCRIPTION)
2034 self.assertContains(response, apology, status_code=500)
2035
2036 def test_files_are_in_the_right_place(self):
2037
2038=== modified file 'identityprovider/tests/unit/test_loginservice.py'
2039--- identityprovider/tests/unit/test_loginservice.py 2012-10-29 16:06:36 +0000
2040+++ identityprovider/tests/unit/test_loginservice.py 2012-12-03 20:22:21 +0000
2041@@ -1,9 +1,9 @@
2042 # Copyright 2010 Canonical Ltd. This software is licensed under the
2043 # GNU Affero General Public License version 3 (see the file LICENSE).
2044
2045+from django.conf import settings
2046 from django.core import mail
2047
2048-from identityprovider.branding import current_brand
2049 from identityprovider.models.authtoken import AuthToken
2050
2051 from identityprovider.tests.utils import SSOBaseTestCase
2052@@ -37,8 +37,9 @@
2053 self.assertIn("Forgotten your password?", response.content)
2054 self.assertIn("nobody@debian.org", response.content)
2055 self.assertEqual(len(mail.outbox), 1)
2056- self.assertEqual(mail.outbox[0].subject,
2057- u"%s: Password reset request" % current_brand.name)
2058+ self.assertEqual(
2059+ mail.outbox[0].subject,
2060+ u"%s: Password reset request" % settings.BRAND_DESCRIPTION)
2061 self.assertTrue('nobody@debian.org' in mail.outbox[0].body)
2062 self.assertTrue('+new_account' in mail.outbox[0].body)
2063
2064@@ -60,7 +61,7 @@
2065 self.assertIn("test@canonical.com", response.content)
2066 self.assertEqual(len(mail.outbox), 1)
2067 self.assertEqual(mail.outbox[0].subject,
2068- u"%s: Warning" % current_brand.name)
2069+ u"%s: Warning" % settings.BRAND_DESCRIPTION)
2070 mail.outbox = []
2071
2072 def test_forgottenform_success(self):
2073@@ -72,8 +73,9 @@
2074 self.assertIn("Forgotten your password?", response.content)
2075 self.assertIn("test@canonical.com", response.content)
2076 self.assertEqual(len(mail.outbox), 1)
2077- self.assertEqual(mail.outbox[0].subject,
2078- u"%s: Forgotten Password" % current_brand.name)
2079+ self.assertEqual(
2080+ mail.outbox[0].subject,
2081+ u"%s: Forgotten Password" % settings.BRAND_DESCRIPTION)
2082 mail.outbox = []
2083
2084 AuthToken.objects.all().delete()
2085
2086=== modified file 'identityprovider/tests/unit/test_models_authtoken.py'
2087--- identityprovider/tests/unit/test_models_authtoken.py 2012-10-29 16:06:36 +0000
2088+++ identityprovider/tests/unit/test_models_authtoken.py 2012-12-03 20:22:21 +0000
2089@@ -10,7 +10,6 @@
2090 patch,
2091 )
2092
2093-from identityprovider.branding import Launchpad
2094 from identityprovider.models.account import Account
2095 from identityprovider.models.authtoken import (
2096 AuthToken,
2097@@ -109,7 +108,7 @@
2098
2099 self.assertTrue(mock_rts.template.endswith('web-newuser.txt'))
2100
2101- @patch('identityprovider.models.authtoken.current_brand', Launchpad())
2102+ @patch('settings.BRAND_DESCRIPTION', 'Launchpad Login Service')
2103 def test_sendNewUserEmail_default_template_launchpad_theme(self):
2104 token = self.factory.make_account_token(self.account,
2105 email='test@canonical.com')
2106
2107=== modified file 'identityprovider/tests/unit/test_static.py'
2108--- identityprovider/tests/unit/test_static.py 2012-10-19 17:52:14 +0000
2109+++ identityprovider/tests/unit/test_static.py 2012-12-03 20:22:21 +0000
2110@@ -3,53 +3,16 @@
2111
2112 from django.conf import settings
2113
2114-import identityprovider.branding
2115-import identityprovider.context_processors
2116-from identityprovider.tests.utils import SSOBaseTestCase
2117+from identityprovider.tests.utils import SSOBaseTestCase, patch_settings
2118
2119
2120 class DummyRequest(object):
2121 META = {}
2122
2123
2124-class BrandingTestCase(SSOBaseTestCase):
2125-
2126- def setUp(self):
2127- self.BRAND = settings.BRAND
2128-
2129- def tearDown(self):
2130- self.set_branding(self.BRAND)
2131-
2132- def set_branding(self, branding):
2133- # reload settings
2134- settings.BRAND = branding
2135-
2136- reload(identityprovider.branding)
2137- reload(identityprovider.context_processors)
2138-
2139- def test_openid(self):
2140- self.set_branding('Ubuntu')
2141- r = self.client.get('/+openid')
2142- self.assertContains(r, "This is the Ubuntu SSO service")
2143- self.set_branding('Launchpad')
2144- r = self.client.get('/+openid')
2145- self.assertContains(r, "This is the Launchpad login service")
2146-
2147-
2148-class StaticPageTestCase(SSOBaseTestCase):
2149-
2150+class UbuntuBrandingTestCase(SSOBaseTestCase):
2151 fixtures = ["test"]
2152-
2153- def setUp(self):
2154- self.brand = settings.BRAND
2155-
2156- def tearDown(self):
2157- self.set_brand(self.brand)
2158-
2159- def set_brand(self, brand):
2160- settings.BRAND = brand
2161- import identityprovider.urls
2162- reload(identityprovider.urls)
2163+ login_message = "This is the Ubuntu SSO service"
2164
2165 def assertAvailable(self, url, text):
2166 r = self.client.get(url)
2167@@ -59,17 +22,55 @@
2168 r = self.client.get(url)
2169 self.assertEqual(r.status_code, 404)
2170
2171- def assertUbuntuOnly(self, url, text):
2172- self.assertAvailable(url, text)
2173- self.set_brand('Launchpad')
2174- self.assertNotAvailable(url)
2175-
2176- def test_faq_page_ubuntu_only(self):
2177- self.assertUbuntuOnly('/+faq', "Frequently asked questions")
2178-
2179- def test_description_page_ubuntu_only(self):
2180- self.assertUbuntuOnly('/+description', "What's this?")
2181-
2182- def test_applications_page_ubuntu_only(self):
2183- self.client.login(username='mark@example.com', password='test')
2184- self.assertUbuntuOnly('/+applications', 'Applications you use')
2185+ def test_openid(self):
2186+ r = self.client.get('/+openid')
2187+ self.assertContains(r, self.login_message)
2188+
2189+ def test_faq_page(self):
2190+ self.assertAvailable('/+faq', "Frequently asked questions")
2191+
2192+ def test_description_page(self):
2193+ self.assertAvailable('/+description', "What's this?")
2194+
2195+ def test_applications_page(self):
2196+ self.client.login(username='mark@example.com', password='test')
2197+ self.assertAvailable('/+applications', 'Applications you use')
2198+
2199+
2200+class LaunchpadBrandingTestCase(UbuntuBrandingTestCase):
2201+ login_message = "This is the Launchpad login service"
2202+
2203+ def setUp(self):
2204+ super(LaunchpadBrandingTestCase, self).setUp()
2205+
2206+ def replaceLast(s, old, new):
2207+ head, sep, tail = s.rpartition(old)
2208+ return head + new + tail if sep else s
2209+ template_dirs = [replaceLast(d, 'ubuntu', 'launchpad')
2210+ for d in settings.TEMPLATE_DIRS]
2211+
2212+ self.brand_patch = patch_settings(
2213+ BRAND='launchpad',
2214+ BRAND_DESCRIPTION='Launchpad Login Service',
2215+ TEMPLATE_DIRS=template_dirs,
2216+ )
2217+ self.brand_patch.start()
2218+ self._reload_urls()
2219+ # order here is important to restore original urls,
2220+ # that depends on the branding cleanup
2221+ self.addCleanup(self._reload_urls)
2222+ self.addCleanup(self.brand_patch.stop)
2223+
2224+ def _reload_urls(self):
2225+ import identityprovider.urls
2226+ reload(identityprovider.urls)
2227+
2228+ def test_faq_page(self):
2229+ self.assertNotAvailable('/+faq')
2230+
2231+ def test_description_page(self):
2232+ self.assertNotAvailable('/+description')
2233+
2234+ def test_applications_page(self):
2235+ self.client.login(username='mark@example.com', password='test')
2236+ self.assertNotAvailable('/+applications')
2237
2238=== modified file 'identityprovider/urls.py'
2239--- identityprovider/urls.py 2012-10-29 16:06:36 +0000
2240+++ identityprovider/urls.py 2012-12-03 20:22:21 +0000
2241@@ -5,7 +5,6 @@
2242 from django.conf.urls.defaults import *
2243 from django.conf import settings
2244
2245-from identityprovider.branding import current_brand
2246 from identityprovider.models import AUTHTOKEN_PATTERN
2247 from identityprovider.views import device_urldata
2248 from identityprovider.views.ui import LoginView, TwoFactorView
2249@@ -106,7 +105,7 @@
2250 name='device-generate'),
2251 )
2252
2253-if settings.BRAND.lower() == 'ubuntu':
2254+if settings.BRAND == 'ubuntu':
2255 urlpatterns += patterns(
2256 'identityprovider.views.account',
2257 (r'^\+applications$', 'applications'),
2258@@ -146,7 +145,7 @@
2259 '',
2260 (r'(favicon.ico)', 'django.views.static.serve',
2261 {'document_root': settings.SSO_MEDIA_ROOT +
2262- current_brand.template_dir}),
2263+ settings.BRAND_TEMPLATE_DIR}),
2264 (r'^i18n/', include('django.conf.urls.i18n')),
2265 )
2266
2267@@ -167,7 +166,7 @@
2268 )
2269
2270 # Keep this at the end, so no important URL will be overridden
2271-if settings.BRAND.lower() == 'ubuntu':
2272+if settings.BRAND == 'ubuntu':
2273 urlpatterns += patterns(
2274 'identityprovider.views.ui',
2275 (r'^\+(?P<page_name>description|faq)$', 'static_page'),
2276
2277=== modified file 'identityprovider/views/errors.py'
2278--- identityprovider/views/errors.py 2012-10-19 17:50:44 +0000
2279+++ identityprovider/views/errors.py 2012-12-03 20:22:21 +0000
2280@@ -3,7 +3,6 @@
2281
2282 from django import http
2283 from django.template import RequestContext, loader
2284-from identityprovider.branding import current_brand
2285
2286
2287 class ErrorPage(object):
2288@@ -17,7 +16,6 @@
2289 oopsid = request.META.get('OOPSID')
2290 atts = {
2291 'request': request,
2292- 'brand': current_brand,
2293 'oopsid': oopsid,
2294 'errormsg': self.errormsg,
2295 }
2296
2297=== modified file 'identityprovider/views/ui.py'
2298--- identityprovider/views/ui.py 2012-11-06 17:28:50 +0000
2299+++ identityprovider/views/ui.py 2012-12-03 20:22:21 +0000
2300@@ -28,7 +28,6 @@
2301 from gargoyle.decorators import switch_is_active
2302
2303 from identityprovider import signed
2304-from identityprovider.branding import current_brand
2305 from identityprovider.decorators import (
2306 check_readonly,
2307 dont_cache,
2308@@ -419,7 +418,7 @@
2309 self.set_orequest(request.session, token, raw_orequest)
2310
2311 template_file = ('%s/registration/logout.html' %
2312- current_brand.template_dir)
2313+ settings.BRAND_TEMPLATE_DIR)
2314 response = render_to_response(template_file,
2315 RequestContext(request, context))
2316
2317@@ -551,10 +550,10 @@
2318 }
2319 message = render_to_string(
2320 '%s/email/impersonate-warning.txt' %
2321- current_brand.template_dir, replacements)
2322- subject = current_brand.name + ": " + _("Warning")
2323+ settings.BRAND_TEMPLATE_DIR, replacements)
2324+ subject = _(settings.BRAND_DESCRIPTION) + ": " + _("Warning")
2325 from_address = format_address(
2326- settings.NOREPLY_FROM_ADDRESS, current_brand.name)
2327+ settings.NOREPLY_FROM_ADDRESS, _(settings.BRAND_DESCRIPTION))
2328 send_mail(subject, message, from_address, [email])
2329
2330
2331@@ -911,11 +910,11 @@
2332 elif send_email == CREATE:
2333 # they've tried to reset with an invalid email, so send them an email
2334 # on how to create an account
2335- brand = unicode(current_brand.name)
2336- subject = u"%s: %s" % (brand, u"Password reset request")
2337+ brand = unicode(_(settings.BRAND_DESCRIPTION))
2338+ subject = u"%s: %s" % (brand, _(u"Password reset request"))
2339 url = urljoin(settings.SSO_ROOT_URL, reverse(new_account))
2340 context = {'email': email, 'signup': url}
2341- tmpl = '%s/email/invitation.txt' % current_brand.template_dir
2342+ tmpl = '%s/email/invitation.txt' % settings.BRAND_TEMPLATE_DIR
2343 body = render_to_string(tmpl, context)
2344 send_mail(subject, body, settings.NOREPLY_FROM_ADDRESS, [email])
2345