Merge lp:~deadlight/canonical-identity-provider/merge-3-user into lp:canonical-identity-provider/release

Proposed by Karl Williams
Status: Merged
Approved by: Daniel Manrique
Approved revision: no longer in the source branch.
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~deadlight/canonical-identity-provider/merge-3-user
Merge into: lp:canonical-identity-provider/release
Prerequisite: lp:~deadlight/canonical-identity-provider/merge-2-registration
Diff against target: 3454 lines (+1207/-1279)
45 files modified
src/identityprovider/tests/utils.py (+7/-28)
src/webui/templates/403-csrf.html (+26/-27)
src/webui/templates/404-no-token.html (+12/-12)
src/webui/templates/404.html (+8/-10)
src/webui/templates/500.html (+28/-22)
src/webui/templates/account/account_deleted.html (+21/-19)
src/webui/templates/account/applications.html (+38/-34)
src/webui/templates/account/auth_log.html (+40/-40)
src/webui/templates/account/confirm_email_invalidation.html (+18/-19)
src/webui/templates/account/confirm_new_email.html (+14/-23)
src/webui/templates/account/deactivated.html (+10/-6)
src/webui/templates/account/delete.html (+44/-53)
src/webui/templates/account/delete_email.html (+14/-19)
src/webui/templates/account/edit.html (+102/-154)
src/webui/templates/account/emails.html (+58/-68)
src/webui/templates/account/invalidate_email.html (+16/-9)
src/webui/templates/account/new_email.html (+23/-21)
src/webui/templates/account/ssh_keys.html (+88/-42)
src/webui/templates/account/suspended.html (+10/-6)
src/webui/templates/account/user_logged_out_no_valid_emails.html (+12/-8)
src/webui/templates/bad_token.html (+16/-10)
src/webui/templates/common/missing_backup_device_warning.html (+5/-5)
src/webui/templates/cookies.html (+5/-5)
src/webui/templates/device/addition-generic.html (+53/-66)
src/webui/templates/device/addition-google.html (+42/-41)
src/webui/templates/device/addition-yubi.html (+11/-13)
src/webui/templates/device/code-list.html (+4/-6)
src/webui/templates/device/device-help.html (+5/-4)
src/webui/templates/device/generate-codes.html (+28/-21)
src/webui/templates/device/list.html (+44/-63)
src/webui/templates/device/print-codes.html (+9/-22)
src/webui/templates/device/removal.html (+14/-19)
src/webui/templates/device/rename.html (+20/-24)
src/webui/templates/device/types.html (+65/-58)
src/webui/templates/limitexceeded.html (+13/-13)
src/webui/templates/readonly.html (+15/-14)
src/webui/templates/select_language.html (+37/-56)
src/webui/templates/ssh_messages/username_unset.html (+2/-2)
src/webui/templates/vanilla/_header.html (+4/-4)
src/webui/templates/vanilla/base.html (+171/-172)
src/webui/templates/versions.html (+1/-1)
src/webui/templates/widgets/other_sites.html (+20/-12)
src/webui/tests/test_views_account.py (+14/-13)
src/webui/tests/test_views_account_ssh.py (+1/-1)
src/webui/tests/test_views_devices.py (+19/-14)
To merge this branch: bzr merge lp:~deadlight/canonical-identity-provider/merge-3-user
Reviewer Review Type Date Requested Status
Maximiliano Bertacchini Approve
Daniel Manrique (community) Approve
Review via email: mp+375403@code.launchpad.net

Commit message

Convert all error and logged-in user pages to Vanilla templates

Description of the change

Converted all error and logged-in user pages to Vanilla templates

QA:
 - Run through the registration and create an account
 - Check adding devices and other account functions

To post a comment you must log in.
Revision history for this message
Karl Williams (deadlight) wrote :

Ok, I've refactored this one too. The first commit is a cleanup so it should be easier to see the actual changes split out in later commits. I've also chunked the changes into logical, grouped commits.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Thanks for the refactoring! as usual. much easier to review the actual changes separately from formatting.

Looks OK to me, I read the code (mostly reformatting and that kind of change) plus I ran this locally to visually check, didn't find any showstoppers (some tweaks might be needed for smaller-sized browser windows) but this is as discussed with Anthony, we can tweak later.

It still merges cleanly on trunk and all tests pass \o/

review: Approve
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

As Daniel said, thanks for the splitting :)

Changes look good codewise, all tests pass and it looks awesome \o/

A couple of UI details:
- Formatting of the "Preferred email address" help popup is broken.
- Error messages on Password/New password/Password confirmation lack any style.
- As discussed earlier, overall UI density could be a bit more compact!

I don't think any of that is a blocker, so I'm +1 to land and try on staging.

Thanks!

review: Approve
Revision history for this message
Daniel Manrique (roadmr) wrote :

For reference, the preferred email address popup text is in identityprovider/forms.py line 296:

            text = _(
                'Only verified email addresses are listed. Click '
                '<a href="%s">Manage email addresses</a> '
                'to add and verify email addresses.') % emails_url

Then this is included in the template in src/webui/templates/account/edit.html line 71. That line could use some formatting: there's a stray <b>, it's missing a space after a period, and it's escaping the help_text for the preferredemail field (maybe needs to be marked safe or something?).

Can be done in subsequent MP :)

https://docs.djangoproject.com/en/1.11/ref/forms/fields/#help-text

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/identityprovider/tests/utils.py'
2--- src/identityprovider/tests/utils.py 2019-10-22 14:03:48 +0000
3+++ src/identityprovider/tests/utils.py 2019-12-17 18:04:01 +0000
4@@ -45,26 +45,9 @@
5 gargoyle.autodiscover()
6
7
8-MISSING_BACKUP_DEVICE = """
9-<div class="message warning" id="missing_backup_device">
10- <p>
11- We strongly recommend having two authentication devices,
12- a <strong>primary</strong> device and a <strong>secondary</strong>
13- or backup device.
14- </br>
15- Having two authentication devices means you can continue to access your
16- account with your secondary device should your primary device be lost or
17- stolen.
18- </br>
19- </br>
20- Click to <a href="{add_device_link}">add a backup device</a>.
21- </p>
22-</div>
23-
24-"""
25-
26-EXHAUSTED_WARNING = """Your printed list of backup codes is nearly used up.
27- Please print a new list for the following devices."""
28+MISSING_BACKUP_DEVICE = """We strongly recommend having two authentication"""
29+
30+EXHAUSTED_WARNING = """Your printed list of backup codes is nearly used up."""
31
32
33 def assert_exhausted_warning(testcase, devices, response):
34@@ -72,14 +55,10 @@
35 dom = PyQuery(response.content)
36 warning = dom.find('#exhausted_warning')
37 testcase.assertEqual(len(warning), 1)
38- elems = warning.find('p')
39- testcase.assertEqual(elems[0].text.strip(), EXHAUSTED_WARNING)
40- testcase.assertEqual(len(devices), len(elems) - 1)
41- for device, elem in zip(devices, elems[1:]):
42- testcase.assertIn(device.name, elem.text)
43- link = elem.find('a')
44- testcase.assertNotEqual(link, None)
45- testcase.assertIn("Generate New Codes", link.find('span').text)
46+ testcase.assertContains(response, EXHAUSTED_WARNING)
47+ for device in devices:
48+ testcase.assertContains(response, device.name)
49+ testcase.assertContains(response, "Generate New Codes")
50
51
52 class SSOBaseTestCaseMixin(object):
53
54=== modified file 'src/webui/templates/403-csrf.html'
55--- src/webui/templates/403-csrf.html 2014-12-09 21:32:43 +0000
56+++ src/webui/templates/403-csrf.html 2019-12-17 18:04:01 +0000
57@@ -1,41 +1,40 @@
58-{% extends "base.html" %}
59+{% extends "vanilla/base.html" %}
60 {% load i18n %}
61
62 {% comment %}
63-Copyright 2010-2013 Canonical Ltd. This software is licensed under the
64+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
65 GNU Affero General Public License version 3 (see the file LICENSE).
66 {% endcomment %}
67
68 {% block title %}
69- {% comment %}Translators: This is the title of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
70- {% trans "Stale request" %}
71+ {% comment %}Translators: This is the title of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
72+ {% trans "Stale request" %}
73 {% endblock %}
74
75 {% block text_title %}
76- {% comment %}Translators: This is the heading of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
77- <h1 class="main">{% trans "Your page was stale." %}</h1>
78+ {% comment %}Translators: This is the heading of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
79+ <h1>{% trans "Your page was stale." %}</h1>
80 {% endblock %}
81
82 {% block content %}
83- <div>
84- <p>
85- {% comment %}Translators: This is the text of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
86- {% blocktrans %}Apologies, the page you came from was a little old. Perhaps you navigated here from a browser window other than the one you used to login. If so, try using the other browser window. Or, try your action again, starting from our home page.{% endblocktrans %}
87- </p>
88-
89- <h3>{% trans "The most common reasons for seeing this page are:" %}</h3>
90- <dl class="u1-list">
91- <dt>{% trans "Cookies have been disabled either globally or selectively." %}</dt>
92- <dd>{% blocktrans %}Ubuntu One requires cookies for delivering the best experience. Please make sure cookies are allowed for Ubuntu One.{% endblocktrans %}</dd>
93-
94- <dt>{% trans "HTTP Referer header is disabled." %}</dt>
95- <dd>{% blocktrans %}Ubuntu One requires the HTTP Referer header to be present in the request. Please make sure this header isn't being blocked by any browser extensions.{% endblocktrans %}</dd>
96- </dl>
97-
98- <p>{% blocktrans %}If neither of these solve the issue, please try accessing Ubuntu One from a completely fresh, unconfigured browser. This will help us better diagnose the problem in case it's still happening. If the issue is solved by using a clean browser session, try to verify your browser settings and extensions.{% endblocktrans %}</p>
99-
100- {% include "static/_contact_support_snippet.html" %}
101-
102- <a class="btn" href="/"><span><span>{% trans "Go to our home page" %}</span></span></a>
103- </div>
104+ <div class="row">
105+ <p>
106+ {% comment %}Translators: This is the text of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
107+ {% blocktrans %}Apologies, the page you came from was a little old. Perhaps you navigated here from a browser window other than the one you used to login. If so, try using the other browser window. Or, try your action again, starting from our home page.{% endblocktrans %}
108+ </p>
109+
110+ <h3>{% trans "The most common reasons for seeing this page are:" %}</h3>
111+ <dl>
112+ <dt>{% trans "Cookies have been disabled either globally or selectively." %}</dt>
113+ <dd>{% blocktrans %}Ubuntu One requires cookies for delivering the best experience. Please make sure cookies are allowed for Ubuntu One.{% endblocktrans %}</dd>
114+ <dt>{% trans "HTTP Referer header is disabled." %}</dt>
115+ <dd>{% blocktrans %}Ubuntu One requires the HTTP Referer header to be present in the request. Please make sure this header isn't being blocked by any browser extensions.{% endblocktrans %}</dd>
116+ </dl>
117+
118+ <p>{% blocktrans %}If neither of these solve the issue, please try accessing Ubuntu One from a completely fresh, unconfigured browser. This will help us better diagnose the problem in case it's still happening. If the issue is solved by using a clean browser session, try to verify your browser settings and extensions.{% endblocktrans %}</p>
119+
120+ {% include "static/_contact_support_snippet.html" %}
121+
122+ <a href="/">{% trans "Go to our home page" %}</a>
123+ </div>
124 {% endblock %}
125
126=== modified file 'src/webui/templates/404-no-token.html'
127--- src/webui/templates/404-no-token.html 2019-05-10 19:47:22 +0000
128+++ src/webui/templates/404-no-token.html 2019-12-17 18:04:01 +0000
129@@ -1,4 +1,4 @@
130-{% extends "base.html" %}
131+{% extends "vanilla/base.html" %}
132 {% load i18n %}
133
134 {% comment %}
135@@ -7,21 +7,21 @@
136 {% endcomment %}
137
138 {% block title %}
139- {% trans "Not found" %}
140+ {% trans "Not found" %}
141 {% endblock %}
142
143 {% block text_title %}
144- <h1 class="main">Invalid address validation link</h1>
145+ <h1>Invalid address validation link</h1>
146 {% endblock %}
147
148 {% block content %}
149- <div>
150- <p>{% blocktrans %}You clicked on an e-mail address validation link from Ubuntu One SSO; however, the information from the link seems to be invalid or stale.{% endblocktrans %}</p>
151- <p>{% blocktrans %}This could be for one of the following reasons:{% endblocktrans %}</p>
152- <ol class="u1-list">
153- <li>{% blocktrans %}The link has already been used. You don't need to validate your address again. {% endblocktrans %}</li>
154- <li>{% blocktrans %}You created your Ubuntu One SSO account while starting a session on another site. You must click the validation link on the same browser where you started your session on the other site.{% endblocktrans %}</li>
155- </ol>
156- <p>{% blocktrans %}You can also go to <a href="{{email_url}}">Your account's e-mail page</a> and click on "Verify" next to the e-mail address you want to verify. This is the best solution if you are unable to click the link on the same browser where you started your session on the other site.{% endblocktrans %}</p>
157- </div>
158+ <div class="row">
159+ <p>{% blocktrans %}You clicked on an e-mail address validation link from Ubuntu One SSO; however, the information from the link seems to be invalid or stale.{% endblocktrans %}</p>
160+ <p>{% blocktrans %}This could be for one of the following reasons:{% endblocktrans %}</p>
161+ <ol class="p-list">
162+ <li class="p-list__item">{% blocktrans %}The link has already been used. You don't need to validate your address again. {% endblocktrans %}</li>
163+ <li class="p-list__item">{% blocktrans %}You created your Ubuntu One SSO account while starting a session on another site. You must click the validation link on the same browser where you started your session on the other site.{% endblocktrans %}</li>
164+ </ol>
165+ <p>{% blocktrans %}You can also go to <a href="{{email_url}}">Your account's e-mail page</a> and click on "Verify" next to the e-mail address you want to verify. This is the best solution if you are unable to click the link on the same browser where you started your session on the other site.{% endblocktrans %}</p>
166+ </div>
167 {% endblock %}
168
169=== modified file 'src/webui/templates/404.html'
170--- src/webui/templates/404.html 2014-12-09 21:32:43 +0000
171+++ src/webui/templates/404.html 2019-12-17 18:04:01 +0000
172@@ -1,24 +1,22 @@
173-{% extends "base.html" %}
174+{% extends "vanilla/base.html" %}
175 {% load i18n %}
176
177 {% comment %}
178-Copyright 2010 Canonical Ltd. This software is licensed under the
179+Copyright 2019 Canonical Ltd. This software is licensed under the
180 GNU Affero General Public License version 3 (see the file LICENSE).
181 {% endcomment %}
182
183 {% block title %}
184- {% trans "Not found" %}
185+ {% trans "Not found" %}
186 {% endblock %}
187
188 {% block text_title %}
189- <h1 class="main">Lost something?</h1>
190+ <h1>Lost something?</h1>
191 {% endblock %}
192
193 {% block content %}
194- <div>
195- <p>{% blocktrans %}There's no page with this address in the Ubuntu One service. Check that you entered the address correctly and try again.{% endblocktrans %}</p>
196- <p>
197- {% blocktrans %}(Error <abbr>ID</abbr>: {{oopsid}}){% endblocktrans %}
198- </p>
199- </div>
200+ <p>{% blocktrans %}There's no page with this address in the Ubuntu One service. Check that you entered the address correctly and try again.{% endblocktrans %}</p>
201+ {% if oopsid %}
202+ <p>{% blocktrans %}(Error <abbr>ID</abbr>: {{oopsid}}){% endblocktrans %}</p>
203+ {% endif %}
204 {% endblock %}
205
206=== modified file 'src/webui/templates/500.html'
207--- src/webui/templates/500.html 2015-09-30 19:30:01 +0000
208+++ src/webui/templates/500.html 2019-12-17 18:04:01 +0000
209@@ -1,36 +1,42 @@
210-{% extends "base.html" %}
211+{% extends "vanilla/base.html" %}
212 {% load i18n %}
213
214 {% comment %}
215-Copyright 2010 Canonical Ltd. This software is licensed under the
216+Copyright 2019 Canonical Ltd. This software is licensed under the
217 GNU Affero General Public License version 3 (see the file LICENSE).
218 {% endcomment %}
219
220 {% block title %}
221- {% trans "Oops!" %}
222+ {% trans "Oops!" %}
223 {% endblock %}
224
225 {% block text_title %}
226- <h1 class="main">Oops!</h1>
227+ <h1>Oops!</h1>
228 {% endblock %}
229
230 {% block content %}
231- <div>
232- <h3>
233- {% blocktrans %}Sorry, something just went wrong in Ubuntu One.{% endblocktrans %}
234- </h3>
235- {% if errormsg %}<p>{{ errormsg }}</p>{% endif %}
236- <p>
237- {% blocktrans %}We&#8217;ve recorded what happened, and we&#8217;ll fix it as soon as possible. Apologies for the inconvenience.{% endblocktrans %}
238- </p>
239- <p>
240- OOPS <abbr>ID</abbr>: {{ oopsid }}
241- </p>
242- {% if request.sentry.id %}
243- <p>Sentry <abbr>ID</abbr>: {{ request.sentry.id }}</p>
244- {% endif %}
245- <pre style="overflow:auto">
246-{{traceback}}
247- </pre>
248- </div>
249+ <div class="row">
250+ <h3>
251+ {% blocktrans %}Sorry, something just went wrong in Ubuntu One.{% endblocktrans %}
252+ </h3>
253+ {% if errormsg %}
254+ <div class="p-notification--negative">
255+ <p class="p-notification__response">
256+ <span class="p-notification__status">Error: </span>{{ errormsg }}
257+ </p>
258+ </div>
259+ {% endif %}
260+ <p>
261+ {% blocktrans %}We&#8217;ve recorded what happened, and we&#8217;ll fix it as soon as possible. Apologies for the inconvenience.{% endblocktrans %}
262+ </p>
263+ <p>
264+ OOPS <abbr>ID</abbr>: {{ oopsid }}
265+ </p>
266+ {% if request.sentry.id %}
267+ <p>Sentry <abbr>ID</abbr>: {{ request.sentry.id }}</p>
268+ {% endif %}
269+ <pre style="overflow:auto">
270+ {{traceback}}
271+ </pre>
272+ </div>
273 {% endblock %}
274
275=== modified file 'src/webui/templates/account/account_deleted.html'
276--- src/webui/templates/account/account_deleted.html 2013-11-05 14:09:37 +0000
277+++ src/webui/templates/account/account_deleted.html 2019-12-17 18:04:01 +0000
278@@ -1,33 +1,35 @@
279-{% extends "base.html" %}
280+{% extends "vanilla/base.html" %}
281 {% load i18n %}
282
283 {% comment %}
284-Copyright 2013 Canonical Ltd. This software is licensed under the
285+Copyright 2013-2019 Canonical Ltd. This software is licensed under the
286 GNU Affero General Public License version 3 (see the file LICENSE).
287 {% endcomment %}
288
289 {% block title %}
290- {% blocktrans %}Account Deleted{% endblocktrans %}
291+ {% blocktrans %}Account Deleted{% endblocktrans %}
292 {% endblock %}
293
294 {% block text_title %}
295- <h1 class="main">{% trans "Account Deleted" %}</h1>
296+ <h1>{% trans "Account Deleted" %}</h1>
297 {% endblock %}
298
299 {% block content %}
300-<p>{% blocktrans %}Your Ubuntu One account has now been deleted.
301-All emails associated with the account have been removed.
302-You can sign up for a new account with any of those emails if you want.
303-{% endblocktrans %}</p>
304-
305-<p>{% blocktrans %}All authentication tokens associated with the account have
306-also been deleted. That means any apps using that account will have to login
307-again with a different account.
308-{% endblocktrans %}</p>
309-
310-<p>{% blocktrans %}The openid identifier associated with the account has
311-been reserved so that it cannot be given out to anyone else. This is so that
312-no-one can impersonate you using openid. If you sign up for a new account
313-you will have a different openid identifier.
314-{% endblocktrans %}</p>
315+ <div class="row">
316+ <div class="col-8">
317+ <p>{% blocktrans %}Your Ubuntu One account has now been deleted.
318+ All emails associated with the account have been removed.
319+ You can sign up for a new account with any of those emails if you want.
320+ {% endblocktrans %}</p>
321+ <p>{% blocktrans %}All authentication tokens associated with the account have
322+ also been deleted. That means any apps using that account will have to login
323+ again with a different account.
324+ {% endblocktrans %}</p>
325+ <p>{% blocktrans %}The openid identifier associated with the account has
326+ been reserved so that it cannot be given out to anyone else. This is so that
327+ no-one can impersonate you using openid. If you sign up for a new account
328+ you will have a different openid identifier.
329+ {% endblocktrans %}</p>
330+ </div>
331+ </div>
332 {% endblock %}
333
334=== modified file 'src/webui/templates/account/applications.html'
335--- src/webui/templates/account/applications.html 2014-12-09 21:41:56 +0000
336+++ src/webui/templates/account/applications.html 2019-12-17 18:04:01 +0000
337@@ -1,4 +1,4 @@
338-{% extends "base.html" %}
339+{% extends "vanilla/base.html" %}
340 {% load i18n %}
341
342 {% comment %}
343@@ -9,42 +9,46 @@
344 {% block title %}{% trans "Applications you use" %}{% endblock %}
345
346 {% block text_title %}
347- <h1 class="u1-h-main">{% trans "Applications you use" %}</h1>
348+ <h1>{% trans "My account" %}</h1>
349 {% endblock %}
350
351 {% block content %}
352-{% if tokens %}
353-<p>
354- {% blocktrans %}You have used the applications shown here to access your account. If you have stopped using one of these and would like to prevent it from being used to access your account, click its "Delete" button below.{% endblocktrans %}
355-</p>
356-
357-<p>
358- {% blocktrans %}You can choose to allow an application to have access again if you like by opening that application and instructing it to access your account. You'll have to provide your username and password before it will be granted access.{% endblocktrans %}
359-</p>
360-
361-<section class="used-applications">
362- <h3>{% trans "Applications you last used" %}</h3>
363- <table class="listing">
364- <tbody>
365- {% for token in tokens %}
366- <tr>
367- <td data-qa-id="application_token">{{ token.name }}</td>
368- <td class="application-date">{{ token.date_created|date:"Y/m/d" }}</td>
369- <td class="actions">
370- <form action="{% url 'applications' %}" method="post">
371- {% csrf_token %}
372- <input type="hidden" name="token_id" value="{{ token.pk }}" />
373- <button type="submit" class="cta btn-sm secondary" name="Delete" data-qa-id="delete_application">
374- <span>{% trans "Delete" %}</span>
375- </button>
376- </form>
377- </td>
378- </tr>
379+ <h2>{% trans "Applications you use" %}</h2>
380+ {% if tokens %}
381+ <p>
382+ {% blocktrans %}You have used the applications shown here to access your account. If you have stopped using one of these and would like to prevent it from being used to access your account, click its "Delete" button below.{% endblocktrans %}
383+ </p>
384+ <p>
385+ {% blocktrans %}You can choose to allow an application to have access again if you like by opening that application and instructing it to access your account. You'll have to provide your username and password before it will be granted access.{% endblocktrans %}
386+ </p>
387+ <h3>{% trans "Applications you last used" %}</h3>
388+ <div style="overflow: scroll">
389+ <table class="p-table" style="min-width: 28em">
390+ <thead>
391+ <tr>
392+ <th style="width: 50%;">Application name</th>
393+ <th style="width: 30%;">Date created</th>
394+ <th style="width: 20%;"></th>
395+ </tr>
396+ </thead>
397+ <tbody>
398+ {% for token in tokens %}
399+ <tr>
400+ <td data-qa-id="application_token">{{ token.name }}</td>
401+ <td>{{ token.date_created|date:"Y/m/d" }}</td>
402+ <td class="u-align--right">
403+ <form action="{% url 'applications' %}" method="post">
404+ {% csrf_token %}
405+ <input type="hidden" name="token_id" value="{{ token.pk }}" />
406+ <button type="submit" class="p-button--negative" name="Delete" data-qa-id="delete_application">{% trans "Delete" %}</button>
407+ </form>
408+ </td>
409+ </tr>
410 {% endfor %}
411- </tbody>
412+ </tbody>
413 </table>
414-</section>
415-{% else %}
416-<p>{% trans "You don't have any applications associated with this account." %}</p>
417-{% endif %}
418+ </div>
419+ {% else %}
420+ <p>{% trans "You don't have any applications associated with this account." %}</p>
421+ {% endif %}
422 {% endblock %}
423
424=== modified file 'src/webui/templates/account/auth_log.html'
425--- src/webui/templates/account/auth_log.html 2016-07-06 02:49:14 +0000
426+++ src/webui/templates/account/auth_log.html 2019-12-17 18:04:01 +0000
427@@ -1,4 +1,4 @@
428-{% extends "base.html" %}
429+{% extends "vanilla/base.html" %}
430 {% load i18n %}
431 {% comment %}
432 Copyright 2015 Canonical Ltd. This software is licensed under the
433@@ -8,46 +8,46 @@
434 {% block title %}{% trans "Account activity" %}{% endblock %}
435
436 {% block text_title %}
437- <h1 class="u1-h-main">{% trans "Account activity" %}</h1>
438+ <h1>{% trans "My account" %}</h1>
439 {% endblock %}
440
441 {% block content %}
442-{% if auth_log %}
443-{% if full_auth_log_length > auth_log|length %}
444-<p>
445- {% blocktrans with accesses=auth_log|length%}The {{ accesses }} most recent accesses made with your account are shown here.{% endblocktrans %}
446-</p>
447-{% else %}
448-<p>
449- {% blocktrans %}Recent accesses made with your account are shown here.{% endblocktrans %}
450-</p>
451-{% endif %}
452-<p>
453- {% blocktrans %}This includes authentication requests made by other sites and devices.{% endblocktrans %}
454-</p>
455-<section class="account-activity">
456- <table class="listing">
457- <thead>
458- <tr>
459- <td class='time-date'>{% trans "Time/date" %}</td>
460- <td class='log-type'>{% trans "Type" %}</td>
461- <td class='ip-address'>{% trans "IP address" %}</td>
462- <td class='user-agent'>{% trans "User Agent/Browser" %}</td>
463- </tr>
464- </thead>
465- <tbody>
466- {% for attempt in auth_log %}
467- <tr>
468- <td class="time-date">{{ attempt.when_created }}</td>
469- <td class="log-type">{{ attempt.log_type_label }}</td>
470- <td class="ip-address">{{ attempt.remote_ip }}</td>
471- <td class="user-agent">{{ attempt.user_agent }}</td>
472- </tr>
473- {% endfor %}
474- </tbody>
475- </table>
476-</section>
477-{% else %}
478-<p>{% trans "Your account has no activity yet." %}</p>
479-{% endif %}
480+ <h2>Account activity</h2>
481+ {% if auth_log %}
482+ {% if full_auth_log_length > auth_log|length %}
483+
484+ <p>
485+ {% blocktrans with accesses=auth_log|length%}The {{ accesses }} most recent accesses made with your account are shown here.{% endblocktrans %}
486+ </p>
487+ {% else %}
488+ <p>
489+ {% blocktrans %}Recent accesses made with your account are shown here.{% endblocktrans %}
490+ </p>
491+ {% endif %}
492+ <p>
493+ {% blocktrans %}This includes authentication requests made by other sites and devices.{% endblocktrans %}
494+ </p>
495+ <table class="p-table">
496+ <thead>
497+ <tr>
498+ <th>{% trans "Time/date" %}</th>
499+ <th>{% trans "Type" %}</th>
500+ <th>{% trans "IP address" %}</th>
501+ <th>{% trans "User Agent/Browser" %}</th>
502+ </tr>
503+ </thead>
504+ <tbody>
505+ {% for attempt in auth_log %}
506+ <tr>
507+ <td class="p-table__item--truncate" title="{{ attempt.when_created }}">{{ attempt.when_created }}</td>
508+ <td>{{ attempt.log_type_label }}</td>
509+ <td>{{ attempt.remote_ip }}</td>
510+ <td class="p-table__item--truncate" title="{{ attempt.user_agent }}">{{ attempt.user_agent }}</td>
511+ </tr>
512+ {% endfor %}
513+ </tbody>
514+ </table>
515+ {% else %}
516+ <p>{% trans "Your account has no activity yet." %}</p>
517+ {% endif %}
518 {% endblock %}
519
520=== modified file 'src/webui/templates/account/confirm_email_invalidation.html'
521--- src/webui/templates/account/confirm_email_invalidation.html 2018-09-07 16:32:46 +0000
522+++ src/webui/templates/account/confirm_email_invalidation.html 2019-12-17 18:04:01 +0000
523@@ -1,32 +1,31 @@
524-{% extends "base.html" %}
525+{% extends "vanilla/base.html" %}
526 {% load i18n %}
527
528 {% comment %}
529-Copyright 2010-2013 Canonical Ltd. This software is licensed under the
530+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
531 GNU Affero General Public License version 3 (see the file LICENSE).
532 {% endcomment %}
533
534 {% block title %}{% trans "Email invalidation" %}{% endblock %}
535
536-{% block text_title %}<h1 class="u1-h-main">{% trans "Email invalidation" %}</h1>{% endblock %}
537+{% block text_title %}<h1>{% trans "Email invalidation" %}</h1>{% endblock %}
538
539 {% block content %}
540-
541-<div class="info">
542- <p>{% blocktrans %}<strong>WARNING:</strong> Invalidating an e-mail address will prevent logging in to Ubuntu One using that address.{% endblocktrans %}</p>
543- <p>{% blocktrans %}If you intended to <em>validate</em> the address instead, please check the confirmation e-mail you received and click on the first URL to confirm the address.{% endblocktrans %}</p>
544- <p>{% blocktrans %}Are you sure you want to <strong>invalidate</strong> the email address {{ email }}?{% endblocktrans %}</p>
545-</div>
546-<div class="actions">
547- <form action="" method="POST">
548- {% csrf_token %}
549- <p>
550- <button type="submit" class="btn cta" name="invalidate" data-qa-id="confirm_email_invalidation">
551- <span>{% trans "Yes, invalidate" %}</span>
552- </button>
553- {% include "common/cancel_link.html" %}
554-</p>
555-</form>
556+<div class="row">
557+ <div class="col-8">
558+ <div class="p-notification--caution">
559+ <p class="p-notification__response">
560+ {% blocktrans %}<span class="p-notification__status">WARNING:</span> Invalidating an e-mail address will prevent logging in to Ubuntu One using that address.{% endblocktrans %}
561+ </p>
562+ </div>
563+ <p>{% blocktrans %}If you intended to <em>validate</em> the address instead, please check the confirmation e-mail you received and click on the first URL to confirm the address.{% endblocktrans %}</p>
564+ <p>{% blocktrans %}Are you sure you want to <strong>invalidate</strong> the email address {{ email }}?{% endblocktrans %}</p>
565+ <form action="" method="POST">
566+ {% csrf_token %}
567+ <button type="submit" class="p-button--negative" name="invalidate" data-qa-id="confirm_email_invalidation">{% trans "Yes, invalidate" %}</button>
568+ {% include "common/cancel_link.html" %}
569+ </form>
570+ </div>
571 </div>
572
573 {% endblock %}
574
575=== modified file 'src/webui/templates/account/confirm_new_email.html'
576--- src/webui/templates/account/confirm_new_email.html 2016-12-02 21:16:07 +0000
577+++ src/webui/templates/account/confirm_new_email.html 2019-12-17 18:04:01 +0000
578@@ -1,8 +1,8 @@
579-{% extends "base.html" %}
580+{% extends "vanilla/base.html" %}
581 {% load i18n %}
582
583 {% comment %}
584-Copyright 2010 Canonical Ltd. This software is licensed under the
585+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
586 GNU Affero General Public License version 3 (see the file LICENSE).
587 {% endcomment %}
588
589@@ -10,37 +10,28 @@
590
591 {% block title %}{% trans "Complete email address validation" %}{% endblock %}
592
593-{% block text_title %}<h1 class="u1-h-main">{% blocktrans %}Validate {{ email }}?{% endblocktrans %}</h1>{% endblock %}
594+{% block text_title %}<h1>{% blocktrans %}Validate {{ email }}?{% endblocktrans %}</h1>{% endblock %}
595
596 {% block content_id %}auth{% endblock %}
597
598 {% block content %}
599-<p>{% blocktrans %}Are you sure you want to confirm and validate this email address?{% endblocktrans %}</p>
600-
601-<div class="actions">
602+<div class="row">
603+ <p>{% blocktrans %}Are you sure you want to confirm and validate this email address?{% endblocktrans %}</p>
604 <form action="" method="post">
605 {% csrf_token %}
606-
607 {% if captcha_required %}
608 <p class="captcha" id="captcha">
609- {% if captcha_error_message %}
610- <span class="error">
611- {{ captcha_error_message }}
612- </span>
613- {% endif %}
614- {% include "widgets/recaptcha-v2.html" %}
615+ {% if captcha_error_message %}
616+ <span class="error">
617+ {{ captcha_error_message }}
618+ </span>
619+ {% endif %}
620+ {% include "widgets/recaptcha-v2.html" %}
621 </p>
622 {% endif %}
623-
624- <p>
625- <input type="hidden" name="post" value="yes" />
626- <button type="submit" name="continue" class="btn cta" data-qa-id="confirm_email_validation">
627- <span>{% trans "Yes, I'm sure" %}</span>
628- </button>
629- <a class="cta secondary" href="{% if token %}/{{ token }}{% endif %}/" data-qa-id="cancel_email_validation">{% trans "Cancel" %}</a>
630- </p>
631+ <input type="hidden" name="post" value="yes" />
632+ <button type="submit" name="continue" class="p-button--positive" data-qa-id="confirm_email_validation">{% trans "Yes, I'm sure" %}</button>
633+ <a class="p-button--base" href="{% if token %}/{{ token }}{% endif %}/" data-qa-id="cancel_email_validation">{% trans "Cancel" %}</a>
634 </form>
635 </div>
636-
637-<br style="clear: both" />
638 {% endblock %}
639
640=== modified file 'src/webui/templates/account/deactivated.html'
641--- src/webui/templates/account/deactivated.html 2014-12-09 21:41:56 +0000
642+++ src/webui/templates/account/deactivated.html 2019-12-17 18:04:01 +0000
643@@ -2,18 +2,22 @@
644 {% load i18n %}
645
646 {% comment %}
647-Copyright 2010 Canonical Ltd. This software is licensed under the
648+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
649 GNU Affero General Public License version 3 (see the file LICENSE).
650 {% endcomment %}
651
652 {% block title %}{% trans "Account deactivated" %}{% endblock %}
653
654-{% block text_title %}<h1 class="u1-h-main">{% trans "Account deactivated" %}</h1>{% endblock %}
655+{% block text_title %}<h1>{% trans "Account deactivated" %}</h1>{% endblock %}
656
657 {% block content %}
658-<div>
659- <p>
660- {% blocktrans %}Your account has been deactivated.{% endblocktrans %}
661- </p>
662+<div class="row">
663+ <div class="col-8">
664+ <div class="p-notification--negative">
665+ <p class="p-notification__response">
666+ {% blocktrans %}Your account has been deactivated.{% endblocktrans %}
667+ </p>
668+ </div>
669+ </div>
670 </div>
671 {% endblock %}
672
673=== modified file 'src/webui/templates/account/delete.html'
674--- src/webui/templates/account/delete.html 2018-12-13 17:22:24 +0000
675+++ src/webui/templates/account/delete.html 2019-12-17 18:04:01 +0000
676@@ -1,71 +1,62 @@
677-{% extends "base.html" %}
678+{% extends "vanilla/base.html" %}
679 {% load i18n %}
680
681 {% comment %}
682-Copyright 2013 Canonical Ltd. This software is licensed under the
683+Copyright 2013-2019 Canonical Ltd. This software is licensed under the
684 GNU Affero General Public License version 3 (see the file LICENSE).
685 {% endcomment %}
686
687 {% block html_extra %}data-qa-id="edit_account"{% endblock %}
688
689 {% block title %}
690- {% blocktrans %}Delete account{% endblocktrans %}
691+ {% blocktrans %}Delete account{% endblocktrans %}
692 {% endblock %}
693
694 {% block text_title %}
695- <h1 class="main">{% trans "Delete account" %}</h1>
696+ <h1>{% trans "My account" %}</h1>
697 {% endblock %}
698
699 {% block content %}
700-
701-<p>{% blocktrans %}Please be aware that deleting your Ubuntu One
702-account means you'll lose access to all your accounts tied to your
703-Ubuntu One login. This means you won't be able to change their
704-status or cancel any services associated.
705-{% endblocktrans %}</p>
706-
707-<h2>Launchpad:</h2>
708-
709-<p>{% blocktrans %}All content published under your Launchpad user will remain
710-public unless you deactivate your launchpad account first.
711-{% endblocktrans %}</p>
712-
713-<h2>{% trans "Other services:" %}</h2>
714-
715-<p>{% blocktrans %}Landscape, Ubuntu wiki sites, Ubuntu Forum and AskUbuntu
716-accounts won't be deleted, but you will lose access to those too. You should
717-contact each team if you want to make sure each of those are eliminated too.
718-{% endblocktrans %}</p>
719-
720-<p>{% blocktrans %}For more information check out:{% endblocktrans %}
721-<a href="https://login.ubuntu.com/+faq#can-i-delete-my-ubuntu-one-account">{% trans "Can I delete my account?" %}</a>.
722-</p>
723-<p>{% blocktrans %}Please take a moment to read through this page and make sure
724-you understand the consequences of deleting your account before you confirm
725-this action.
726-{% endblocktrans %}</p>
727-
728-
729-{% include "widgets/last_auth_sites.html" %}
730-<form action="" method="post" class="confirm-password-deletion">
731- {% csrf_token %}
732-
733- {% if not readonly %}
734- <p>{% trans "Please confirm your account's password before deletion." %}</p>
735- <div class="input-row{% if fields.password.errors or fields.non_field_errors %} haserrors{% endif %} password-input">
736+ <h2>{% trans "Delete account" %}</h2>
737+ <p>{% blocktrans %}Please be aware that deleting your Ubuntu One
738+ account means you'll lose access to all your accounts tied to your
739+ Ubuntu One login. This means you won't be able to change their
740+ status or cancel any services associated.
741+ {% endblocktrans %}</p>
742+ <h3>Launchpad:</h3>
743+ <p>{% blocktrans %}All content published under your Launchpad user will remain
744+ public unless you deactivate your Launchpad account first.
745+ {% endblocktrans %}</p>
746+ <h3>{% trans "Other services:" %}</h3>
747+ <p>{% blocktrans %}Landscape, Ubuntu wiki sites, Ubuntu Forum and AskUbuntu
748+ accounts won't be deleted, but you will lose access to those too. You should
749+ contact each team if you want to make sure each of those are eliminated too.
750+ {% endblocktrans %}</p>
751+ <p>{% blocktrans %}For more information check out:{% endblocktrans %}
752+ <a href="/+faq#can-i-delete-my-ubuntu-one-account">{% trans "Can I delete my account?" %}</a>.
753+ </p>
754+ <p>{% blocktrans %}Please take a moment to read through this page and make sure
755+ you understand the consequences of deleting your account before you confirm
756+ this action.
757+ {% endblocktrans %}</p>
758+
759+
760+ {% include "widgets/last_auth_sites.html" %}
761+ <form action="" method="post" class="row">
762+ <div class="col-8 col-medium-6">
763+ {% csrf_token %}
764+
765+ {% if not readonly %}
766+ <p>{% trans "Please confirm your account's password before deletion." %}</p>
767+ <div class="input-row{% if fields.password.errors or fields.non_field_errors %} haserrors{% endif %} password-input">
768 {{ form }}
769+ </div>
770+ {% endif %}
771+
772+ {% if not readonly %}
773+ <button type="submit" class="p-button--negative">{% trans "Permanently delete account" %}</button>
774+ {% endif %}
775+ <a class="p-button" href="/">{% trans "Cancel" %}</a>
776 </div>
777- {% endif %}
778-
779- <p class="actions">
780- <a class="cta secondary" href="/">{% trans "Cancel" %}</a>
781- {% if not readonly %}
782- {% trans "or" %}
783- <button type="submit" class="btn cta delete-button">
784- <span><span>{% trans "Permanently delete account" %}</span></span>
785- </button>
786- {% endif %}
787- </p>
788-</form>
789-
790+ </form>
791 {% endblock %}
792
793=== modified file 'src/webui/templates/account/delete_email.html'
794--- src/webui/templates/account/delete_email.html 2014-12-09 21:41:56 +0000
795+++ src/webui/templates/account/delete_email.html 2019-12-17 18:04:01 +0000
796@@ -1,35 +1,30 @@
797-{% extends "base.html" %}
798+{% extends "vanilla/base.html" %}
799 {% load i18n %}
800
801 {% comment %}
802-Copyright 2013 Canonical Ltd. This software is licensed under the
803+Copyright 2013-2019 Canonical Ltd. This software is licensed under the
804 GNU Affero General Public License version 3 (see the file LICENSE).
805 {% endcomment %}
806
807 {% block html_extra %}data-qa-id="delete_email"{% endblock %}
808
809 {% block title %}
810- {% trans "Delete unverified email" %}
811+ {% trans "Delete unverified email" %}
812 {% endblock %}
813
814-{% block text_title %}<h1 class="u1-h-main">{% blocktrans %}Delete {{ email }}?{% endblocktrans %}</h1>{% endblock %}
815+{% block text_title %}<h1>{% blocktrans %}Delete {{ email }}?{% endblocktrans %}</h1>{% endblock %}
816
817 {% block content_id %}auth{% endblock %}
818
819 {% block content %}
820- <div class="info">
821- <p>{% blocktrans %}Are you sure you want to delete this email address?{% endblocktrans %}</p>
822- </div>
823- <div class="actions">
824- <form action="" method="POST">
825- {% csrf_token %}
826- <p>
827- <button type="submit" class="btn cta" name="delete" data-qa-id="confirm_delete_email">
828- <span>{% trans "Yes, delete" %}</span>
829- </button>
830- {% include "common/cancel_link.html" %}
831- </p>
832- </form>
833- </div>
834- <br style="clear: both" />
835+ <div class="row">
836+ <div class="col-8">
837+ <p>{% blocktrans %}Are you sure you want to delete this email address?{% endblocktrans %}</p>
838+ <form action="" method="POST">
839+ {% csrf_token %}
840+ <button type="submit" class="p-button--negative" name="delete" data-qa-id="confirm_delete_email">{% trans "Yes, delete" %}</button>
841+ <a href="/" class="p-button--base">Cancel</a>
842+ </form>
843+ </div>
844+ </div>
845 {% endblock %}
846
847=== modified file 'src/webui/templates/account/edit.html'
848--- src/webui/templates/account/edit.html 2018-07-31 15:57:21 +0000
849+++ src/webui/templates/account/edit.html 2019-12-17 18:04:01 +0000
850@@ -1,207 +1,155 @@
851-{% extends "base.html" %}
852+{% extends "vanilla/base.html" %}
853 {% load i18n static url_with_token %}
854
855 {% comment %}
856-Copyright 2010 Canonical Ltd. This software is licensed under the
857+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
858 GNU Affero General Public License version 3 (see the file LICENSE).
859 {% endcomment %}
860
861 {% block html_extra %}data-qa-id="edit_account"{% endblock %}
862
863 {% block title %}
864- {% blocktrans %}Personal details{% endblocktrans %}
865+ {% blocktrans %}Personal details{% endblocktrans %}
866 {% endblock %}
867
868-{% block text_title %}<h1 class="u1-h-main">{% trans "Personal details" %}</h1>{% endblock %}
869+{% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %}
870
871 {% block extra_css %}
872
873- {% if last_authenticated_sites %}
874+ {% if last_authenticated_sites %}
875 <style type="text/css">
876- {% for site in last_authenticated_sites %}
877+ {% for site in last_authenticated_sites %}
878 {% if rpconfig.logo_url %}
879- a[href='{{site.trust_root}}'] {
880+ a[href='{{site.trust_root}}'] {
881 background-image: url('{{ rpconfig.logo_url }}');
882 background-repeat: no-repeat;
883 background-position: 0 0;
884 padding-left: 24px;
885 padding-top: 1px;
886- }
887+ }
888 {% endif %}
889- {% endfor %}
890+ {% endfor %}
891 </style>
892- {% endif %}
893+ {% endif %}
894
895 {% endblock %}
896
897 {% block content %}
898-
899-<div>
900-{% include "common/unverified_email_warning.html" %}
901-{% include "common/missing_backup_device_warning.html" %}
902-{% include "common/printed_codes_nearly_exhausted_warning.html" %}
903-</div>
904-
905-<form action="" method="post" class="edit-account-details" data-qa-id="edit_fieldsets">
906+ {% include "vanilla/common/unverified_email_warning.html" %}
907+ {% include "vanilla/common/missing_backup_device_warning.html" %}
908+ {% include "vanilla/common/printed_codes_nearly_exhausted_warning.html" %}
909+ <h2>Personal details</h2>
910+ <form action="" method="post" class="edit-account-details" data-qa-id="edit_form">
911 {% csrf_token %}
912- <fieldset class="">
913-
914- <div data-qa-id="personal_details"></div>
915-
916- <div class="{% if form.displayname.errors %}haserrors {% endif %}name-input input-row">
917- <label class="formLabel" for="id_displayname">{% trans "Full name:" %}</label>
918- {{ form.displayname }}
919- {% if form.displayname.errors %}
920- <span class="error">
921- {{ form.displayname.errors|first }}
922- </span>
923- {% endif %}
924+ <div data-qa-id="personal_details"></div>
925+
926+ <div class="row">
927+ <div class="col-8">
928+ <div class="p-form-validation{% if form.displayname.errors %} is-error{% endif %}">
929+ <label class="formLabel" for="id_displayname">{% trans "Full name:" %}</label>
930+ {{ form.displayname }}
931+ {% if form.displayname.errors %}
932+ <p class="p-form-validation__message">
933+ <strong>Error:</strong> {{ form.displayname.errors|first }}
934+ </p>
935+ {% endif %}
936 </div>
937
938 {% if form.username %}
939- <div class="{% if form.username.errors %}haserrors {% endif %}username-input input-row">
940- <label class="formLabel" for="id_username">{% trans "Username:" %}</label>
941- {{ form.username }}
942- {% if form.username.errors %}
943- <span class="error">
944- {{ form.username.errors|first }}
945- </span>
946- {% endif %}
947+ <div class="p-form-validation{% if form.username.errors %} is-error{% endif %}">
948+ <label class="formLabel" for="id_username">{% trans "Username:" %}</label>
949+ {{ form.username }}
950+ {% if form.username.errors %}
951+ <p class="p-form-validation__message">
952+ <strong>Error:</strong> {{ form.username.errors|first }}
953+ </p>
954+ {% endif %}
955 </div>
956 {% endif %}
957
958- <div class="{% if form.preferred_email.errors %}haserrors {% endif %}preferred-email-input input-row">
959- <label class="formLabel tooltip" for="id_preferred_email">
960- {% trans "Preferred email address:" %}
961-
962- <span class="description tooltip sprite help question-mark"
963- title="{%spaceless%}
964- {% blocktrans %}This email address is passed on to other sites when requested as part of the login process.{% endblocktrans %}
965- {{ form.preferred_email.help_text }}
966- {% endspaceless %}">
967- ?
968- </span>
969-
970- </label>
971-
972- {% if form.preferred_email %}
973- {% if form.preferred_email.errors %}
974- <span class="error">
975- {{ form.preferred_email.errors|first }}
976- </span>
977- {% endif %}
978- {{ form.preferred_email }}
979- {% else %}
980- {# Manually added, it will be ignored by the django form #}
981- <input type="text" value="{{ unverified_email|default_if_none:'' }}" disabled="true" />
982- {% endif %}
983-
984+ <div class="p-form-validation {{% if form.preferred_email.errors %} is-error{% endif %}">
985+ <label class="formLabel tooltip" for="id_preferred_email">
986+ {% trans "Preferred email address:" %} <span class="p-tooltip--right" aria-describedby="email-tooltip"><i class="p-icon--help"></i><span class="p-tooltip__message" role="tooltip" id="email-tooltip">{%spaceless%}{% blocktrans %}This email address is passed on to other sites <br>when requested as part of the login process.{% endblocktrans %}{{ form.preferred_email.help_text }}{% endspaceless %}</span></span>
987+ </label>
988+
989+ {% if form.preferred_email %}
990+ {% if form.preferred_email.errors %}
991+ <p class="p-form-validation__message">
992+ <strong>Error: </strong>{{ form.preferred_email.errors|first }}
993+ </p>
994+ {% endif %}
995+ {{ form.preferred_email }}
996+ {% else %}
997+ {# Manually added, it will be ignored by the django form #}
998+ <input type="text" value="{{ unverified_email|default_if_none:'' }}" disabled="true" />
999+ {% endif %}
1000 </div>
1001
1002 {% if not embedded %}
1003 <p class="manage-email-adresses"><a href="{% url_with_token 'account-emails' %}" data-qa-id="manage_email_addresses_link">{% trans "Manage email addresses" %}</a></p>
1004 {% endif %}
1005-
1006- {% if not readonly %}
1007+ </div>
1008+ </div>
1009+
1010+ {% if not readonly %}
1011+ <div class="p-strip is-shallow">
1012+ <hr>
1013+ </div>
1014+
1015+ <div class="row">
1016+ <div class="col-8">
1017 {% include "widgets/passwords.html" with edit_account_labels=1 fields=form %}
1018- {% endif %}
1019-
1020- </fieldset>
1021+ </div>
1022+ </div>
1023+ {% endif %}
1024
1025 {% if enable_device_prefs %}
1026- <fieldset class="undecorated boxed device-prefs">
1027- <h4 class="legend" data-qa-id="authentication_devices">{% trans "Authentication devices" %}</h4>
1028- <div class="{% if form.twofactor_required.errors %}haserrors {% endif %}twofactor-input input-row">
1029- {{ form.twofactor_required }}
1030- {% if form.twofactor_required.errors %}
1031- <span class="error">{{ form.twofactor_required.errors|first }}</span>
1032- {% endif %}
1033- </div>
1034- <div class="{% if form.warn_about_backup_device.errors %}haserrors {% endif %}backupdevice-warn-input input-row">
1035- {{ form.warn_about_backup_device }}
1036- <label class="formLabel" for="id_warn_about_backup_device">
1037- {{ form.warn_about_backup_device.label }}
1038- </label>
1039- {% if form.warn_about_backup_device.errors %}
1040- <span class="error">{{ form.warn_about_backup_device.errors|first }}</span>
1041- {% endif %}
1042- </div>
1043- </fieldset>
1044+ <div class="p-strip is-shallow">
1045+ <hr>
1046+ </div>
1047+
1048+ <div class="p-form-validation{% if form.twofactor_required.errors %} is-errors{% endif %}">
1049+ <h4 class="legend" data-qa-id="authentication_devices">{% trans "Authentication devices" %}</h4>
1050+ <input type="radio" name="twofactor_required" value="True" {% if form.twofactor_required.value == True %}checked{% endif %} id="id_twofactor_required_0"><label for="id_twofactor_required_0">Always require an authentication device</label>
1051+ <input type="radio" name="twofactor_required" value="False" id="id_twofactor_required_1" {% if form.twofactor_required.value == False %}checked{% endif %}><label for="id_twofactor_required_1">Require only when logging in to sites that request it</label>
1052+ {% if form.twofactor_required.errors %}
1053+ <p class="p-form-validation__message">
1054+ <strong>Error:</strong> {{ form.twofactor_required.errors|first }}
1055+ </p>
1056+ {% endif %}
1057+ </div>
1058+
1059+ <div class="p-form-validation{% if form.warn_about_backup_device.errors %} is-error{% endif %}">
1060+ {{ form.warn_about_backup_device }}
1061+ <label class="formLabel" for="id_warn_about_backup_device">
1062+ {{ form.warn_about_backup_device.label }}
1063+ </label>
1064+ {% if form.warn_about_backup_device.errors %}
1065+ <p class="p-form-validation__message">
1066+ <strong>Error:</strong> {{ form.warn_about_backup_device.errors|first }}
1067+ </p>
1068+ {% endif %}
1069+ </div>
1070 {% endif %}
1071
1072- <p class="actions">
1073+ <div class="p-strip is-shallow">
1074+ <hr>
1075+ </div>
1076+
1077 {% if not readonly %}
1078- <button type="submit" class="btn cta" name="update" data-qa-id="update_preferences">
1079- <span>{% trans "Save changes" %}</span>
1080- </button>
1081+ <button type="submit" class="p-button--positive" name="update" data-qa-id="update_preferences">{% trans "Save changes" %}</button>
1082+ <a href="/+delete" data-qa-id="delete_account_link" class="p-button--base">{% trans "Permanently delete account" %}</a>
1083 {% endif %}
1084 {% if token %}
1085- {% trans "or" %}
1086- <a id="exit" href="{% if require_username %}{% url 'server-decide' token %}?continue{% else %}.{% endif %}">{% trans "exit without updating" %}</a>
1087+ {% trans "or" %}
1088+ <p><a id="exit" href="{% if require_username %}{% url 'server-decide' token %}?continue{% else %}.{% endif %}">{% trans "exit without updating" %}</a></p>
1089 {% endif %}
1090- </p>
1091-</form>
1092-
1093-<p><a href="/+delete" data-qa-id="delete_account_link">{% trans "Permanently delete account" %}</a></p>
1094-
1095-{% include "widgets/last_auth_sites.html" %}
1096+ </form>
1097+
1098+ {% include "widgets/last_auth_sites.html" %}
1099
1100 {% endblock %}
1101
1102 {% block extra_js %}
1103-
1104-{% include "registration/_password_meter.html" with pwd_selector="#id_password" pwd_confirm_selector="#id_passwordconfirm" %}
1105-
1106-<script type="text/javascript">
1107-
1108- YUI({
1109- groups: {
1110-
1111- u1: {
1112- base: '{% static "identityprovider/js/u1/build/" %}',
1113- combine: {{ combine|lower }},
1114- root: 'identityprovider/js/u1/build/',
1115- modules: {
1116- 'one-widget-tooltip': {
1117- type: 'js',
1118- path: 'one-widget-tooltip/one-widget-tooltip-min.js'
1119- }
1120- }
1121- }
1122- }
1123- }).use('one-widget-tooltip', function(Y) {
1124-
1125- tt = new Y.U1.Widget.Tooltip({
1126- triggerNodes:".tooltip",
1127- delegate: ".tooltip",
1128- shim:false,
1129- hideDelay: 1500,
1130- autoHideDelay: 100000,
1131- zIndex:100,
1132- compass: 'east',
1133- content: '<p class="tooltip-title">{% trans "Preferred email address" %}</p>' +
1134- '<p>{% blocktrans %}This email address is passed on to other sites when requested as part of the login process.{% endblocktrans %}</p>' +
1135- '<p>{{ form.preferred_email.help_text|escapejs }}</p>',
1136- escapeHTML: false
1137- });
1138-
1139- // lighter version
1140- tt.get('srcNode').addClass('tooltip-light');
1141-
1142- // users should be able to enter tooltip to click links
1143- tt.on('mouseover', function () {
1144- this._clearTimers();
1145- }, tt);
1146- tt.on('mouseleave', function () {
1147- this.hide();
1148- }, tt);
1149-
1150- tt.render();
1151-
1152-
1153- });
1154-
1155-</script>
1156-
1157-
1158+ {% include "registration/_password_meter.html" with pwd_selector="#id_password" pwd_confirm_selector="#id_passwordconfirm" %}
1159 {% endblock %}
1160
1161=== modified file 'src/webui/templates/account/emails.html'
1162--- src/webui/templates/account/emails.html 2017-02-26 01:28:59 +0000
1163+++ src/webui/templates/account/emails.html 2019-12-17 18:04:01 +0000
1164@@ -1,34 +1,33 @@
1165-{% extends "base.html" %}
1166+{% extends "vanilla/base.html" %}
1167 {% load i18n url_with_token %}
1168
1169 {% comment %}
1170-Copyright 2010 Canonical Ltd. This software is licensed under the
1171+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
1172 GNU Affero General Public License version 3 (see the file LICENSE).
1173 {% endcomment %}
1174
1175 {% block html_extra %}data-qa-id="account_emails"{% endblock %}
1176
1177 {% block title %}
1178- {% blocktrans %}{{ account_displayname }}'s email addresses{% endblocktrans %}
1179+ {% trans "Your email addresses" %}
1180 {% endblock %}
1181
1182-{% block text_title %}<h1 class="u1-h-main">{% trans "Your email addresses" %}</h1>{% endblock %}
1183+{% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %}
1184
1185 {% block content %}
1186-
1187-<p>
1188-
1189-{% if not verified_emails and not unverified_emails %}
1190- <p>{% blocktrans %}You have no email addresses associated with your account.{% endblocktrans %}</p>
1191-{% endif %}
1192-
1193-{% if verified_emails %}
1194-
1195- <section class="verified-emails">
1196-
1197- <h3>{% trans "Verified" %}</h3>
1198-
1199- <table class="listing hover">
1200+ <h2>{% trans "Your email addresses" %}</h2>
1201+ {% if not verified_emails and not unverified_emails %}
1202+ <p>{% blocktrans %}You have no email addresses associated with your account.{% endblocktrans %}</p>
1203+ {% endif %}
1204+ {% if verified_emails %}
1205+ <section class="p-strip is-shallow {% if unverified_emails %} u-no-padding--bottom{% endif %}">
1206+ <table class="p-table">
1207+ <thead>
1208+ <tr>
1209+ <th>{% trans "Verified" %}</th>
1210+ </tr>
1211+ </thead>
1212+ <tbody>
1213 {% for email in verified_emails %}
1214 <tr>
1215 <td class="email{% if email.is_preferred %} preferred-email{% endif %}">
1216@@ -38,76 +37,67 @@
1217 {% endif %}
1218 </td>
1219 {% if not readonly %}
1220- <td class="actions">
1221- {% if not email.is_preferred and num_emails > 1 %}
1222- <a href="{% url_with_token 'delete_email' email_address=email.email %}" class="btn-sm" data-qa-id="delete_verified_{{ email }}">
1223- <span>{% trans "Delete" %}</span>
1224- </a>
1225+ <td class="u-align-text--right">
1226+ {% if not email.is_preferred and num_emails > 1 %}
1227+ <a href="{% url_with_token 'delete_email' email_address=email.email %}" class="btn-sm" data-qa-id="delete_verified_{{ email }}">{% trans "Delete" %}</a>
1228 {% endif %}
1229 </td>
1230 {% endif %}
1231 </tr>
1232 {% endfor %}
1233+ </tbody>
1234 </table>
1235-
1236 </section>
1237-
1238-{% endif %}
1239-
1240-{% if unverified_emails %}
1241-
1242- <section class="unverified-emails">
1243-
1244- <h3>{% trans "Unverified" %}</h3>
1245-
1246- <table class="listing hover">
1247+ {% endif %}
1248+
1249+ {% if unverified_emails %}
1250+ <section class="p-strip is-shallow">
1251+ <table class="p-table">
1252+ <thead>
1253+ <tr>
1254+ <th>{% trans "unverified" %}</th>
1255+ </tr>
1256+ </thead>
1257+ <tbody>
1258 {% for email in unverified_emails %}
1259 <tr class="unverified-emails">
1260 <td class="email">{{ email }}</td>
1261 {% if not readonly %}
1262- <td class="actions">
1263- <a href="{% url_with_token 'verify_email' email_address=email.email %}" data-qa-id="verify_unverified_{{ email }}" class="verify-email btn-sm"><span>{% trans "Verify" %}</span></a>
1264+ <td class="u-align-text--right">
1265+ <a href="{% url_with_token 'verify_email' email_address=email.email %}" data-qa-id="verify_unverified_{{ email }}"{% trans "Verify" %}</a>
1266 {% if num_emails > 1 %}
1267- <a href="{% url_with_token 'delete_email' email_address=email.email %}" data-qa-id="delete_unverified_{{ email }}" class="btn-sm">
1268- <span>{% trans "Delete" %}</span>
1269- </a>
1270+ <a href="{% url_with_token 'delete_email' email_address=email.email %}" data-qa-id="delete_unverified_{{ email }}">{% trans "Delete" %}</a>
1271 {% endif %}
1272 </td>
1273 {% endif %}
1274 </tr>
1275 {% endfor %}
1276 </table>
1277-
1278 </section>
1279-
1280-{% endif %}
1281-
1282-{% if not readonly %}
1283-
1284- <section class="add-emails">
1285-
1286+ {% endif %}
1287+
1288+ {% if not readonly %}
1289 <h3>{% trans "Add email address" %}</h3>
1290-
1291 <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to verify it.{% endblocktrans %}</p>
1292-
1293- <form action="{% url_with_token 'new_email' %}" method="post">
1294- {% csrf_token %}
1295- <div class="input-row">
1296- {{ form.newemail }}
1297- {% if form.newemail.errors %}
1298- <span class="error">{{ form.newemail.errors|first }}</span>
1299- {% endif %}
1300+ <div class="row">
1301+ <div class="col-6">
1302+ <form action="{% url_with_token 'new_email' %}" method="post" id="add-email">
1303+ {% csrf_token %}
1304+ <div class="p-form-validation{% if form.newemail.errors %} is-error{% endif %}">
1305+ <label for="id_newemail">Email address</label>
1306+ {{ form.newemail }}
1307+ {% if form.newemail.errors %}
1308+ <p class="p-form-validation__message">
1309+ <strong>Error:</strong> {{ form.newemail.errors|first }}
1310+ </p>
1311+ {% endif %}
1312+ </div>
1313+ <p class="actions">
1314+ <button type="submit" class="p-button--positive" name="continue" data-qa-id="add_new_email">{% trans "Add address" %}</button>
1315+ <a class="p-button--neutral" href="/">{% trans "Cancel" %}</a>
1316+ </p>
1317+ </form>
1318 </div>
1319- <p class="actions">
1320- <button type="submit" class="btn cta" name="continue" data-qa-id="add_new_email">
1321- <span>{% trans "Add address" %}</span>
1322- </button>
1323- <a class="cta secondary" href="/">{% trans "Cancel" %}</a>
1324- </p>
1325- </form>
1326-
1327- </section>
1328-
1329-{% endif %}
1330-
1331+ </div>
1332+ {% endif %}
1333 {% endblock %}
1334
1335=== modified file 'src/webui/templates/account/invalidate_email.html'
1336--- src/webui/templates/account/invalidate_email.html 2014-12-09 21:41:56 +0000
1337+++ src/webui/templates/account/invalidate_email.html 2019-12-17 18:04:01 +0000
1338@@ -1,20 +1,27 @@
1339-{% extends "base.html" %}
1340+{% extends "vanilla/base.html" %}
1341 {% load i18n %}
1342
1343 {% comment %}
1344-Copyright 2010-2013 Canonical Ltd. This software is licensed under the
1345+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
1346 GNU Affero General Public License version 3 (see the file LICENSE).
1347 {% endcomment %}
1348
1349 {% block title %}{% trans "Email invalidated" %}{% endblock %}
1350
1351-{% block text_title %}<h1 class="u1-h-main">{% trans "Email invalidated" %}</h1>{% endblock %}
1352+{% block text_title %}<h1>{% trans "Email invalidated" %}</h1>{% endblock %}
1353
1354 {% block content %}
1355-<p>{% blocktrans %}
1356-The email {{ email }} was successfully invalidated in our system.
1357-{% endblocktrans %}</p>
1358-<p>{% blocktrans %}
1359-Thank you for helping us provide a better service!
1360-{% endblocktrans %}</p>
1361+ <div class="row">
1362+ <div class="p-notification" id="notification">
1363+ <p class="p-notification__response">
1364+ {% blocktrans %}
1365+ The email {{ email }} was successfully invalidated in our system.
1366+ {% endblocktrans %}
1367+ </p>
1368+ <button class="p-icon--close" aria-label="Close notification" onclick="closeNotification('notification')">Close</button>
1369+ </div>
1370+ <p>{% blocktrans %}
1371+ Thank you for helping us provide a better service!
1372+ {% endblocktrans %}</p>
1373+ </div>
1374 {% endblock %}
1375
1376=== modified file 'src/webui/templates/account/new_email.html'
1377--- src/webui/templates/account/new_email.html 2014-12-09 21:41:56 +0000
1378+++ src/webui/templates/account/new_email.html 2019-12-17 18:04:01 +0000
1379@@ -1,37 +1,39 @@
1380-{% extends "base.html" %}
1381+{% extends "vanilla/base.html" %}
1382 {% load i18n %}
1383
1384 {% comment %}
1385-Copyright 2010 Canonical Ltd. This software is licensed under the
1386+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
1387 GNU Affero General Public License version 3 (see the file LICENSE).
1388 {% endcomment %}
1389
1390 {% block title %}{% trans "Add an email" %}{% endblock %}
1391
1392-{% block text_title %}<h1 class="u1-h-main">{% trans "Add an email address to your account" %}</h1>{% endblock %}
1393+{% block text_title %}<h1>{% trans "Add an email address to your account" %}</h1>{% endblock %}
1394
1395 {% block content_id %}auth{% endblock %}
1396
1397 {% block content %}
1398+<div class="row">
1399+ <div class="col-8">
1400 <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to confirm your account.{% endblocktrans %}</p>
1401-
1402 <form action="{% url 'new_email' %}" method="post" name="newemailform">
1403- {% csrf_token %}
1404- <p class="input-row{% if form.newemail.errors %} haserrors{% endif %}">
1405- <label for="id_newemail">{% trans "Email address" %}</label>
1406- {{ form.newemail }}
1407- {% if form.newemail.errors %}
1408- <span class="error">{{ form.newemail.errors|first }}</span>
1409- {% endif %}
1410- </p>
1411- <p class="actions">
1412- <button type="submit" class="btn cta" name="continue" data-qa-id="send_instructions_confirm_email">
1413- <span>{% trans "Send instructions" %}</span>
1414- </button>
1415- <a class="cta secondary" href=".">{% trans "Cancel" %}</a>
1416- </p>
1417+ {% csrf_token %}
1418+ <div class="p-form-validation{% if form.newemail.errors %} is-error{% endif %}">
1419+ <label for="id_newemail">{% trans "Email address" %}</label>
1420+ {{ form.newemail }}
1421+ {% if form.newemail.errors %}
1422+ <p class="p-form-validation__message" id="input-error-message-inline" role="alert">
1423+ <strong>Error:</strong> {{ form.newemail.errors|first }}
1424+ </p>
1425+ {% endif %}
1426+ </div>
1427+ <button type="submit" class="p-button--primary" name="continue" data-qa-id="send_instructions_confirm_email">{% trans "Send instructions" %}</button>
1428+ <a class="p-button--base" href="/">{% trans "Cancel" %}</a>
1429 </form>
1430- <script type="text/javascript">
1431- document.newemailform.newemail.focus();
1432- </script>
1433+ </div>
1434+</div>
1435+
1436+<script type="text/javascript">
1437+ document.newemailform.newemail.focus();
1438+</script>
1439 {% endblock %}
1440
1441=== modified file 'src/webui/templates/account/ssh_keys.html'
1442--- src/webui/templates/account/ssh_keys.html 2016-07-13 04:07:52 +0000
1443+++ src/webui/templates/account/ssh_keys.html 2019-12-17 18:04:01 +0000
1444@@ -1,58 +1,104 @@
1445-{% extends "base.html" %}
1446+{% extends "vanilla/base.html" %}
1447 {% load i18n %}
1448 {% comment %}
1449-Copyright 2016 Canonical Ltd. This software is licensed under the
1450+Copyright 2016-2019 Canonical Ltd. This software is licensed under the
1451 GNU Affero General Public License version 3 (see the file LICENSE).
1452 {% endcomment %}
1453
1454 {% block title %}{% trans "SSH keys" %}{% endblock %}
1455
1456 {% block text_title %}
1457- <h1 class="u1-h-main">{% trans "SSH keys" %}</h1>
1458+ <h1>{% trans "My account" %}</h1>
1459 {% endblock %}
1460
1461 {% block content %}
1462-{% if delete_key_form.fields.ssh_keys.choices %}
1463- <section class="delete-ssh-keys">
1464- <form action="" method="POST">
1465- {% csrf_token %}
1466- {{ delete_key_form }}
1467- <input class="cta" type="submit" name="delete_keys" value="{% trans "Delete Selected Keys" %}"/>
1468- </form>
1469+ <section class="p-strip is-shallow u-no-padding--top">
1470+ <h2>{% trans "SSH keys" %}</h2>
1471+ {% if delete_key_form.fields.ssh_keys.choices %}
1472+ <section class="delete-ssh-keys">
1473+ <form action="" method="POST">
1474+ <ul class="p-list--divided">
1475+ {% csrf_token %}
1476+ {% for value, key_info in delete_key_form.fields.ssh_keys.choices %}
1477+ <li class="p-list__item">
1478+ <input id="id_ssh_keys_{{ forloop.counter0 }}" name="ssh_keys" type="checkbox" value="{{ value }}"><label for="id_ssh_keys_{{ forloop.counter0 }}">{{ key_info.label }}</label>
1479+ <aside class="p-accordion" role="tablist" aria-multiselect="true">
1480+ <ul class="p-accordion__list" style="margin-bottom: 0;">
1481+ <li class="p-accordion__group">
1482+ <button type="button" class="p-accordion__tab" id="tab{{ forloop.counter0 }}" role="tab" aria-controls="#tab{{ forloop.counter0 }}-section" aria-expanded="false">{% trans "Key details" %}</button>
1483+ <section class="p-accordion__panel" id="tab{{ forloop.counter0 }}-section" role="tabpanel" aria-hidden="true" aria-labelledby="tab{{ forloop.counter0 }}-section">
1484+ <dl>
1485+ <dt>Type</dt>
1486+ <dd>{{ key_info.type }}</dd>
1487+ <dt>Text</dt>
1488+ <dd><code>{{ key_info.text }}</code></dd>
1489+ </dl>
1490+ </section>
1491+ </li>
1492+ </ul>
1493+ </aside>
1494+ </li>
1495+ {% endfor %}
1496+ </ul>
1497+ <input class="p-button--negative" type="submit" name="delete_keys" value="{% trans "Delete selected keys" %}"/>
1498+ </form>
1499+ </section>
1500+ {% endif %}
1501+ <hr>
1502 </section>
1503-{% endif %}
1504-
1505-<h3>{% trans "Import new SSH key" %}</h3>
1506-<p>{% blocktrans %}
1507- Insert the contents of your public key (usually
1508- <code>~/.ssh/id_dsa.pub</code> or
1509- <code>~/.ssh/id_rsa.pub</code>).</p>
1510-<p>Note: Only SSH v2 keys are supported.
1511- {% endblocktrans %}</p>
1512-
1513-<form id="import_key" action="" method="POST">
1514- {% csrf_token %}
1515- {{ import_key_form }}
1516- <input class="cta" type="submit" name="import_key" value="{% trans "Import SSH key" %}"/>
1517-</form>
1518+ <h3>{% trans "Import new SSH key" %}</h3>
1519+ <p>{% blocktrans %}
1520+ Insert the contents of your public key (usually
1521+ <code>~/.ssh/id_dsa.pub</code> or
1522+ <code>~/.ssh/id_rsa.pub</code>).</p>
1523+ <p>Note: Only SSH v2 keys are supported.
1524+ {% endblocktrans %}</p>
1525+
1526+ <form id="import_key" action="" method="POST">
1527+ {% csrf_token %}
1528+ {{ import_key_form }}
1529+ <input class="cta" type="submit" name="import_key" value="{% trans "Import SSH key" %}"/>
1530+ </form>
1531 {% endblock %}
1532+
1533 {% block extra_js %}
1534-<script>
1535- var pubkey = document.getElementById('id_ssh_key');
1536- var submit = document.querySelector('.cta');
1537- var keytext = document.querySelector('.key-text');
1538- var keytext_els = document.querySelectorAll('.key-text a');
1539-
1540- if (pubkey.disabled) {
1541- submit.disabled = true;
1542- }
1543+ <script>
1544+ /**
1545+ Attaches event listeners for the accordion open and close click events.
1546+ @param {String} accordionContainerSelector The selector of the accordion container.
1547+ */
1548+ function setupAccordionListener(accordionContainerSelector) {
1549+ /**
1550+ Toggles the necessary values on the accordion panels and handles to show or
1551+ hide depending on the supplied values.
1552+ @param {HTMLElement} element The tab that acts as the handles for the
1553+ accordion panes.
1554+ @param {Boolean} show Whether to show or hide the accordion panel.
1555+ */
1556+ const toggle = (element, show) => {
1557+ element.setAttribute('aria-expanded', show);
1558+ document
1559+ .querySelector(element.getAttribute('aria-controls'))
1560+ .setAttribute('aria-hidden', !show);
1561+ }
1562+ // Set up an event listener on the container so that panels can be added
1563+ // and removed and events do not need to be managed separately.
1564+ document
1565+ .querySelector(accordionContainerSelector)
1566+ .addEventListener('click', e => {
1567+ const target = e.target;
1568+ const isTargetOpen = target.getAttribute('aria-expanded') === 'true';
1569+ // Find any open panels within the container and close them.
1570+ if (target.classList.contains('p-accordion__tab')) {
1571+ e.currentTarget
1572+ .querySelectorAll('[aria-expanded=true]')
1573+ .forEach(element => toggle(element, false));
1574+ // Toggle the target.
1575+ toggle(target, !isTargetOpen);
1576+ }
1577+ });
1578+ }
1579
1580- if (keytext) {
1581- for (i = 0; i < keytext_els.length; ++i) {
1582- keytext_els[i].addEventListener('click', function() {
1583- this.classList.toggle('key-text-full');
1584- });
1585- }
1586- }
1587-</script>
1588+ setupAccordionListener('.delete-ssh-keys');
1589+ </script>
1590 {% endblock %}
1591
1592=== modified file 'src/webui/templates/account/suspended.html'
1593--- src/webui/templates/account/suspended.html 2014-12-09 21:41:56 +0000
1594+++ src/webui/templates/account/suspended.html 2019-12-17 18:04:01 +0000
1595@@ -2,7 +2,7 @@
1596 {% load i18n %}
1597
1598 {% comment %}
1599-Copyright 2010 Canonical Ltd. This software is licensed under the
1600+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
1601 GNU Affero General Public License version 3 (see the file LICENSE).
1602 {% endcomment %}
1603
1604@@ -10,12 +10,16 @@
1605
1606 {% block title %}{% trans "Account suspended" %}{% endblock %}
1607
1608-{% block text_title %}<h1 class="u1-h-main">{% trans "Account suspended" %}</h1>{% endblock %}
1609+{% block text_title %}<h1>{% trans "Account suspended" %}</h1>{% endblock %}
1610
1611 {% block content %}
1612-<div>
1613- <p>
1614- {% blocktrans %}Your account has been suspended.{% endblocktrans %}
1615- </p>
1616+<div class="row">
1617+ <div class="col-8">
1618+ <div class="p-notification--negative">
1619+ <p class="p-notification__response">
1620+ {% blocktrans %}Your account has been suspended.{% endblocktrans %}
1621+ </p>
1622+ </div>
1623+ </div>
1624 </div>
1625 {% endblock %}
1626
1627=== modified file 'src/webui/templates/account/user_logged_out_no_valid_emails.html'
1628--- src/webui/templates/account/user_logged_out_no_valid_emails.html 2014-12-09 21:41:56 +0000
1629+++ src/webui/templates/account/user_logged_out_no_valid_emails.html 2019-12-17 18:04:01 +0000
1630@@ -1,21 +1,25 @@
1631-{% extends "base.html" %}
1632+{% extends "vanilla/base.html" %}
1633 {% load i18n %}
1634 {% load static_url %}
1635
1636 {% comment %}
1637-Copyright 2010-2013 Canonical Ltd. This software is licensed under the
1638+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
1639 GNU Affero General Public License version 3 (see the file LICENSE).
1640 {% endcomment %}
1641
1642 {% block title %}{% trans "Your account does not have a valid email address" %}{% endblock %}
1643
1644-{% block text_title %}<h1 class="u1-h-main">{% trans "Your account does not have a valid email address" %}</h1>{% endblock %}
1645+{% block text_title %}<h1>{% trans "Your account does not have a valid email address" %}</h1>{% endblock %}
1646
1647 {% block content %}
1648-<p>{% blocktrans %}
1649-You have no valid email addresses linked to your account, so it was deactivated.
1650-To reactivate the account please contact our support team at:{% endblocktrans %}
1651-<a href="{{ 'support_form'|static_url }}">{{ 'support_form'|static_url }}</a>
1652-</p>
1653+<div class="row">
1654+ <div class="col-8">
1655+ <p>{% blocktrans %}
1656+ You have no valid email addresses linked to your account, so it was deactivated.
1657+ To reactivate the account please contact our support team at:{% endblocktrans %}
1658+ <a href="{{ 'support_form'|static_url }}">{{ 'support_form'|static_url }}</a>
1659+ </p>
1660+ </div>
1661+</div>
1662
1663 {% endblock %}
1664
1665=== modified file 'src/webui/templates/bad_token.html'
1666--- src/webui/templates/bad_token.html 2013-02-27 12:19:30 +0000
1667+++ src/webui/templates/bad_token.html 2019-12-17 18:04:01 +0000
1668@@ -1,24 +1,30 @@
1669-{% extends "base.html" %}
1670+{% extends "vanilla/base.html" %}
1671 {% load i18n %}
1672 {% load static_url %}
1673
1674 {% comment %}
1675-Copyright 2010 Canonical Ltd. This software is licensed under the
1676+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
1677 GNU Affero General Public License version 3 (see the file LICENSE).
1678 {% endcomment %}
1679
1680 {% block title %}{% trans "Unauthorized confirmation code" %}{% endblock %}
1681
1682 {% block text_title %}
1683- <h1 class="main">{% trans "Unauthorized confirmation code" %}</h1>
1684+<h1>{% trans "Unauthorized confirmation code" %}</h1>
1685 {% endblock %}
1686
1687 {% block content %}
1688-<p>{% blocktrans %}You are not authorized to use this confirmation code.
1689-If this URL was sent to you by email, please make sure you open it in the same browser where you requested it.
1690-{% endblocktrans %}</p>
1691-
1692-<p>{% blocktrans %}You can also seek further assistance on:{% endblocktrans %}</p>
1693-
1694-<a href="{{ 'support_form'|static_url }}">{{ "support_form"|static_url }}</a>
1695+ <div class="row">
1696+ <div class="col-8">
1697+ <div class="p-notification--negative">
1698+ <p class="p-notification__response">
1699+ <span class="p-notification__status">Error:</span>{% blocktrans %}You are not authorised to use this confirmation code.
1700+ If this URL was sent to you by email, please make sure you open it in the same browser where you requested it.
1701+ {% endblocktrans %}
1702+ </p>
1703+ </div>
1704+ <p>{% blocktrans %}You can also seek further assistance on:{% endblocktrans %}</p>
1705+ <p><a href="{{ 'support_form'|static_url }}">{{ "support_form"|static_url }}</a></p>
1706+ </div>
1707+ </div>
1708 {% endblock %}
1709
1710=== modified file 'src/webui/templates/common/missing_backup_device_warning.html'
1711--- src/webui/templates/common/missing_backup_device_warning.html 2013-04-17 13:23:35 +0000
1712+++ src/webui/templates/common/missing_backup_device_warning.html 2019-12-17 18:04:01 +0000
1713@@ -2,17 +2,17 @@
1714
1715 {% if need_backup_device_warning %}
1716 {% url 'device-addition' as add_device %}
1717-<div class="message warning" id="missing_backup_device">
1718- <p>
1719+<div id="missing_backup_device" class="p-notification--caution">
1720+ <p class="p-notification__response">
1721+ <span class="p-notification__status">{% blocktrans %}Warning:{% endblocktrans %}</span>
1722 {% blocktrans %}We strongly recommend having two authentication devices,
1723 a <strong>primary</strong> device and a <strong>secondary</strong>
1724 or backup device.
1725- </br>
1726+ <br><br>
1727 Having two authentication devices means you can continue to access your
1728 account with your secondary device should your primary device be lost or
1729 stolen.
1730- </br>
1731- </br>
1732+ <br><br>
1733 Click to <a href="{{ add_device }}">add a backup device</a>.{% endblocktrans %}
1734 </p>
1735 </div>
1736
1737=== modified file 'src/webui/templates/cookies.html'
1738--- src/webui/templates/cookies.html 2012-12-04 18:51:42 +0000
1739+++ src/webui/templates/cookies.html 2019-12-17 18:04:01 +0000
1740@@ -9,13 +9,13 @@
1741 {% block title %}{% trans "Cookies required" %}{% endblock %}
1742
1743 {% block text_title %}
1744- <h1 class="main">{% trans "Cookies required" %}</h1>
1745+ <h1>{% trans "Cookies required" %}</h1>
1746 {% endblock %}
1747
1748 {% block content %}
1749-<div>
1750- <p>
1751- {% blocktrans %}Cookies are required to use this service. Please enable cookies in your browser.{% endblocktrans %}
1752- </p>
1753+<div class="row">
1754+ <p>
1755+ {% blocktrans %}Cookies are required to use this service. Please enable cookies in your browser.{% endblocktrans %}
1756+ </p>
1757 </div>
1758 {% endblock %}
1759
1760=== modified file 'src/webui/templates/device/addition-generic.html'
1761--- src/webui/templates/device/addition-generic.html 2016-12-14 11:00:33 +0000
1762+++ src/webui/templates/device/addition-generic.html 2019-12-17 18:04:01 +0000
1763@@ -1,4 +1,4 @@
1764-{% extends "base.html" %}
1765+{% extends "vanilla/base.html" %}
1766 {% load i18n %}
1767
1768 {% comment %}
1769@@ -8,81 +8,68 @@
1770
1771 {% block html_extra %}data-qa-id="generic_device_addition"{% endblock %}
1772
1773-{% block extra_header %}
1774-<style type="text/css">
1775-p span.key
1776-{
1777- font-family: monospace;
1778- font-size: large;
1779-}
1780-</style>
1781-{% endblock %}
1782-
1783-
1784 {% block title %}
1785 {% blocktrans %}{{ user }}'s devices{% endblocktrans %}
1786 {% endblock %}
1787
1788
1789 {% block text_title %}
1790- <h1 class="main">{% trans "Add device" %}</h1>
1791+ <h1>{% trans "My account" %}</h1>
1792 {% endblock %}
1793
1794 {% block content %}
1795-
1796-<form method="post" action="">
1797- {% csrf_token %}
1798-
1799- <p><label>
1800- {% trans "Name:" %}<br>
1801- {{ form.name }}
1802- {% if form.name.errors %}
1803- <span class="error" id="name-error">{{ form.name.errors|first }}</span>
1804- {% endif %}
1805- </label></p>
1806-
1807-
1808- {% block device_instructions %}
1809- <p>
1810- {% trans "Shared OATH HOTP/TOTP key:" %}<br>
1811- <span class="key">
1812- {{ formatted_key }}
1813- </span>
1814- </p>
1815- <p>{% blocktrans %}Enter the shared OATH HOTP/TOTP key into your device.
1816- You can use both Time and Counter based methods. The system will recognize
1817- the one you've used that will be preserved for future authentications.</p>
1818- {% endblocktrans %}
1819- {% endblock %}
1820-
1821- <br/>
1822- <p>{% blocktrans %}
1823- Now, verify your device is configured correctly. Use your device
1824- <em>once</em> to generate a one-time password and enter it below.
1825+ <h2>{% trans "Add device" %}</h2>
1826+ <form method="post" action="">
1827+ {% csrf_token %}
1828+ <div class="row">
1829+ <div class="p-form-validation is-error col-4">
1830+ <label for="id_name">{% trans "Name" %}</label>
1831+ {{ form.name }}
1832+ {% if form.name.errors %}
1833+ <p class="p-form-validation__message">
1834+ <strong>Error:</strong> {{ form.name.errors|first }}
1835+ </p>
1836+ {% endif %}
1837+ </div>
1838+ </div>
1839+ {% block device_instructions %}
1840+ <p>
1841+ {% trans "Shared OATH HOTP/TOTP key:" %}<br>
1842+ <code>
1843+ {{ formatted_key }}
1844+ </code>
1845+ </p>
1846+ <p>
1847+ {% blocktrans %}Enter the shared OATH HOTP/TOTP key into your device.
1848+ You can use both Time and Counter based methods. The system will recognize
1849+ the one you've used that will be preserved for future authentications.{% endblocktrans %}
1850+ </p>
1851+ {% endblock %}
1852+
1853+ <p>{% blocktrans %}
1854+ Now, verify your device is configured correctly. Use your device
1855+ <em>once</em> to generate a one-time password and enter it below.
1856 {% endblocktrans %}</p>
1857-
1858- <p><label>
1859- {% trans "One-time password:" %}<br>
1860- {{ form.otp }}
1861- {% if form.otp.errors %}
1862- <span class="error" id="otp-error">{{ form.otp.errors|first }}</span>
1863- {% else %}
1864- {% if error %}
1865- <span class="error">{{ error }}</span>
1866- {% endif %}
1867- {% endif %}
1868- </label></p>
1869-
1870- <p>
1871+ <div class="row">
1872+ <div class="p-form-validation is-error col-4">
1873+ <label for="id_otp">{% trans "One-time password:" %}</label>
1874+ {{ form.otp }}
1875+ {% if form.otp.errors %}
1876+ <p class="p-form-validation__message">
1877+ <strong>Error:</strong> {{ form.otp.errors|first }}
1878+ </p>
1879+ {% else %}
1880+ {% if error %}
1881+ <p class="p-form-validation__message">
1882+ <strong>Error:</strong> {{ error }}
1883+ </p>
1884+ {% endif %}
1885+ {% endif %}
1886+ </div>
1887+ </div>
1888 <input type="hidden" name="type" value="{{ type }}">
1889 <input type="hidden" name="hex_key" value="{{ hex_key }}">
1890- <button class="btn" type="submit" data-qa-id="confirm_add_device">
1891- <span><span>{% trans "Add device" %}</span></span>
1892- </button>
1893- {% trans "or" %}
1894- <a data-qa-id="cancel_add_device" href="{{ device_list_path }}">{% trans "cancel" %}</a>
1895- </p>
1896-
1897-</form>
1898-
1899+ <button class="p-button--primary" type="submit" data-qa-id="confirm_add_device">{% trans "Add device" %}</button>
1900+ <a data-qa-id="cancel_add_device" href="{{ device_list_path }}" class="p-button--neutral">{% trans "Cancel" %}</a>
1901+ </form>
1902 {% endblock %}
1903
1904=== modified file 'src/webui/templates/device/addition-google.html'
1905--- src/webui/templates/device/addition-google.html 2016-12-07 11:32:39 +0000
1906+++ src/webui/templates/device/addition-google.html 2019-12-17 18:04:01 +0000
1907@@ -5,49 +5,50 @@
1908
1909 {% load qrcode %}
1910 {% block device_instructions %}
1911-<p>{% blocktrans %}To use your smartphone as an authentication device, please
1912-install "Google Authenticator" on it. Go to
1913-<a href="http://m.google.com/authenticator">http://m.google.com/authenticator</a>
1914-in your phone's browser or search for "Google Authenticator" on your phone's app
1915-store/market.{% endblocktrans %}</p>
1916-
1917-<p><strong>
1918- {% trans "Note: If you flash your phone, you will lose your auth data!" %}
1919- </strong>
1920- {% trans "Be sure you have a backup auth device before flashing your phone." %}
1921-</b>
1922-
1923-<p>{% trans 'In the "Google Authenticator" app, add a new token and scan this barcode.' %}</p>
1924- <img width="250" height="250" class="qrcode" id="id_qrcode" />
1925- <p>{% trans "Or, to set up manually, please enter:" %}</p>
1926- <ul>
1927- <li>{% trans "Type of key" %}:
1928- <select id="id_oath_type", onchange="setQRcodeUri()">
1929- {% for mode, description in oath_modes.items %}
1930- <option value="{{mode}}">{{description}}</option>
1931- {% endfor %}
1932- </select>
1933-
1934- {% block extra_js %}
1935+ <p>{% blocktrans %}To use your smartphone as an authentication device, please
1936+ install "Google Authenticator" on it. Go to
1937+ <a href="http://m.google.com/authenticator">http://m.google.com/authenticator</a>
1938+ in your phone's browser or search for "Google Authenticator" on your phone's app
1939+ store/market.{% endblocktrans %}</p>
1940+
1941+ <p>
1942+ <strong>{% trans "Note: If you flash your phone, you will lose your auth data!" %}</strong>
1943+ {% trans "Be sure you have a backup auth device before flashing your phone." %}
1944+ </p>
1945+
1946+ <p>{% trans 'In the "Google Authenticator" app, add a new token and scan this barcode.' %}</p>
1947+ <img width="250" height="250" class="qrcode" id="id_qrcode" />
1948+ <p>{% trans "Or, to set up manually, please enter:" %}</p>
1949+ <div class="row">
1950+ <ul class="p-list col-4">
1951+ <li class="p-list__item">{% trans "Type of key" %}:
1952+ <select id="id_oath_type", onchange="setQRcodeUri()">
1953+ {% for mode, description in oath_modes.items %}
1954+ <option value="{{mode}}">{{description}}</option>
1955+ {% endfor %}
1956+ </select>
1957+
1958+ {% block extra_js %}
1959 <script id="id_qrcode_script">
1960- function setQRcodeUri() {
1961- var QRCODE_URIS = {
1962- {% for mode in oath_modes %}
1963+ function setQRcodeUri() {
1964+ var QRCODE_URIS = {
1965+ {% for mode in oath_modes %}
1966 {{mode}}: "{% qrcode_url mode ident hex_key %}",
1967- {% endfor %}
1968- };
1969-
1970- var qrcodeImg = document.getElementById('id_qrcode');
1971- var oathSelector = document.getElementById('id_oath_type');
1972- var oathType = oathSelector.options[oathSelector.selectedIndex].value;
1973- qrcodeImg.src = QRCODE_URIS[oathType];
1974- }
1975-
1976- setQRcodeUri();
1977+ {% endfor %}
1978+ };
1979+
1980+ var qrcodeImg = document.getElementById('id_qrcode');
1981+ var oathSelector = document.getElementById('id_oath_type');
1982+ var oathType = oathSelector.options[oathSelector.selectedIndex].value;
1983+ qrcodeImg.src = QRCODE_URIS[oathType];
1984+ }
1985+
1986+ setQRcodeUri();
1987 </script>
1988- {% endblock %}
1989- </li>
1990- <li>{% trans "Account" %}: {{ ident }}</li>
1991- <li>{% trans "Key" %}: {{ hex_key|b32encode_hexstring }}</li>
1992+ {% endblock %}
1993+ </li>
1994+ <li class="p-list__item">{% trans "Account" %}: <code>{{ ident }}</code></li>
1995+ <li class="p-list__item">{% trans "Key" %}: <code>{{ hex_key|b32encode_hexstring }}</code></li>
1996 </ul>
1997+ </div>
1998 {% endblock %}
1999
2000=== modified file 'src/webui/templates/device/addition-yubi.html'
2001--- src/webui/templates/device/addition-yubi.html 2015-06-29 18:11:04 +0000
2002+++ src/webui/templates/device/addition-yubi.html 2019-12-17 18:04:01 +0000
2003@@ -7,17 +7,15 @@
2004 {% block device_instructions %}
2005 <p>
2006 {% trans "Shared OATH/HOTP key:" %}<br>
2007- <span class="key" id="formatted_key">
2008- {{ formatted_key }}
2009- </span>
2010-</p>
2011-<p>
2012- {% blocktrans %}Programming a YubiKey requires you to{% endblocktrans %}
2013- <a href="apt:yubikey-personalization">{% trans "install" %} yubikey-personalization</a>.
2014-</p>
2015-<p>
2016- {% blocktrans %}To program the YubiKey as an authentication device, on
2017- the short press of the YubiKey, execute the following command line:{% endblocktrans %}
2018+ <code id="formatted_key">{{ formatted_key }}</code>
2019+</p>
2020+<p>
2021+ {% blocktrans %}Programming a YubiKey requires you to{% endblocktrans %}
2022+ <a href="apt:yubikey-personalization">{% trans "install" %} yubikey-personalization</a>.
2023+</p>
2024+<p>
2025+ {% blocktrans %}To program the YubiKey as an authentication device, on
2026+ the short press of the YubiKey, execute the following command line:{% endblocktrans %}
2027 </p>
2028 <p>
2029 <code id="short_press">
2030@@ -25,8 +23,8 @@
2031 </code>
2032 </p>
2033 <p>
2034- {% blocktrans %}To program the long press of the YubiKey,
2035- execute the following command line:{% endblocktrans %}
2036+ {% blocktrans %}To program the long press of the YubiKey,
2037+ execute the following command line:{% endblocktrans %}
2038 </p>
2039 <p>
2040 <code id="long_press">
2041
2042=== modified file 'src/webui/templates/device/code-list.html'
2043--- src/webui/templates/device/code-list.html 2016-06-21 15:39:25 +0000
2044+++ src/webui/templates/device/code-list.html 2019-12-17 18:04:01 +0000
2045@@ -1,21 +1,19 @@
2046 {% load i18n %}
2047-<div id="codes" class="yui3-g-r codelist" data-qa-id="codelist">
2048- <ol class="yui3-u-1-5">
2049+<div id="codes" data-qa-id="codelist">
2050+ <ol class="p-list">
2051 {% for code in codes %}
2052- <li>{% spaceless %}
2053+ <li class="p-list__item">{% spaceless %}
2054 {% if forloop.counter0 < counter|default:0 %}
2055 <strike>{{ code }}</strike>
2056 {% else %}
2057 {{ code }}
2058 {% endif %}
2059 {% endspaceless %}</li>
2060- {% if forloop.counter|divisibleby:"5" and not forloop.last %}
2061- {%endif%}
2062 {% endfor %}
2063 </ol>
2064 </div>
2065
2066 <style media="print">
2067-header, .menu, footer, p { display: none; }
2068+header, .p-sidebar, footer, p { display: none; }
2069 #codes ol { list-style:none; margin:0; padding:0 }
2070 </style>
2071
2072=== modified file 'src/webui/templates/device/device-help.html'
2073--- src/webui/templates/device/device-help.html 2016-08-16 08:26:48 +0000
2074+++ src/webui/templates/device/device-help.html 2019-12-17 18:04:01 +0000
2075@@ -1,4 +1,4 @@
2076-{% extends "base.html" %}
2077+{% extends "vanilla/base.html" %}
2078 {% load i18n %}
2079 {% load static_url %}
2080
2081@@ -10,10 +10,11 @@
2082 {% block title %}{% blocktrans %}Authentication device help - Ubuntu One{% endblocktrans %}{% endblock %}
2083
2084 {% block text_title %}
2085- <h1 class="main">{% trans "Authentication device help" %}</h1>
2086+ <h1>{% trans "My account" %}</h1>
2087 {% endblock %}
2088
2089 {% block content %}
2090+ <h3>{% trans "Authentication device help" %}</h3>
2091 <p>
2092 {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %}
2093 If your device is lost or stolen or you are having trouble logging in,
2094@@ -24,7 +25,7 @@
2095 {% endblocktrans %}
2096 </p>
2097
2098- <h2>{% trans "Device lost or stolen?" %}</h2>
2099+ <h3>{% trans "Device lost or stolen?" %}</h3>
2100 <p>
2101 {% blocktrans %}We need to remove the device from your account to prevent
2102 someone using it to gain access to your account. Please contact us
2103@@ -33,7 +34,7 @@
2104 {% endblocktrans %}
2105 </p>
2106
2107- <h2>{% trans "Problems logging in?" %}</h2>
2108+ <h3>{% trans "Problems logging in?" %}</h3>
2109 <p>
2110 {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %}
2111 We can help get a device working again or set you up with some temporary
2112
2113=== modified file 'src/webui/templates/device/generate-codes.html'
2114--- src/webui/templates/device/generate-codes.html 2013-06-12 16:20:01 +0000
2115+++ src/webui/templates/device/generate-codes.html 2019-12-17 18:04:01 +0000
2116@@ -1,8 +1,8 @@
2117-{% extends "base.html" %}
2118+{% extends "vanilla/base.html" %}
2119 {% load i18n %}
2120
2121 {% comment %}
2122-Copyright 2012 Canonical Ltd. This software is licensed under the GNU
2123+Copyright 2012-2019 Canonical Ltd. This software is licensed under the GNU
2124 Affero General Public License version 3 (see the file LICENSE).
2125 {% endcomment %}
2126
2127@@ -14,26 +14,33 @@
2128
2129
2130 {% block text_title %}
2131-<h1 class="main">{% trans "Generate new codes" %}</h1>
2132+<h1>{% trans "Generate new codes" %}</h1>
2133 {% endblock %}
2134
2135 {% block content %}
2136-
2137-<h3>{% blocktrans %}
2138-Confirming the new codes will <strong>invalidate</strong> all the previous codes.<br/>
2139-Please print this new list and <strong>destroy any old lists</strong>.
2140-{% endblocktrans %}</h3>
2141-
2142-{% include 'device/code-list.html' %}
2143-
2144-<form method="post">
2145- {% csrf_token %}
2146- <p>
2147- <button class="btn" type="submit" data-qa-id="confirm_new_codes">
2148- <span><span>{% trans "Confirm new codes" %}</span></span>
2149- </button>
2150- {% trans "or" %}
2151- <a href="{% url 'device-print' device_id %}" data-qa-id="cancel_new_codes">{% trans "cancel" %}</a>
2152- </p>
2153-</form>
2154+<div class="row">
2155+ <div class="col-8">
2156+ <div class="p-notification--warning">
2157+ <p class="p-notification__response">
2158+ {% blocktrans %}
2159+ Confirming the new codes will <strong>invalidate</strong> all the previous codes.<br/>
2160+ Please print this new list and <strong>destroy any old lists</strong>.
2161+ {% endblocktrans %}
2162+ </p>
2163+ </div>
2164+
2165+ <hr>
2166+
2167+ {% include 'device/code-list.html' %}
2168+
2169+ <hr>
2170+
2171+ <form method="post">
2172+ {% csrf_token %}
2173+ <button class="p-button--positive" type="submit" data-qa-id="confirm_new_codes">{% trans "Confirm new codes" %}</button>
2174+ {% trans "or" %}
2175+ <a href="{% url 'device-print' device_id %}" data-qa-id="cancel_new_codes">{% trans "cancel" %}</a>
2176+ </form>
2177+ </div>
2178+</div>
2179 {% endblock %}
2180
2181=== modified file 'src/webui/templates/device/list.html'
2182--- src/webui/templates/device/list.html 2016-07-06 02:49:14 +0000
2183+++ src/webui/templates/device/list.html 2019-12-17 18:04:01 +0000
2184@@ -1,80 +1,61 @@
2185-{% extends "base.html" %}
2186+{% extends "vanilla/base.html" %}
2187 {% load i18n %}
2188 {% load static_url %}
2189
2190 {% comment %}
2191-Copyright 2012 Canonical Ltd. This software is licensed under the GNU
2192+Copyright 2012-2019 Canonical Ltd. This software is licensed under the GNU
2193 Affero General Public License version 3 (see the file LICENSE).
2194 {% endcomment %}
2195
2196 {% block html_extra %}data-qa-id="device_list"{% endblock %}
2197
2198-{% block extra_header %}
2199-<style type="text/css">
2200-table#device-list td.command
2201-{
2202- width: 0;
2203-}
2204-</style>
2205-{% endblock %}
2206-
2207-
2208 {% block title %}
2209 {% blocktrans %}{{ user }}'s devices{% endblocktrans %}
2210 {% endblock %}
2211
2212
2213-{% block text_title %}<h1 class="u1-h-main">{% trans "Authentication devices" %}</h1>{% endblock %}
2214+{% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %}
2215
2216 {% block content %}
2217-
2218-{% include "common/missing_backup_device_warning.html" %}
2219-{% include "common/printed_codes_nearly_exhausted_warning.html" %}
2220-
2221-<div id="auth-devices">
2222- {% if devices %}
2223-
2224- <section class="devices-you-added">
2225-
2226- <h3>{% trans "Authentication devices you've added" %}</h3>
2227-
2228- <table id="device-list" data-qa-id="device_list">
2229- <tbody>
2230- {% for device in devices %}
2231- <tr>
2232- <td class="name" data-qa-id="device_name">{{ device.name }}</td>
2233- <td class="actions">
2234- <a class="btn-sm" href="{% url 'device-rename' device.id %}" data-qa-id="rename_device">
2235- <span>{% trans "Rename" %}</span>
2236- </a>
2237- <a class="btn-sm" href="{% url 'device-removal' device.id %}" data-qa-id="delete_device">
2238- <span>{% trans "Delete" %}</span>
2239- </a>
2240- {% if device.device_type == 'paper' %}
2241- <a class="btn-sm" href="{% url 'device-print' device.id %}" data-qa-id="print_device">
2242- <span>{% trans "View Codes" %}</span>
2243- </a>
2244- {% endif %}
2245- </td>
2246- </tr>
2247- {% endfor %}
2248- </tbody>
2249- </table>
2250- </section>
2251-
2252- {% else %}
2253- <p>{% trans "You don't have any authentication devices associated with this account." %}</p>
2254- {% endif %}
2255-
2256- <p><a data-qa-id="add_new_device" href="{{ device_addition_path }}">
2257- {% trans "Add a new authentication device" %}
2258- </a></p>
2259-
2260- <p><a href="{% url 'device-help' %}">{% trans "Report a lost or stolen device" %}</a></p>
2261-
2262- <p>{% blocktrans with "twofactor_faq"|static_url as 2FFAQ %}
2263- <a href="{{ 2FFAQ }}">2-Factor Auth FAQ</a>
2264- {% endblocktrans %}</p>
2265-</div>
2266-
2267+ {% include "vanilla/common/missing_backup_device_warning.html" %}
2268+ {% include "vanilla/common/printed_codes_nearly_exhausted_warning.html" %}
2269+ <div id="auth-devices">
2270+ <h2>{% trans "Authentication devices" %}</h2>
2271+ {% if devices %}
2272+ <h3 class="p-heading--four">{% trans "Authentication devices you've added" %}</h3>
2273+ <div class="p-strip is-shallow">
2274+ <table id="device-list" data-qa-id="device_list" class="p-table--bordered">
2275+ <tbody>
2276+ {% for device in devices %}
2277+ <tr>
2278+ <td class="name" data-qa-id="device_name">{{ device.name }}</td>
2279+ <td class="u-align-text--right">
2280+ <ul class="p-inline-list u-no-margin--bottom">
2281+ <li class="p-inline-list__item"><a href="{% url 'device-rename' device.id %}" data-qa-id="rename_device">{% trans "Rename" %}</a></li>
2282+ <li class="p-inline-list__item"><a href="{% url 'device-removal' device.id %}" data-qa-id="delete_device">{% trans "Delete" %}</a></li>
2283+ {% if device.device_type == 'paper' %}
2284+ <li class="p-inline-list__item"><a href="{% url 'device-print' device.id %}" data-qa-id="print_device">{% trans "View Codes" %}</a></li>
2285+ {% endif %}
2286+ </ul>
2287+ </td>
2288+ </tr>
2289+ {% endfor %}
2290+ </tbody>
2291+ </table>
2292+ </div>
2293+
2294+ {% else %}
2295+ <p>{% trans "You don't have any authentication devices associated with this account." %}</p>
2296+ {% endif %}
2297+
2298+ <p><a data-qa-id="add_new_device" href="{{ device_addition_path }}">
2299+ {% trans "Add a new authentication device" %}
2300+ </a></p>
2301+
2302+ <p><a href="{% url 'device-help' %}">{% trans "Report a lost or stolen device" %}</a></p>
2303+
2304+ <p>{% blocktrans with "twofactor_faq"|static_url as 2FFAQ %}
2305+ <a href="{{ 2FFAQ }}">2-Factor Auth FAQ</a>
2306+ {% endblocktrans %}</p>
2307+ </div>
2308 {% endblock %}
2309
2310=== modified file 'src/webui/templates/device/print-codes.html'
2311--- src/webui/templates/device/print-codes.html 2017-04-19 15:36:34 +0000
2312+++ src/webui/templates/device/print-codes.html 2019-12-17 18:04:01 +0000
2313@@ -1,4 +1,4 @@
2314-{% extends "base.html" %}
2315+{% extends "vanilla/base.html" %}
2316 {% load i18n url_with_token %}
2317
2318 {% comment %}
2319@@ -13,32 +13,19 @@
2320 {% endblock %}
2321
2322
2323-{% block text_title %}<h1 class="u1-h-main">{% trans "Printable backup codes" %}</h1>{% endblock %}
2324+{% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %}
2325
2326 {% block content %}
2327-
2328-<p>{% trans "Print this list of backup codes and keep them safe." %}</p>
2329-
2330-<p class="print-new-codes">
2331-
2332-</p>
2333-
2334-
2335-{% include 'device/code-list.html' %}
2336-
2337-<p>
2338- <button class="btn cta" id="printbtn" onclick="window.print()" data-qa-id="print_codes">
2339- <span>{% trans "Print Codes" %}</span>
2340- </button>
2341+ <h2>{% trans "Printable backup codes" %}</h2>
2342+ <p>{% trans "Print this list of backup codes and keep them safe." %}</p>
2343+ {% include 'device/code-list.html' %}
2344+ <button class="p-button--positive" id="printbtn" onclick="window.print()" data-qa-id="print_codes">{% trans "Print Codes" %}</button>
2345 {% if token and not needs_renewal %}
2346- <a class="cta secondary" href="{% url_with_token 'server-decide' %}" data-qa-id="continue_to_rp">{% trans "Continue" %}</a>
2347+ <a class="p-button--neutral" href="{% url_with_token 'server-decide' %}" data-qa-id="continue_to_rp">{% trans "Continue" %}</a>
2348 {% else %}
2349- <a class="cta secondary" href="{% url 'device-list' %}" data-qa-id="cancel_print_codes">{% trans "Go back" %}</a>
2350+ <a class="p-button--neutral" href="{% url 'device-list' %}" data-qa-id="cancel_print_codes">{% trans "Go back" %}</a>
2351 {% endif %}
2352 {% if generation_enabled %}
2353- <a class="btn cta secondary print-new-codes" href="{% url_with_token 'device-generate' device_id=device_id %}" data-qa-id="generate_codes">
2354- <span>{% trans "Generate new codes" %}</span>
2355- </a>
2356+ <a class="p-button--base" href="{% url_with_token 'device-generate' device_id=device_id %}" data-qa-id="generate_codes">{% trans "Generate new codes" %}</a>
2357 {% endif %}
2358-</p>
2359 {% endblock %}
2360
2361=== modified file 'src/webui/templates/device/removal.html'
2362--- src/webui/templates/device/removal.html 2014-12-09 21:41:56 +0000
2363+++ src/webui/templates/device/removal.html 2019-12-17 18:04:01 +0000
2364@@ -1,8 +1,8 @@
2365-{% extends "base.html" %}
2366+{% extends "vanilla/base.html" %}
2367 {% load i18n %}
2368
2369 {% comment %}
2370-Copyright 2012 Canonical Ltd. This software is licensed under the GNU
2371+Copyright 2012-2019 Canonical Ltd. This software is licensed under the GNU
2372 Affero General Public License version 3 (see the file LICENSE).
2373 {% endcomment %}
2374
2375@@ -13,23 +13,18 @@
2376 {% endblock %}
2377
2378
2379-{% block text_title %}<h1 class="u1-h-main">{% trans "Delete device?" %}</h1>{% endblock %}
2380+{% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %}
2381
2382 {% block content %}
2383-
2384-<p>{% blocktrans %}Are you sure that you want to delete the following
2385-authentication device?{% endblocktrans %}</p>
2386-
2387-<p class="device-name" data-qa-id="device_removal_device_name">{{ name }}</p>
2388-
2389-<form method="post" action="">
2390- {% csrf_token %}
2391- <p>
2392- <button class="btn cta" type="submit" data-qa-id="delete_this_device">
2393- <span>{% trans "Delete this device" %}</span>
2394- </button>
2395- <a class="cta secondary" data-qa-id="cancel_deleting_this_device" href="{{ device_list_path }}">{% trans "Cancel" %}</a>
2396- </p>
2397-</form>
2398-
2399+ <h2>{% trans "Delete device?" %}</h2>
2400+ <p>{% blocktrans %}Are you sure that you want to delete the following
2401+ authentication device?{% endblocktrans %}</p>
2402+
2403+ <p class="device-name" data-qa-id="device_removal_device_name">{{ name }}</p>
2404+
2405+ <form method="post" action="">
2406+ {% csrf_token %}
2407+ <button class="p-button--negative" type="submit" data-qa-id="delete_this_device">{% trans "Delete this device" %}</button>
2408+ <a class="p-button--neutral" data-qa-id="cancel_deleting_this_device" href="{{ device_list_path }}">{% trans "Cancel" %}</a>
2409+ </form>
2410 {% endblock %}
2411
2412=== modified file 'src/webui/templates/device/rename.html'
2413--- src/webui/templates/device/rename.html 2014-12-09 21:41:56 +0000
2414+++ src/webui/templates/device/rename.html 2019-12-17 18:04:01 +0000
2415@@ -1,8 +1,8 @@
2416-{% extends "base.html" %}
2417+{% extends "vanilla/base.html" %}
2418 {% load i18n %}
2419
2420 {% comment %}
2421-Copyright 2012 Canonical Ltd. This software is licensed under the GNU
2422+Copyright 2012-2019 Canonical Ltd. This software is licensed under the GNU
2423 Affero General Public License version 3 (see the file LICENSE).
2424 {% endcomment %}
2425
2426@@ -13,28 +13,24 @@
2427 {% endblock %}
2428
2429
2430-{% block text_title %}<h1 class="u1-h-main">{% trans "Rename device" %}</h1>{% endblock %}
2431+{% block text_title %}<h1 class="u1-h-main">{% trans "My account" %}</h1>{% endblock %}
2432
2433 {% block content %}
2434-
2435-<form method="post" action="">
2436- {% csrf_token %}
2437-
2438- <p><label for="id_name">
2439- {% trans "Name:" %}
2440- {{ form.name }}
2441- {% if form.name.errors %}
2442- <span class="error" id="name-error">{{ form.name.errors|first }}</span>
2443- {% endif %}
2444- </label></p>
2445-
2446- <p>
2447- <button class="btn cta" type="submit" data-qa-id="rename_this_device">
2448- <span>{% trans "Rename" %}</span>
2449- </button>
2450- <a class="cta secondary" href="{{ device_list_path }}" data-qa-id="cancel_renaming_this_device">{% trans "Cancel" %}</a>
2451- </p>
2452-
2453-</form>
2454-
2455+ <h2>{% trans "Rename device" %}</h2>
2456+ <form method="post" action="">
2457+ {% csrf_token %}
2458+ <div class="row">
2459+ <div class="p-form-validation is-error col-4">
2460+ <label for="id_name">Name</label>
2461+ {{ form.name }}
2462+ {% if form.name.errors %}
2463+ <p class="p-form-validation__message">
2464+ <strong>Error:</strong> {{ form.name.errors|first }}
2465+ </p>
2466+ {% endif %}
2467+ </div>
2468+ </div>
2469+ <button class="p-button--positive" type="submit" data-qa-id="rename_this_device">{% trans "Rename" %}</button>
2470+ <a class="p-button--neutral" href="{{ device_list_path }}" data-qa-id="cancel_renaming_this_device">{% trans "Cancel" %}</a>
2471+ </form>
2472 {% endblock %}
2473
2474=== modified file 'src/webui/templates/device/types.html'
2475--- src/webui/templates/device/types.html 2016-12-06 16:53:22 +0000
2476+++ src/webui/templates/device/types.html 2019-12-17 18:04:01 +0000
2477@@ -1,75 +1,82 @@
2478-{% extends "base.html" %}
2479+{% extends "vanilla/base.html" %}
2480 {% load i18n %}
2481 {% load static_url %}
2482 {% load gargoyle_tags %}
2483
2484 {% comment %}
2485-Copyright 2012 Canonical Ltd. This software is licensed under the GNU
2486+Copyright 2012-2019 Canonical Ltd. This software is licensed under the GNU
2487 Affero General Public License version 3 (see the file LICENSE).
2488 {% endcomment %}
2489
2490 {% block html_extra %}data-qa-id="device_addition"{% endblock %}
2491
2492 {% block title %}
2493- {% blocktrans %}{{ user }}'s devices{% endblocktrans %}
2494+ {% trans "Add a new authentication device" %}
2495 {% endblock %}
2496
2497
2498-{% block text_title %}<h1 class="u1-h-main">{% trans "Add a new authentication device" %}</h1>{% endblock %}
2499+{% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %}
2500
2501 {% block content %}
2502-
2503-<form method="post" action="">
2504- {% csrf_token %}
2505-
2506- <dl class="device-types">
2507-
2508- <dt><label>
2509- <input type="radio" name="type" value="google" id="type_google" checked="checked"> {% trans "Smartphone or Tablet" %}
2510- </label></dt>
2511- <dd>
2512- <p><label for="type_google">{% blocktrans %}Android, Apple, or Blackberry mobile device with the Google Authenticator app;
2513- or Windows phone with the Auth7 app{% endblocktrans %}</label></p>
2514- </dd>
2515-
2516- <dt><label>
2517- <input type="radio" name="type" value="yubi" id="type_yubi"> {% trans "YubiKey" %}
2518- </label></dt>
2519- <dd>
2520- <p><label for="type_yubi">{% blocktrans %}USB YubiKey one time password generator{% endblocktrans %}</label></p>
2521- </dd>
2522-
2523- <dt><label>
2524- <input type="radio" name="type" value="generic" id="type_generic"> {% trans "Generic HOTP/TOTP device" %}
2525- </label></dt>
2526- <dd>
2527- <p><label for="type_generic">{% blocktrans %}Any other OATH HOTP/TOTP compatible device{% endblocktrans %}</label></p>
2528- </dd>
2529-
2530- <dt><label>
2531- <input type="radio" name="type" value="paper" id="type_paper"> {% trans "Printable Backup Codes" %}
2532- </label></dt>
2533- <dd>
2534- <p><label for="type_paper">{% blocktrans %}A list of backup codes to
2535- print.{% endblocktrans %}</label></p>
2536- </dd>
2537-
2538- </dl>
2539-
2540- <p>
2541- <button class="btn cta" type="submit" data-qa-id="add_device_from_type">
2542- <span>{% trans "Add device" %}</span>
2543- </button>
2544- <a class="cta secondary" data-qa-id="cancel_add_device_from_type" href="{{ device_list_path }}">{% trans "Cancel" %}</a>
2545- </p>
2546- <p>
2547- {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %}
2548- The <a href="{{2FFAQ}}#Devices">2-Factor Auth FAQ</a>
2549- has details on compatible devices.
2550- {% endblocktrans %}
2551- </p>
2552-
2553-
2554-</form>
2555-
2556+ <h2>{% trans "Add a new authentication device" %}</h2>
2557+ <form method="post" action="">
2558+ {% csrf_token %}
2559+
2560+ <ul class="p-list">
2561+ <li class="p-list__item">
2562+ <div class="row">
2563+ <div class="col-3">
2564+ <input type="radio" name="type" value="google" id="type_google" checked="checked">
2565+ <label for="type_google">{% trans "Smartphone or Tablet" %}</label>
2566+ </div>
2567+ <div class="col-5">
2568+ <p>{% blocktrans %}Android, Apple, or Blackberry mobile device with the Google Authenticator app; or Windows phone with the Auth7 app{% endblocktrans %}</p>
2569+ </div>
2570+ </div>
2571+ </li>
2572+ <li class="p-list__item">
2573+ <div class="row">
2574+ <div class="col-3 col-medium-3">
2575+ <input type="radio" name="type" value="yubi" id="type_yubi">
2576+ <label for="type_yubi">{% trans "YubiKey" %}</label>
2577+ </div>
2578+ <div class="col-5 col-medium-3">
2579+ <p>{% blocktrans %}USB YubiKey one time password generator{% endblocktrans %}</p>
2580+ </div>
2581+ </div>
2582+ </li>
2583+ <li class="p-list__item">
2584+ <div class="row">
2585+ <div class="col-3 col-medium-3">
2586+ <input type="radio" name="type" value="generic" id="type_generic">
2587+ <label for="type_generic">{% trans "Generic HOTP/TOTP device" %}</label>
2588+ </div>
2589+ <div class="col-5 col-medium-3">
2590+ <p>{% blocktrans %}Any other OATH HOTP/TOTP compatible device{% endblocktrans %}</p>
2591+ </div>
2592+ </div>
2593+ </li>
2594+ <li class="p-list__item">
2595+ <div class="row">
2596+ <div class="col-3 col-medium-3">
2597+ <input type="radio" name="type" value="paper" id="type_paper">
2598+ <label for="type_paper">{% trans "Printable Backup Codes" %}</label>
2599+ </div>
2600+ <div class="col-5 col-medium-3">
2601+ <p>{% blocktrans %}A list of backup codes to
2602+ print.{% endblocktrans %}</p>
2603+ </div>
2604+ </div>
2605+ </li>
2606+ </ul>
2607+
2608+ <button class="p-button--positive" type="submit" data-qa-id="add_device_from_type">{% trans "Add device" %}</button>
2609+ <a class="p-button--neutral" data-qa-id="cancel_add_device_from_type" href="{{ device_list_path }}">{% trans "Cancel" %}</a>
2610+ <p>
2611+ {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %}
2612+ The <a href="{{2FFAQ}}#Devices">2-Factor Auth FAQ</a>
2613+ has details on compatible devices.
2614+ {% endblocktrans %}
2615+ </p>
2616+ </form>
2617 {% endblock %}
2618
2619=== modified file 'src/webui/templates/limitexceeded.html'
2620--- src/webui/templates/limitexceeded.html 2014-12-09 21:32:43 +0000
2621+++ src/webui/templates/limitexceeded.html 2019-12-17 18:04:01 +0000
2622@@ -1,27 +1,27 @@
2623-{% extends "base.html" %}
2624+{% extends "vanilla/base.html" %}
2625 {% load i18n %}
2626
2627 {% comment %}
2628-Copyright 2010 Canonical Ltd. This software is licensed under the
2629+Copyright 2019 Canonical Ltd. This software is licensed under the
2630 GNU Affero General Public License version 3 (see the file LICENSE).
2631 {% endcomment %}
2632
2633 {% block title %}
2634- {% trans "Rate limit exceeded" %}
2635+ {% trans "Rate limit exceeded" %}
2636 {% endblock %}
2637
2638 {% block text_title %}
2639- <h1 class="main">{% trans "Rate limit exceeded" %}</h1>
2640+ <h1>{% trans "Rate limit exceeded" %}</h1>
2641 {% endblock %}
2642
2643 {% block content %}
2644- <div>
2645- <p>
2646- {% blocktrans %}You have made too many failed requests to the Ubuntu One authentication server over a short period of time.{% endblocktrans %}
2647- </p>
2648- <p>
2649- {% blocktrans %}Please try again in a while.{% endblocktrans %}
2650- </p>
2651- <a class="btn" href="/"><span><span>{% trans "Try again" %}</span></span></a>
2652- </div>
2653+ <div class="row">
2654+ <p>
2655+ {% blocktrans %}You have made too many failed requests to the Ubuntu One authentication server over a short period of time.{% endblocktrans %}
2656+ </p>
2657+ <p>
2658+ {% blocktrans %}Please try again in a while.{% endblocktrans %}
2659+ </p>
2660+ <a href="/">{% trans "Try again" %}</a>
2661+ </div>
2662 {% endblock %}
2663
2664=== modified file 'src/webui/templates/readonly.html'
2665--- src/webui/templates/readonly.html 2012-12-04 18:51:42 +0000
2666+++ src/webui/templates/readonly.html 2019-12-17 18:04:01 +0000
2667@@ -1,28 +1,29 @@
2668-{% extends "base.html" %}
2669+{% extends "vanilla/base.html" %}
2670 {% load i18n %}
2671
2672 {% comment %}
2673-Copyright 2010 Canonical Ltd. This software is licensed under the
2674+Copyright 2019 Canonical Ltd. This software is licensed under the
2675 GNU Affero General Public License version 3 (see the file LICENSE).
2676 {% endcomment %}
2677
2678 {% block title %}
2679- {% trans "Read-only mode" %}
2680+ {% trans "Read-only mode" %}
2681 {% endblock %}
2682
2683 {% block text_title %}
2684- <h1 class="main">{% trans "We're currently in read-only mode." %}</h1>
2685+ <h1>{% trans "We're currently in read-only mode." %}</h1>
2686 {% endblock %}
2687
2688 {% block content %}
2689- <div>
2690- <p>
2691- {% blocktrans %}Apologies, the page you're requesting isn't accessible at the moment, as we're running with a minimum set of features. Hopefully we will have the full service up and running again in no time.{% endblocktrans %}
2692- </p>
2693- <p>
2694- {% blocktrans %}Please try again in a while.{% endblocktrans %}
2695- </p>
2696- <a class="btn" href=""><span><span>{% trans "Try again" %}</span></span></a> {% trans "or" %}
2697- <a class="btn alt" href="/"><span><span>{% trans "Go to our home page" %}</span></span></a>
2698- </div>
2699+ <div class="row">
2700+ <p>
2701+ {% blocktrans %}Apologies, the page you're requesting isn't accessible at the moment, as we're running with a minimum set of features. Hopefully we will have the full service up and running again in no time.{% endblocktrans %}
2702+ </p>
2703+ <p>
2704+ {% blocktrans %}Please try again in a while.{% endblocktrans %}
2705+ </p>
2706+ <p>
2707+ <a href=""><span><span>{% trans "Try again" %}</span></span></a> {% trans "or" %}
2708+ <a href="/"><span><span>{% trans "go to our home page" %}</span></span></a>
2709+ </div>
2710 {% endblock %}
2711
2712=== modified file 'src/webui/templates/select_language.html'
2713--- src/webui/templates/select_language.html 2014-12-09 21:41:56 +0000
2714+++ src/webui/templates/select_language.html 2019-12-17 18:04:01 +0000
2715@@ -1,78 +1,59 @@
2716-{% extends "base.html" %}
2717+{% extends "vanilla/base.html" %}
2718 {% load i18n %}
2719
2720 {% comment %}
2721-Copyright 2010 Canonical Ltd. This software is licensed under the
2722+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
2723 GNU Affero General Public License version 3 (see the file LICENSE).
2724 {% endcomment %}
2725
2726 {% block title %}
2727- {% trans "Choose your language" %}
2728+ {% trans "Choose your language" %}
2729 {% endblock %}
2730
2731 {% block text_title %}
2732- <h1 class="u1-h-main">{% trans "Choose your language" %}</h1>
2733+ <h1>{% trans "Choose your language" %}</h1>
2734 {% endblock %}
2735
2736 {% block bodyclass %}set-language{% endblock %}
2737 {% block menu %}{% endblock %}
2738
2739 {% block extra_css %}
2740-<style type="text/css">
2741+ <style type="text/css">
2742 .set-language footer .language {
2743- display: none;
2744+ display: none;
2745 }
2746-</style>
2747+ </style>
2748 {% endblock %}
2749
2750+{% block content_class %}{% endblock %}
2751+
2752 {% block content %}
2753-
2754-<div class="yui3-g-r">
2755-
2756- <div class="yui3-u-1-2 language-select">
2757-
2758- <form action="" method="post">
2759-
2760- {% csrf_token %}
2761- <input type="hidden" name="next" value="{{next}}">
2762-
2763- {% for lang in supported_languages %}
2764- <p>
2765- <input id="lang-{{lang.0}}" type="radio" name="language"
2766- {% if LANGUAGE_CODE == lang.0 %}checked="checked"{% endif %}
2767- value="{{lang.0}}">
2768-
2769- <label for="lang-{{lang.0}}">
2770- {{lang.1}}
2771- </label>
2772- </p>
2773- {% endfor %}
2774-
2775- <button type="submit" name="submit" data-qa-id="choose_language" class="btn cta">
2776- {% trans "Choose language" %}
2777- </button>
2778- </form>
2779-
2780- </div>
2781-
2782- <div class="yui3-u-1-3 cannot-find-language">
2783-
2784- <div class="box">
2785-
2786- <div class="title">
2787- <h3>{% trans "Can't find your language?" %}</h3>
2788- </div>
2789-
2790- <div class="body">
2791-
2792- <p>{% blocktrans %}We welcome volunteers to help us translate this site to new languages. If you are able to help, please visit our <a href="https://translations.launchpad.net/canonical-identity-provider">translations site</a> to get started.{% endblocktrans %}
2793- </p>
2794-
2795- </div>
2796-
2797- </div>
2798-
2799- </div>
2800-
2801-</div>
2802+ <div class="row">
2803+ <div class="col-8">
2804+ <form action="" method="post">
2805+ {% csrf_token %}
2806+ <input type="hidden" name="next" value="{{next}}">
2807+ <ul class="p-list is-split">
2808+ {% for lang in supported_languages %}
2809+ <li class="p-list__item">
2810+ <input id="lang-{{lang.0}}" type="radio" name="language" {% if LANGUAGE_CODE == lang.0 %}checked="checked"{% endif %} value="{{lang.0}}">
2811+ <label for="lang-{{lang.0}}">
2812+ {{lang.1}}
2813+ </label>
2814+ </li>
2815+ {% endfor %}
2816+ </ul>
2817+ <button type="submit" name="submit" data-qa-id="choose_language" class="p-button--positive">
2818+ {% trans "Choose language" %}
2819+ </button>
2820+ </form>
2821+ </div>
2822+ <div class="col-4">
2823+ <div class="p-card">
2824+ <h3>{% trans "Can't find your language?" %}</h3>
2825+ <p>{% blocktrans %}We welcome volunteers to help us translate this site to new languages. If you are able to help, please visit our <a class="p-link--external" href="https://translations.launchpad.net/canonical-identity-provider">translations site</a> to get started.{% endblocktrans %}
2826+ </p>
2827+ </div>
2828+ </div>
2829+ </div>
2830 {% endblock %}
2831
2832=== modified file 'src/webui/templates/ssh_messages/username_unset.html'
2833--- src/webui/templates/ssh_messages/username_unset.html 2016-11-01 10:53:35 +0000
2834+++ src/webui/templates/ssh_messages/username_unset.html 2019-12-17 18:04:01 +0000
2835@@ -1,5 +1,5 @@
2836 {% load i18n %}
2837 {% blocktrans %}
2838-<p>To import an ssh key, you must have a username set in your Personal Details.</p>
2839+To import an ssh key, you must have a username set in your Personal Details.
2840 {% endblocktrans %}
2841-<p><a href="{% url 'account-index' %}">Edit Personal details</a></p>
2842+<a href="{% url 'account-index' %}">Edit Personal details</a></p>
2843
2844=== modified file 'src/webui/templates/vanilla/_header.html'
2845--- src/webui/templates/vanilla/_header.html 2019-11-11 14:04:50 +0000
2846+++ src/webui/templates/vanilla/_header.html 2019-12-17 18:04:01 +0000
2847@@ -10,9 +10,9 @@
2848 <div class="p-navigation__banner">
2849 <div class="p-navigation__logo">
2850 {% if not embedded %}
2851- <a href="/" id="u1-logo" class="p-navigation__link">
2852- <img src="https://assets.ubuntu.com/v1/d738f754-Ubuntu_One_Mono_Logo.svg" alt="{% blocktrans %}Ubuntu One{% endblocktrans %}" width="90">
2853- </a>
2854+ <a href="/" id="u1-logo" class="p-navigation__link">
2855+ <img src="https://assets.ubuntu.com/v1/d738f754-Ubuntu_One_Mono_Logo.svg" alt="{% blocktrans %}Ubuntu One{% endblocktrans %}" width="90">
2856+ </a>
2857 {% endif %}
2858 </div>
2859 <a href="#navigation" class="p-navigation__toggle--open" title="menu">Menu</a>
2860@@ -23,7 +23,7 @@
2861 <a href="#main-content">Jump to main content</a>
2862 </span>
2863 {% block me-menu %}
2864- {% include "vanilla/widgets/header-me-menu.html" %}
2865+ {% include "vanilla/widgets/header-me-menu.html" %}
2866 {% endblock %}
2867
2868 {% block navigation %}{% endblock %}
2869
2870=== modified file 'src/webui/templates/vanilla/base.html'
2871--- src/webui/templates/vanilla/base.html 2019-11-11 14:04:50 +0000
2872+++ src/webui/templates/vanilla/base.html 2019-12-17 18:04:01 +0000
2873@@ -4,182 +4,181 @@
2874 <!--[if IE 8 ]><html class="ie8" lang="en" dir="ltr"><![endif]-->
2875 <!--[if (gte IE 9)|!(IE)]><!--><html lang="en" dir="ltr" class="no-js" {% block html_extra %}{% endblock %}><!--<![endif]-->
2876 {% comment %}Copyright 2019 Canonical Ltd. This software is licensed under the GNU Affero General Public License version 3 (see the file LICENSE).{% endcomment %}
2877- <head>
2878- <meta charset="utf-8">
2879- <meta name="viewport" content="width=device-width">
2880- {% block extra_meta %}{% endblock %}
2881-
2882- {% block extra_header %}{% endblock %}
2883-
2884- <title>{% block title %}{% trans "Log in" %}{% endblock %}</title>
2885- <link rel="icon" type="image/vnd.microsoft.icon"
2886- href="{% static 'identityprovider/img/favicon.ico' %}">
2887-
2888- {% block corecss %}
2889- <link href="{% static 'vanilla-css/styles.css' %}" rel="stylesheet">
2890- {% endblock %}
2891- {% block extra_css %}{% endblock %}
2892-
2893- <!--[if lt IE 9]>
2894- <script type="text/javascript" src="{% static 'identityprovider/js/ie/html5shiv.js' %}"></script>
2895- <![endif]-->
2896- <script>
2897- document.documentElement.className=document.documentElement.className.replace(/\bno-js\b/,'') + ' js';
2898- </script>
2899- </head>
2900- <body data-qa-id="{% block qaid %}{% endblock %}" {% if embedded %}onload="blank_targets()"{% endif %}
2901- class="{% block bodyclass %}{% if user.is_authenticated %}with-menu{% endif %}{% endblock %}{% if readonly %} readonly{% endif %}">
2902- {% get_current_language as LANGUAGE_CODE %}
2903- <!-- Current language: {{ LANGUAGE_CODE }} -->
2904-
2905- {% if google_tag_manager_id %}
2906- <!-- Google Tag Manager (noscript) -->
2907- <noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ google_tag_manager_id }}"
2908- height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
2909- <!-- End Google Tag Manager (noscript) -->
2910- {% endif %}
2911-
2912- <div id="cont" role="main">
2913- {% include "vanilla/_header.html" %}
2914- <div id="content">
2915- <section class="p-strip--dark p-cip-hero">
2916- <div class="row">
2917- <div class="col-7">
2918- {% block text_title %}{% endblock %}
2919+<head>
2920+ <meta charset="utf-8">
2921+ <meta name="viewport" content="width=device-width">
2922+ {% block extra_meta %}{% endblock %}
2923+
2924+ {% block extra_header %}{% endblock %}
2925+
2926+ <title>{% block title %}{% trans "Log in" %}{% endblock %}</title>
2927+ <link rel="icon" type="image/vnd.microsoft.icon"
2928+ href="{% static 'identityprovider/img/favicon.ico' %}">
2929+
2930+ {% block corecss %}
2931+ <link href="{% static 'vanilla-css/styles.css' %}" rel="stylesheet">
2932+ {% endblock %}
2933+ {% block extra_css %}{% endblock %}
2934+
2935+ <!--[if lt IE 9]>
2936+ <script type="text/javascript" src="{% static 'identityprovider/js/ie/html5shiv.js' %}"></script>
2937+ <![endif]-->
2938+ <script>
2939+ document.documentElement.className=document.documentElement.className.replace(/\bno-js\b/,'') + ' js';
2940+ </script>
2941+</head>
2942+<body data-qa-id="{% block qaid %}{% endblock %}" {% if embedded %}onload="blank_targets()"{% endif %}
2943+class="{% block bodyclass %}{% if user.is_authenticated %}with-menu{% endif %}{% endblock %}{% if readonly %} readonly{% endif %}">
2944+{% get_current_language as LANGUAGE_CODE %}
2945+<!-- Current language: {{ LANGUAGE_CODE }} -->
2946+
2947+{% if google_tag_manager_id %}
2948+<!-- Google Tag Manager (noscript) -->
2949+<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ google_tag_manager_id }}"
2950+ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
2951+ <!-- End Google Tag Manager (noscript) -->
2952+ {% endif %}
2953+
2954+ <div id="cont" role="main">
2955+ {% include "vanilla/_header.html" %}
2956+ <div id="content">
2957+ <section class="p-strip--dark p-cip-hero">
2958+ <div class="row">
2959+ <div class="col-7">
2960+ {% block text_title %}{% endblock %}
2961+ </div>
2962+ </div>
2963+ </section>
2964+
2965+ <div id="{% block content_id %}box{% endblock %}" class="row">
2966+ {% block menu %}
2967+ {% if user.is_authenticated %}
2968+ <div class="col-4 p-sidebar">
2969+ {% include "vanilla/widgets/personal-menu.html" %}
2970+ </div>
2971+ {% endif %}
2972+ {% endblock %}
2973+ <div class="{% block content_class %}col-8{% endblock %}">
2974+ <section class="p-strip">
2975+ {% block readonly %}
2976+ {% if readonly %}
2977+ <div class="p-notification--caution">
2978+ <p class="p-notification__response">
2979+ {% blocktrans %}We are currently in read-only mode. That means that at the moment you can't create new accounts, update your personal information, or request password reminders.{% endblocktrans %}
2980+ </p>
2981 </div>
2982- </div>
2983- </section>
2984-
2985- <div id="{% block content_id %}box{% endblock %}" class="row">
2986- {% block menu %}
2987- {% if user.is_authenticated %}
2988- <div class="col-4 p-sidebar">
2989- {% include "vanilla/widgets/personal-menu.html" %}
2990+ {% endif %}
2991+ {% endblock %}
2992+ {% block messages %}
2993+ {% if messages %}
2994+ <section class="p-strip is-shallow">
2995+ {% for message in messages %}
2996+ <div class="row">
2997+ <div class="col-12">
2998+ <div class="p-notification">
2999+ <p class="p-notification__response">
3000+ {{ message }}
3001+ </p>
3002+ </div>
3003+ </div>
3004 </div>
3005- {% endif %}
3006- {% endblock %}
3007- <div class="{% block content_class %}col-8{% endblock %}">
3008- <section class="p-strip">
3009- {% block readonly %}
3010- {% if readonly %}
3011- <div class="p-notification--caution">
3012- <p class="p-notification__response">
3013- {% blocktrans %}We are currently in read-only mode. That means that at the moment you can't create new accounts, update your personal information, or request password reminders.{% endblocktrans %}
3014- </p>
3015- </div>
3016- {% endif %}
3017- {% endblock %}
3018- {% block messages %}
3019- {% if messages %}
3020- <section class="p-strip is-shallow">
3021- {% for message in messages %}
3022- <div class="row">
3023- <div class="col-12">
3024- <div class="p-notification">
3025- <p class="p-notification__response">
3026- {{ message }}
3027- </p>
3028- </div>
3029- </div>
3030- </div>
3031- {% endfor %}
3032- </section>
3033- {% endif %}
3034- {% endblock %}
3035- {% block content %}{% endblock %}
3036+ {% endfor %}
3037 </section>
3038- </div>
3039+ {% endif %}
3040+ {% endblock %}
3041+ {% block content %}{% endblock %}
3042+ </section>
3043 </div>
3044- </section>
3045- </div><!-- close #content -->
3046-
3047- {% include "vanilla/_footer.html" %}
3048-
3049- </div><!-- close #cont -->
3050-
3051- {% block general_js %}
3052- <script type="text/javascript">
3053- YUI_config = {
3054- maxURLLength: 2000,
3055- combine: {{ combine|lower }},
3056- comboBase: '{{ combo_url }}?',
3057- base: '{% static "yui/3.15.0/" %}',
3058- root: 'yui/3.15.0/'
3059+ </div>
3060+ </div><!-- close #content -->
3061+
3062+ {% include "vanilla/_footer.html" %}
3063+
3064+</div><!-- close #cont -->
3065+
3066+{% block general_js %}
3067+<script type="text/javascript">
3068+YUI_config = {
3069+ maxURLLength: 2000,
3070+ combine: {{ combine|lower }},
3071+ comboBase: '{{ combo_url }}?',
3072+ base: '{% static "yui/3.15.0/" %}',
3073+ root: 'yui/3.15.0/'
3074+}
3075+</script>
3076+{# use combo to load yui, to provide far future caching, as whitenoise doesn't for non-hashed urls #}
3077+{# notexist disables optimisation in template tag that avoids combo if only one file #}
3078+{% combo 'yui/3.15.0/yui/yui-min.js' 'notexist' %}
3079+
3080+<script type="text/javascript">
3081+YUI().use('node', 'transition', function (Y) {
3082+ Y.all('.message.temporary').transition({
3083+ easing: 'ease-out',
3084+ duration: 0.1,
3085+ delay: 5,
3086+ height: 0,
3087+ opacity: 0,
3088+ marginTop: 0,
3089+ marginBottom: 0,
3090+ paddingTop: 0,
3091+ paddingBottom: 0,
3092+ on: {
3093+ start: function () {
3094+ this.setStyle('overflow', 'hidden');
3095+ }
3096 }
3097- </script>
3098- {# use combo to load yui, to provide far future caching, as whitenoise doesn't for non-hashed urls #}
3099- {# notexist disables optimisation in template tag that avoids combo if only one file #}
3100- {% combo 'yui/3.15.0/yui/yui-min.js' 'notexist' %}
3101-
3102- <script type="text/javascript">
3103- YUI().use('node', 'transition', function (Y) {
3104- Y.all('.message.temporary').transition({
3105- easing: 'ease-out',
3106- duration: 0.1,
3107- delay: 5,
3108- height: 0,
3109- opacity: 0,
3110- marginTop: 0,
3111- marginBottom: 0,
3112- paddingTop: 0,
3113- paddingBottom: 0,
3114- on: {
3115- start: function () {
3116- this.setStyle('overflow', 'hidden');
3117- }
3118- }
3119- });
3120 });
3121- </script>
3122-
3123- {% endblock %}
3124-
3125- {% block test_js %}{% endblock %}
3126- {% block extra_js %}{% endblock %}
3127-
3128- {% block disable_submit_buttons_js %}
3129- <script type="text/javascript">
3130- (function(){
3131- // disable all submit buttons after initial form submission
3132- // to prevent double-clicks
3133- var formEls = document.querySelectorAll('form');
3134-
3135- if (formEls && formEls.length) {
3136- for (var i = formEls.length; i--;) {
3137- formEls[i].addEventListener('submit', disableAfterSubmit);
3138- }
3139- }
3140-
3141- function disableAfterSubmit(e) {
3142- var formEl = e.currentTarget;
3143- var submitEl = formEl.querySelector('input[type=submit],button[type=submit]');
3144-
3145- if (!submitEl.classList.contains('disabled')) {
3146- disableSubmitEl(submitEl);
3147- } else {
3148- e.preventDefault();
3149- }
3150- }
3151-
3152- function disableSubmitEl(el) {
3153- el.classList.add('disabled');
3154- }
3155-
3156- })();
3157- </script>
3158- {% endblock %}
3159-
3160- {% block analytics %}
3161- {% if google_tag_manager_id %}
3162- <!-- Google Tag Manager -->
3163- <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
3164- new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
3165- j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
3166- 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
3167- })(window,document,'script','dataLayer','{{ google_tag_manager_id }}');</script>
3168- <!-- End Google Tag Manager -->
3169- {% endif %}
3170- {% endblock %}
3171-
3172- </body>
3173+});
3174+</script>
3175+
3176+{% endblock %}
3177+
3178+{% block test_js %}{% endblock %}
3179+{% block extra_js %}{% endblock %}
3180+
3181+{% block disable_submit_buttons_js %}
3182+<script type="text/javascript">
3183+(function(){
3184+ // disable all submit buttons after initial form submission
3185+ // to prevent double-clicks
3186+ var formEls = document.querySelectorAll('form');
3187+
3188+ if (formEls && formEls.length) {
3189+ for (var i = formEls.length; i--;) {
3190+ formEls[i].addEventListener('submit', disableAfterSubmit);
3191+ }
3192+ }
3193+
3194+ function disableAfterSubmit(e) {
3195+ var formEl = e.currentTarget;
3196+ var submitEl = formEl.querySelector('input[type=submit],button[type=submit]');
3197+
3198+ if (!submitEl.classList.contains('disabled')) {
3199+ disableSubmitEl(submitEl);
3200+ } else {
3201+ e.preventDefault();
3202+ }
3203+ }
3204+
3205+ function disableSubmitEl(el) {
3206+ el.classList.add('disabled');
3207+ }
3208+
3209+})();
3210+</script>
3211+{% endblock %}
3212+
3213+{% block analytics %}
3214+{% if google_tag_manager_id %}
3215+<!-- Google Tag Manager -->
3216+<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
3217+new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
3218+j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
3219+'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
3220+})(window,document,'script','dataLayer','{{ google_tag_manager_id }}');</script>
3221+<!-- End Google Tag Manager -->
3222+{% endif %}
3223+{% endblock %}
3224+
3225+</body>
3226 </html>
3227
3228=== modified file 'src/webui/templates/versions.html'
3229--- src/webui/templates/versions.html 2012-12-04 18:51:42 +0000
3230+++ src/webui/templates/versions.html 2019-12-17 18:04:01 +0000
3231@@ -2,7 +2,7 @@
3232 {% load i18n %}
3233
3234 {% comment %}
3235-Copyright 2010 Canonical Ltd. This software is licensed under the
3236+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
3237 GNU Affero General Public License version 3 (see the file LICENSE).
3238 {% endcomment %}
3239
3240
3241=== modified file 'src/webui/templates/widgets/other_sites.html'
3242--- src/webui/templates/widgets/other_sites.html 2014-12-10 15:30:54 +0000
3243+++ src/webui/templates/widgets/other_sites.html 2019-12-17 18:04:01 +0000
3244@@ -1,22 +1,30 @@
3245 {% comment %}
3246-Copyright 2010 Canonical Ltd. This software is licensed under the
3247+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
3248 GNU Affero General Public License version 3 (see the file LICENSE).
3249 {% endcomment %}
3250
3251 {% load i18n %}
3252
3253-<section class="other-sites listing-section">
3254- <h3>{% trans "Sites you may still be logged into" %} <span class="subtitle">Date</span></h3>
3255+<div class="row">
3256+ <div class="col-6">
3257+ <h3>{% trans "Sites you may still be logged into" %}</h3>
3258
3259- <table class="listing">
3260- <tbody>
3261+ <table>
3262+ <thead>
3263+ <tr>
3264+ <th>{% trans "Website" %}</th>
3265+ <th>{% trans "Last used" %}</th>
3266+ </tr>
3267+ </thead>
3268+ <tbody>
3269 {% for site in other_sites %}
3270- <tr>
3271- <td class="site-url">{% if embedded %}{{ site.trust_root }}{% else %}
3272- <a href="{{ site.trust_root }}">{{ site.trust_root }}</a>{% endif %}</td>
3273- <td class="site-date">{{ site.date_last_used|date:"Y/m/d" }}</td>
3274- </tr>
3275+ <tr>
3276+ <td>{% if embedded %}{{ site.trust_root }}{% else %}
3277+ <a href="{{ site.trust_root }}">{{ site.trust_root }}</a>{% endif %}</td>
3278+ <td>{{ site.date_last_used|date:"Y/m/d" }}</td>
3279+ </tr>
3280 {% endfor %}
3281- </tbody>
3282+ </tbody>
3283 </table>
3284-</section>
3285+ </div>
3286+</div>
3287
3288=== modified file 'src/webui/tests/test_views_account.py'
3289--- src/webui/tests/test_views_account.py 2019-10-22 14:03:48 +0000
3290+++ src/webui/tests/test_views_account.py 2019-12-17 18:04:01 +0000
3291@@ -54,7 +54,7 @@
3292 token=None):
3293 tree = PyQuery(response.content)
3294 # verified_emails -> first listing table
3295- verified_emails = tree.find('table.listing')[0]
3296+ verified_emails = tree.find('table')[0]
3297 emails_td = PyQuery(verified_emails).find('td.email')
3298 for email_td in emails_td:
3299 email_address = PyQuery(email_td).find('span.email').text()
3300@@ -77,7 +77,7 @@
3301 tree = PyQuery(response.content)
3302 # unverified emails -> second listing table
3303 # (or first if there are no verified emails)
3304- unverified_emails = tree.find('table.listing')[-1]
3305+ unverified_emails = tree.find('table')[-1]
3306 emails_td = PyQuery(unverified_emails).find('td.email')
3307 for email_td in emails_td:
3308 if email_td.text == email.email:
3309@@ -101,12 +101,12 @@
3310
3311 def assert_add_email_action(self, response, token=None):
3312 tree = PyQuery(response.content)
3313- form = tree.find('section.add-emails')[0].find('form')
3314+ form = tree.find('#add-email')
3315 kwargs = {}
3316 if token is not None:
3317 kwargs['token'] = token
3318 url = reverse('new_email', kwargs=kwargs)
3319- self.assertEqual(form.get('action'), url)
3320+ self.assertEqual(form[0].get('action'), url)
3321
3322 def test_cannot_delete_verified_email_if_its_the_only_one(self):
3323 assert self.account.emailaddress_set.count() == 1
3324@@ -816,14 +816,16 @@
3325
3326 def test_backup_device_warning(self):
3327 response = self.client.get(self.url)
3328- backup_warning = MISSING_BACKUP_DEVICE.format(
3329- add_device_link=reverse('device-addition'))
3330+ backup_warning = MISSING_BACKUP_DEVICE
3331+
3332+ add_device_link = reverse('device-addition')
3333
3334 if (self.twofactor_enabled is False or self.devices_count != 1 or
3335 not self.user_wants_warn):
3336 self.assertNotContains(response, backup_warning)
3337 else:
3338 self.assertContains(response, backup_warning)
3339+ self.assertContains(response, add_device_link)
3340
3341 def test_codes_nearly_exhausted_warning(self):
3342 response = self.client.get(self.url)
3343@@ -1012,16 +1014,15 @@
3344 self.assertEqual(response.status_code, 200)
3345
3346 tree = PyQuery(response.content)
3347- return tree.find('[data-qa-id="edit_fieldsets"] fieldset')
3348+ return tree.find('[data-qa-id="edit_form"]')
3349
3350 def test_with_flag_for_user(self):
3351- fieldset = self.get_devices_fieldset()
3352- self.assertEqual(len(fieldset), 2)
3353+ form = self.get_devices_fieldset()
3354
3355- self.assertIsNotNone(fieldset.find(
3356+ self.assertIsNotNone(form.find(
3357 '[data-qa-id="personal_details"]'
3358 ))
3359- self.assertIsNotNone(fieldset.find(
3360+ self.assertIsNotNone(form.find(
3361 '[data-qa-id="authentication_devices"]'
3362 ))
3363
3364@@ -1050,7 +1051,7 @@
3365 def assert_verify_warning(self, response, token=None):
3366 tree = PyQuery(response.content)
3367 # check warning
3368- warning = tree.find('div#unverified_email_warning')
3369+ warning = tree.find('.p-notification__response')
3370 self.assertEqual(len(warning), 1)
3371 # check verify email link
3372 links = warning.find('a')
3373@@ -1069,7 +1070,7 @@
3374
3375 def assert_no_verify_warning(self, response):
3376 tree = PyQuery(response.content)
3377- warning = tree.find('div#unverified_email_warning')
3378+ warning = tree.find('#unverified_email_warning')
3379 self.assertEqual(len(warning), 0)
3380
3381 def test_verify_email_link_available(self):
3382
3383=== modified file 'src/webui/tests/test_views_account_ssh.py'
3384--- src/webui/tests/test_views_account_ssh.py 2018-05-28 20:15:33 +0000
3385+++ src/webui/tests/test_views_account_ssh.py 2019-12-17 18:04:01 +0000
3386@@ -112,7 +112,7 @@
3387
3388 self.assertContains(
3389 resp,
3390- "<h1 class='main'>We're currently in read-only mode.</h1>",
3391+ "We're currently in read-only mode.",
3392 status_code=403,
3393 html=True)
3394
3395
3396=== modified file 'src/webui/tests/test_views_devices.py'
3397--- src/webui/tests/test_views_devices.py 2018-05-28 20:15:33 +0000
3398+++ src/webui/tests/test_views_devices.py 2019-12-17 18:04:01 +0000
3399@@ -98,12 +98,15 @@
3400 self.factory.make_device(account=self.account, name='bar')
3401
3402 response = self.client.get(self.url)
3403- content = response.content
3404- idx_device = content.find('foo')
3405- idx_device2 = content.find('bar')
3406- self.assertNotEqual(idx_device, -1)
3407- self.assertNotEqual(idx_device2, -1)
3408- self.assertTrue(idx_device < idx_device2)
3409+ tree = PyQuery(response.content)
3410+
3411+ devices = tree.find('[data-qa-id="device_name"]')
3412+
3413+ # check both devices exist
3414+ self.assertEqual(len(devices), 2)
3415+
3416+ # check that foo is first in the markup
3417+ self.assertTrue(devices[0].text == 'foo')
3418
3419 def assert_backup_device_warning(self, show_warning):
3420 response = self.client.get(self.url)
3421@@ -196,15 +199,17 @@
3422
3423 tree = PyQuery(response.content)
3424
3425- rows = tree.find('table#device-list').find('tbody tr')
3426- self.assertEqual(len(rows), 1)
3427- name, command = rows.find('td')
3428- links = command.findall('a')
3429- self.assertEqual(len(links), 2)
3430+ devices = tree.find('[data-qa-id="device_name"]')
3431+ self.assertEqual(len(devices), 1)
3432+
3433+ print_device = tree.find('[data-qa-id="print_device"]')
3434+ self.assertEqual(len(print_device), 0)
3435+
3436+ remove_device = tree.find('[data-qa-id="delete_device"]')
3437+ self.assertEqual(len(remove_device), 1)
3438 self.assertEqual(
3439- links[1].get('href'),
3440+ remove_device[0].get('href'),
3441 reverse('device-removal', kwargs=dict(device_id=device.id)))
3442- self.assertEqual(name.text, device.name)
3443
3444
3445 class DeviceRenameViewTestCase(DeviceViewsTestCaseBase):
3446@@ -500,7 +505,7 @@
3447 response, 'form', 'otp', ['This field is required.'])
3448
3449 tree = PyQuery(response.content)
3450- self.assertEqual(len(tree.find('.error')), 2)
3451+ self.assertEqual(len(tree.find('.p-form-validation__message')), 2)
3452
3453 def test_add_second_device_unathenticated(self):
3454 self.assert_successful_post()