Merge lp:~deadlight/canonical-identity-provider/ssh-keys into lp:~deadlight/canonical-identity-provider/vanilla
- ssh-keys
- Merge into vanilla
Proposed by
Karl Williams
Status: | Merged |
---|---|
Approved by: | Karl Williams |
Approved revision: | no longer in the revision history of the source branch. |
Merged at revision: | 1710 |
Proposed branch: | lp:~deadlight/canonical-identity-provider/ssh-keys |
Merge into: | lp:~deadlight/canonical-identity-provider/vanilla |
Diff against target: |
1403 lines (+529/-532) 24 files modified
src/webui/forms.py (+5/-26) src/webui/templates/account/applications.html (+1/-4) src/webui/templates/account/auth_log.html (+5/-7) src/webui/templates/account/delete.html (+0/-2) src/webui/templates/account/edit.html (+113/-115) src/webui/templates/account/emails.html (+83/-85) src/webui/templates/account/ssh_keys.html (+108/-43) src/webui/templates/bad_token.html (+0/-2) src/webui/templates/device/addition-generic.html (+48/-50) src/webui/templates/device/device-help.html (+36/-38) src/webui/templates/device/list.html (+0/-2) src/webui/templates/device/removal.html (+11/-13) src/webui/templates/device/rename.html (+16/-18) src/webui/templates/device/types.html (+61/-65) src/webui/templates/registration/email_sent.html (+0/-4) src/webui/templates/registration/forgot_password.html (+0/-2) src/webui/templates/registration/login.html (+0/-4) src/webui/templates/registration/logout.html (+12/-14) src/webui/templates/registration/new_account.html (+0/-4) src/webui/templates/registration/reset_password.html (+0/-2) src/webui/templates/ssh_messages/username_unset.html (+2/-2) src/webui/templates/static/faq.html (+0/-2) src/webui/templates/static/ubuntuone-account.html (+0/-2) src/webui/templates/vanilla/base.html (+28/-26) |
To merge this branch: | bzr merge lp:~deadlight/canonical-identity-provider/ssh-keys |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Anthony Dillon (community) | Approve | ||
Review via email: mp+371590@code.launchpad.net |
Commit message
Description of the change
Converted the SSH keys page to vanilla
Updated the base template to include a wrapper .p-strip rather than duplicating it in all templates
QA:
This is complex and requires local hacks to properly QA. Perhaps I can run through how to visually test it in person/on a call?
To post a comment you must log in.
Revision history for this message
Karl Williams (deadlight) wrote : | # |
QA'd in person
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/webui/forms.py' |
2 | --- src/webui/forms.py 2018-07-19 15:46:28 +0000 |
3 | +++ src/webui/forms.py 2019-08-21 16:17:19 +0000 |
4 | @@ -101,32 +101,11 @@ |
5 | '<label>Bad Key Data: <span>{key}</span></label>', |
6 | key=escape(ssh_key)) |
7 | else: |
8 | - return format_html( |
9 | - u'<div class="key-display">' |
10 | - u' <h4>{comment}</h4> ' |
11 | - u' <ul>' |
12 | - u' <li>' |
13 | - u' <dl>' |
14 | - u' <dt>{key_type_label}</dt>' |
15 | - u' <dd>{key_type}</dt>' |
16 | - u' </dl>' |
17 | - u' </li>' |
18 | - u' <li>' |
19 | - u' <dl>' |
20 | - u' <dt>{key_text_label}</dt>' |
21 | - u' <dd class="key-text">' |
22 | - u' <a href="#">{key_text}</a>' |
23 | - u' </dt>' |
24 | - u' </dl>' |
25 | - u' </li>' |
26 | - u' </ul>' |
27 | - u'</div>', |
28 | - comment=comment, |
29 | - key_type_label=_("Type: "), |
30 | - key_type=key_type, |
31 | - key_text_label=_("Text: "), |
32 | - key_text=key_text, |
33 | - ) |
34 | + ssh_key_info = dict() |
35 | + ssh_key_info['label'] = format_html(comment) |
36 | + ssh_key_info['type'] = format_html(key_type) |
37 | + ssh_key_info['text'] = format_html(key_text) |
38 | + return ssh_key_info |
39 | |
40 | |
41 | class DeleteSSHKeyForm(forms.Form): |
42 | |
43 | === modified file 'src/webui/templates/account/applications.html' |
44 | --- src/webui/templates/account/applications.html 2019-08-20 09:40:18 +0000 |
45 | +++ src/webui/templates/account/applications.html 2019-08-21 16:17:19 +0000 |
46 | @@ -13,9 +13,7 @@ |
47 | {% endblock %} |
48 | |
49 | {% block content %} |
50 | -<section class="p-strip"> |
51 | - |
52 | -<h2>{% trans "Applications you use" %}</h2> |
53 | + <h2>{% trans "Applications you use" %}</h2> |
54 | {% if tokens %} |
55 | <p> |
56 | {% 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 %} |
57 | @@ -53,5 +51,4 @@ |
58 | {% else %} |
59 | <p>{% trans "You don't have any applications associated with this account." %}</p> |
60 | {% endif %} |
61 | -</section> |
62 | {% endblock %} |
63 | |
64 | === modified file 'src/webui/templates/account/auth_log.html' |
65 | --- src/webui/templates/account/auth_log.html 2019-08-12 15:11:33 +0000 |
66 | +++ src/webui/templates/account/auth_log.html 2019-08-21 16:17:19 +0000 |
67 | @@ -12,10 +12,9 @@ |
68 | {% endblock %} |
69 | |
70 | {% block content %} |
71 | -<section class="p-strip"> |
72 | <h2>Account activity</h2> |
73 | -{% if auth_log %} |
74 | -{% if full_auth_log_length > auth_log|length %} |
75 | + {% if auth_log %} |
76 | + {% if full_auth_log_length > auth_log|length %} |
77 | |
78 | <p> |
79 | {% blocktrans with accesses=auth_log|length%}The {{ accesses }} most recent accesses made with your account are shown here.{% endblocktrans %} |
80 | @@ -48,8 +47,7 @@ |
81 | {% endfor %} |
82 | </tbody> |
83 | </table> |
84 | -{% else %} |
85 | -<p>{% trans "Your account has no activity yet." %}</p> |
86 | -{% endif %} |
87 | -</section> |
88 | + {% else %} |
89 | + <p>{% trans "Your account has no activity yet." %}</p> |
90 | + {% endif %} |
91 | {% endblock %} |
92 | |
93 | === modified file 'src/webui/templates/account/delete.html' |
94 | --- src/webui/templates/account/delete.html 2019-08-19 09:34:09 +0000 |
95 | +++ src/webui/templates/account/delete.html 2019-08-21 16:17:19 +0000 |
96 | @@ -17,7 +17,6 @@ |
97 | {% endblock %} |
98 | |
99 | {% block content %} |
100 | -<section class="p-strip"> |
101 | <h2>{% trans "Delete account" %}</h2> |
102 | <p>{% blocktrans %}Please be aware that deleting your Ubuntu One |
103 | account means you'll lose access to all your accounts tied to your |
104 | @@ -60,5 +59,4 @@ |
105 | <a class="p-button" href="/">{% trans "Cancel" %}</a> |
106 | </div> |
107 | </form> |
108 | -</section> |
109 | {% endblock %} |
110 | |
111 | === modified file 'src/webui/templates/account/edit.html' |
112 | --- src/webui/templates/account/edit.html 2019-08-12 13:48:18 +0000 |
113 | +++ src/webui/templates/account/edit.html 2019-08-21 16:17:19 +0000 |
114 | @@ -35,121 +35,119 @@ |
115 | {% endblock %} |
116 | |
117 | {% block content %} |
118 | - <section class="p-strip"> |
119 | - {% include "vanilla/common/unverified_email_warning.html" %} |
120 | - {% include "vanilla/common/missing_backup_device_warning.html" %} |
121 | - {% include "vanilla/common/printed_codes_nearly_exhausted_warning.html" %} |
122 | - <h2>Personal details</h2> |
123 | - <form action="" method="post" class="edit-account-details" data-qa-id="edit_fieldsets"> |
124 | - {% csrf_token %} |
125 | - <div data-qa-id="personal_details"></div> |
126 | - |
127 | - <div class="row"> |
128 | - <div class="col-8"> |
129 | - <div class="p-form-validation{% if form.displayname.errors %} is-error{% endif %}"> |
130 | - <label class="formLabel" for="id_displayname">{% trans "Full name:" %}</label> |
131 | - {{ form.displayname }} |
132 | - {% if form.displayname.errors %} |
133 | - <p class="p-form-validation__message"> |
134 | - <strong>Error:</strong> {{ form.displayname.errors|first }} |
135 | - </p> |
136 | - {% endif %} |
137 | - </div> |
138 | - |
139 | - {% if form.username %} |
140 | - <div class="p-form-validation{% if form.username.errors %} is-error{% endif %}"> |
141 | - <label class="formLabel" for="id_username">{% trans "Username:" %}</label> |
142 | - {{ form.username }} |
143 | - {% if form.username.errors %} |
144 | - <p class="p-form-validation__message"> |
145 | - <strong>Error:</strong> {{ form.username.errors|first }} |
146 | - </p> |
147 | - {% endif %} |
148 | - </div> |
149 | - {% endif %} |
150 | - |
151 | - <div class="p-form-validation {{% if form.preferred_email.errors %} is-error{% endif %}"> |
152 | - <label class="formLabel tooltip" for="id_preferred_email"> |
153 | - {% 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> |
154 | - </label> |
155 | - |
156 | - {% if form.preferred_email %} |
157 | - {% if form.preferred_email.errors %} |
158 | - <p class="p-form-validation__message"> |
159 | - <strong>Error: </strong>{{ form.preferred_email.errors|first }} |
160 | - </p> |
161 | - {% endif %} |
162 | - {{ form.preferred_email }} |
163 | - {% else %} |
164 | - {# Manually added, it will be ignored by the django form #} |
165 | - <input type="text" value="{{ unverified_email|default_if_none:'' }}" disabled="true" /> |
166 | - {% endif %} |
167 | - </div> |
168 | - |
169 | - {% if not embedded %} |
170 | - <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> |
171 | - {% endif %} |
172 | - </div> |
173 | - </div> |
174 | - |
175 | - {% if not readonly %} |
176 | - <div class="p-strip is-shallow"> |
177 | - <hr> |
178 | - </div> |
179 | - |
180 | - <div class="row"> |
181 | - <div class="col-8"> |
182 | - {% include "widgets/passwords.html" with edit_account_labels=1 fields=form %} |
183 | - </div> |
184 | - </div> |
185 | - {% endif %} |
186 | - |
187 | - {% if enable_device_prefs %} |
188 | - <div class="p-strip is-shallow"> |
189 | - <hr> |
190 | - </div> |
191 | - <h4 class="legend" data-qa-id="authentication_devices">{% trans "Authentication devices" %}</h4> |
192 | - <div class="p-form-validation{% if form.twofactor_required.errors %} is-errors{% endif %}"> |
193 | - {{ form.twofactor_required }} |
194 | - {% if form.twofactor_required.errors %} |
195 | - <p class="p-form-validation__message"> |
196 | - <strong>Error:</strong> {{ form.twofactor_required.errors|first }} |
197 | - </p> |
198 | - {% endif %} |
199 | - </div> |
200 | - |
201 | - <div class="p-form-validation{% if form.warn_about_backup_device.errors %} is-error{% endif %}"> |
202 | - {{ form.warn_about_backup_device }} |
203 | - <label class="formLabel" for="id_warn_about_backup_device"> |
204 | - {{ form.warn_about_backup_device.label }} |
205 | - </label> |
206 | - {% if form.warn_about_backup_device.errors %} |
207 | - <p class="p-form-validation__message"> |
208 | - <strong>Error:</strong> {{ form.warn_about_backup_device.errors|first }} |
209 | - </p> |
210 | - {% endif %} |
211 | - </div> |
212 | - {% endif %} |
213 | - |
214 | - <div class="p-strip is-shallow"> |
215 | - <hr> |
216 | - </div> |
217 | - |
218 | - {% if not readonly %} |
219 | - <button type="submit" class="p-button--positive" name="update" data-qa-id="update_preferences"> |
220 | - <span>{% trans "Save changes" %}</span> |
221 | - </button> |
222 | - {% endif %} |
223 | - {% if token %} |
224 | - {% trans "or" %} |
225 | - <p><a id="exit" href="{% if require_username %}{% url 'server-decide' token %}?continue{% else %}.{% endif %}">{% trans "exit without updating" %}</a></p> |
226 | - {% endif %} |
227 | - </form> |
228 | - |
229 | - <p><a href="/+delete" data-qa-id="delete_account_link">{% trans "Permanently delete account" %}</a></p> |
230 | - |
231 | - {% include "widgets/last_auth_sites.html" %} |
232 | - </section> |
233 | + {% include "vanilla/common/unverified_email_warning.html" %} |
234 | + {% include "vanilla/common/missing_backup_device_warning.html" %} |
235 | + {% include "vanilla/common/printed_codes_nearly_exhausted_warning.html" %} |
236 | + <h2>Personal details</h2> |
237 | + <form action="" method="post" class="edit-account-details" data-qa-id="edit_fieldsets"> |
238 | + {% csrf_token %} |
239 | + <div data-qa-id="personal_details"></div> |
240 | + |
241 | + <div class="row"> |
242 | + <div class="col-8"> |
243 | + <div class="p-form-validation{% if form.displayname.errors %} is-error{% endif %}"> |
244 | + <label class="formLabel" for="id_displayname">{% trans "Full name:" %}</label> |
245 | + {{ form.displayname }} |
246 | + {% if form.displayname.errors %} |
247 | + <p class="p-form-validation__message"> |
248 | + <strong>Error:</strong> {{ form.displayname.errors|first }} |
249 | + </p> |
250 | + {% endif %} |
251 | + </div> |
252 | + |
253 | + {% if form.username %} |
254 | + <div class="p-form-validation{% if form.username.errors %} is-error{% endif %}"> |
255 | + <label class="formLabel" for="id_username">{% trans "Username:" %}</label> |
256 | + {{ form.username }} |
257 | + {% if form.username.errors %} |
258 | + <p class="p-form-validation__message"> |
259 | + <strong>Error:</strong> {{ form.username.errors|first }} |
260 | + </p> |
261 | + {% endif %} |
262 | + </div> |
263 | + {% endif %} |
264 | + |
265 | + <div class="p-form-validation {{% if form.preferred_email.errors %} is-error{% endif %}"> |
266 | + <label class="formLabel tooltip" for="id_preferred_email"> |
267 | + {% 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> |
268 | + </label> |
269 | + |
270 | + {% if form.preferred_email %} |
271 | + {% if form.preferred_email.errors %} |
272 | + <p class="p-form-validation__message"> |
273 | + <strong>Error: </strong>{{ form.preferred_email.errors|first }} |
274 | + </p> |
275 | + {% endif %} |
276 | + {{ form.preferred_email }} |
277 | + {% else %} |
278 | + {# Manually added, it will be ignored by the django form #} |
279 | + <input type="text" value="{{ unverified_email|default_if_none:'' }}" disabled="true" /> |
280 | + {% endif %} |
281 | + </div> |
282 | + |
283 | + {% if not embedded %} |
284 | + <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> |
285 | + {% endif %} |
286 | + </div> |
287 | + </div> |
288 | + |
289 | + {% if not readonly %} |
290 | + <div class="p-strip is-shallow"> |
291 | + <hr> |
292 | + </div> |
293 | + |
294 | + <div class="row"> |
295 | + <div class="col-8"> |
296 | + {% include "widgets/passwords.html" with edit_account_labels=1 fields=form %} |
297 | + </div> |
298 | + </div> |
299 | + {% endif %} |
300 | + |
301 | + {% if enable_device_prefs %} |
302 | + <div class="p-strip is-shallow"> |
303 | + <hr> |
304 | + </div> |
305 | + <h4 class="legend" data-qa-id="authentication_devices">{% trans "Authentication devices" %}</h4> |
306 | + <div class="p-form-validation{% if form.twofactor_required.errors %} is-errors{% endif %}"> |
307 | + {{ form.twofactor_required }} |
308 | + {% if form.twofactor_required.errors %} |
309 | + <p class="p-form-validation__message"> |
310 | + <strong>Error:</strong> {{ form.twofactor_required.errors|first }} |
311 | + </p> |
312 | + {% endif %} |
313 | + </div> |
314 | + |
315 | + <div class="p-form-validation{% if form.warn_about_backup_device.errors %} is-error{% endif %}"> |
316 | + {{ form.warn_about_backup_device }} |
317 | + <label class="formLabel" for="id_warn_about_backup_device"> |
318 | + {{ form.warn_about_backup_device.label }} |
319 | + </label> |
320 | + {% if form.warn_about_backup_device.errors %} |
321 | + <p class="p-form-validation__message"> |
322 | + <strong>Error:</strong> {{ form.warn_about_backup_device.errors|first }} |
323 | + </p> |
324 | + {% endif %} |
325 | + </div> |
326 | + {% endif %} |
327 | + |
328 | + <div class="p-strip is-shallow"> |
329 | + <hr> |
330 | + </div> |
331 | + |
332 | + {% if not readonly %} |
333 | + <button type="submit" class="p-button--positive" name="update" data-qa-id="update_preferences"> |
334 | + <span>{% trans "Save changes" %}</span> |
335 | + </button> |
336 | + {% endif %} |
337 | + {% if token %} |
338 | + {% trans "or" %} |
339 | + <p><a id="exit" href="{% if require_username %}{% url 'server-decide' token %}?continue{% else %}.{% endif %}">{% trans "exit without updating" %}</a></p> |
340 | + {% endif %} |
341 | + </form> |
342 | + |
343 | + <p><a href="/+delete" data-qa-id="delete_account_link">{% trans "Permanently delete account" %}</a></p> |
344 | + |
345 | + {% include "widgets/last_auth_sites.html" %} |
346 | |
347 | {% endblock %} |
348 | |
349 | |
350 | === modified file 'src/webui/templates/account/emails.html' |
351 | --- src/webui/templates/account/emails.html 2019-08-19 09:52:08 +0000 |
352 | +++ src/webui/templates/account/emails.html 2019-08-21 16:17:19 +0000 |
353 | @@ -15,91 +15,89 @@ |
354 | {% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %} |
355 | |
356 | {% block content %} |
357 | - <section class="p-strip"> |
358 | - <h2>{% trans "Your email addresses" %}</h2> |
359 | - {% if not verified_emails and not unverified_emails %} |
360 | - <p>{% blocktrans %}You have no email addresses associated with your account.{% endblocktrans %}</p> |
361 | - {% endif %} |
362 | - {% if verified_emails %} |
363 | - <section class="p-strip is-shallow u-no-padding--bottom"> |
364 | - <table class="p-table"> |
365 | - <thead> |
366 | - <tr> |
367 | - <th>{% trans "Verified" %}</th> |
368 | - </tr> |
369 | - </thead> |
370 | - <tbody> |
371 | - {% for email in verified_emails %} |
372 | - <tr> |
373 | - <td class="email{% if email.is_preferred %} preferred-email{% endif %}"> |
374 | - <span class="email">{{ email }}</span> |
375 | - {% if email.is_preferred %} |
376 | - <span class="preferred-label">{% trans "(preferred)" %}</span> |
377 | - {% endif %} |
378 | - </td> |
379 | - {% if not readonly %} |
380 | - <td class="u-align-text--right"> |
381 | - {% if not email.is_preferred and num_emails > 1 %} |
382 | - <a href="{% url_with_token 'delete_email' email_address=email.email %}" class="btn-sm" data-qa-id="delete_verified_{{ email }}">{% trans "Delete" %}</a> |
383 | - {% endif %} |
384 | - </td> |
385 | - {% endif %} |
386 | - </tr> |
387 | - {% endfor %} |
388 | - </tbody> |
389 | - </table> |
390 | - </section> |
391 | - {% endif %} |
392 | - |
393 | - {% if unverified_emails %} |
394 | - <section class="p-strip is-shallow"> |
395 | - <table class="p-table"> |
396 | - <thead> |
397 | - <tr> |
398 | - <th>{% trans "unverified" %}</th> |
399 | - </tr> |
400 | - </thead> |
401 | - <tbody> |
402 | - {% for email in unverified_emails %} |
403 | - <tr class="unverified-emails"> |
404 | - <td class="email">{{ email }}</td> |
405 | - {% if not readonly %} |
406 | - <td class="u-align-text--right"> |
407 | - <a href="{% url_with_token 'verify_email' email_address=email.email %}" data-qa-id="verify_unverified_{{ email }}"{% trans "Verify" %}</a> |
408 | - {% if num_emails > 1 %} |
409 | - <a href="{% url_with_token 'delete_email' email_address=email.email %}" data-qa-id="delete_unverified_{{ email }}">{% trans "Delete" %}</a> |
410 | - {% endif %} |
411 | - </td> |
412 | - {% endif %} |
413 | - </tr> |
414 | - {% endfor %} |
415 | - </table> |
416 | - </section> |
417 | - {% endif %} |
418 | - |
419 | - {% if not readonly %} |
420 | - <h3>{% trans "Add email address" %}</h3> |
421 | - <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to verify it.{% endblocktrans %}</p> |
422 | - <div class="row"> |
423 | - <div class="col-6"> |
424 | - <form action="{% url_with_token 'new_email' %}" method="post"> |
425 | - {% csrf_token %} |
426 | - <div class="p-form-validation{% if form.newemail.errors %} is-error{% endif %}"> |
427 | - <label for="id_newemail">Email address</label> |
428 | - {{ form.newemail }} |
429 | - {% if form.newemail.errors %} |
430 | - <p class="p-form-validation__message"> |
431 | - <strong>Error:</strong> {{ form.newemail.errors|first }} |
432 | - </p> |
433 | - {% endif %} |
434 | - </div> |
435 | - <p class="actions"> |
436 | - <button type="submit" class="p-button--positive" name="continue" data-qa-id="add_new_email">{% trans "Add address" %}</button> |
437 | - <a class="p-button--neutral" href="/">{% trans "Cancel" %}</a> |
438 | + <h2>{% trans "Your email addresses" %}</h2> |
439 | + {% if not verified_emails and not unverified_emails %} |
440 | + <p>{% blocktrans %}You have no email addresses associated with your account.{% endblocktrans %}</p> |
441 | + {% endif %} |
442 | + {% if verified_emails %} |
443 | + <section class="p-strip is-shallow u-no-padding--bottom"> |
444 | + <table class="p-table"> |
445 | + <thead> |
446 | + <tr> |
447 | + <th>{% trans "Verified" %}</th> |
448 | + </tr> |
449 | + </thead> |
450 | + <tbody> |
451 | + {% for email in verified_emails %} |
452 | + <tr> |
453 | + <td class="email{% if email.is_preferred %} preferred-email{% endif %}"> |
454 | + <span class="email">{{ email }}</span> |
455 | + {% if email.is_preferred %} |
456 | + <span class="preferred-label">{% trans "(preferred)" %}</span> |
457 | + {% endif %} |
458 | + </td> |
459 | + {% if not readonly %} |
460 | + <td class="u-align-text--right"> |
461 | + {% if not email.is_preferred and num_emails > 1 %} |
462 | + <a href="{% url_with_token 'delete_email' email_address=email.email %}" class="btn-sm" data-qa-id="delete_verified_{{ email }}">{% trans "Delete" %}</a> |
463 | + {% endif %} |
464 | + </td> |
465 | + {% endif %} |
466 | + </tr> |
467 | + {% endfor %} |
468 | + </tbody> |
469 | + </table> |
470 | + </section> |
471 | + {% endif %} |
472 | + |
473 | + {% if unverified_emails %} |
474 | + <section class="p-strip is-shallow"> |
475 | + <table class="p-table"> |
476 | + <thead> |
477 | + <tr> |
478 | + <th>{% trans "unverified" %}</th> |
479 | + </tr> |
480 | + </thead> |
481 | + <tbody> |
482 | + {% for email in unverified_emails %} |
483 | + <tr class="unverified-emails"> |
484 | + <td class="email">{{ email }}</td> |
485 | + {% if not readonly %} |
486 | + <td class="u-align-text--right"> |
487 | + <a href="{% url_with_token 'verify_email' email_address=email.email %}" data-qa-id="verify_unverified_{{ email }}"{% trans "Verify" %}</a> |
488 | + {% if num_emails > 1 %} |
489 | + <a href="{% url_with_token 'delete_email' email_address=email.email %}" data-qa-id="delete_unverified_{{ email }}">{% trans "Delete" %}</a> |
490 | + {% endif %} |
491 | + </td> |
492 | + {% endif %} |
493 | + </tr> |
494 | + {% endfor %} |
495 | + </table> |
496 | + </section> |
497 | + {% endif %} |
498 | + |
499 | + {% if not readonly %} |
500 | + <h3>{% trans "Add email address" %}</h3> |
501 | + <p>{% blocktrans %}Enter your email address, and we will send you instructions on how to verify it.{% endblocktrans %}</p> |
502 | + <div class="row"> |
503 | + <div class="col-6"> |
504 | + <form action="{% url_with_token 'new_email' %}" method="post"> |
505 | + {% csrf_token %} |
506 | + <div class="p-form-validation{% if form.newemail.errors %} is-error{% endif %}"> |
507 | + <label for="id_newemail">Email address</label> |
508 | + {{ form.newemail }} |
509 | + {% if form.newemail.errors %} |
510 | + <p class="p-form-validation__message"> |
511 | + <strong>Error:</strong> {{ form.newemail.errors|first }} |
512 | </p> |
513 | - </form> |
514 | - </div> |
515 | + {% endif %} |
516 | + </div> |
517 | + <p class="actions"> |
518 | + <button type="submit" class="p-button--positive" name="continue" data-qa-id="add_new_email">{% trans "Add address" %}</button> |
519 | + <a class="p-button--neutral" href="/">{% trans "Cancel" %}</a> |
520 | + </p> |
521 | + </form> |
522 | </div> |
523 | - {% endif %} |
524 | - </section> |
525 | + </div> |
526 | + {% endif %} |
527 | {% endblock %} |
528 | |
529 | === modified file 'src/webui/templates/account/ssh_keys.html' |
530 | --- src/webui/templates/account/ssh_keys.html 2016-07-13 04:07:52 +0000 |
531 | +++ src/webui/templates/account/ssh_keys.html 2019-08-21 16:17:19 +0000 |
532 | @@ -1,58 +1,123 @@ |
533 | -{% extends "base.html" %} |
534 | +{% extends "vanilla/base.html" %} |
535 | {% load i18n %} |
536 | {% comment %} |
537 | -Copyright 2016 Canonical Ltd. This software is licensed under the |
538 | +Copyright 2016-2019 Canonical Ltd. This software is licensed under the |
539 | GNU Affero General Public License version 3 (see the file LICENSE). |
540 | {% endcomment %} |
541 | |
542 | {% block title %}{% trans "SSH keys" %}{% endblock %} |
543 | |
544 | {% block text_title %} |
545 | - <h1 class="u1-h-main">{% trans "SSH keys" %}</h1> |
546 | + <h1>{% trans "My account" %}</h1> |
547 | {% endblock %} |
548 | |
549 | {% block content %} |
550 | -{% if delete_key_form.fields.ssh_keys.choices %} |
551 | - <section class="delete-ssh-keys"> |
552 | - <form action="" method="POST"> |
553 | - {% csrf_token %} |
554 | - {{ delete_key_form }} |
555 | - <input class="cta" type="submit" name="delete_keys" value="{% trans "Delete Selected Keys" %}"/> |
556 | - </form> |
557 | + <section class="p-strip is-shallow u-no-padding--top"> |
558 | + <h2>{% trans "SSH keys" %}</h2> |
559 | + {% if delete_key_form.fields.ssh_keys.choices %} |
560 | + <section class="delete-ssh-keys"> |
561 | + <form action="" method="POST"> |
562 | + <ul class="p-list--divided"> |
563 | + {% csrf_token %} |
564 | + {% for value, key_info in delete_key_form.fields.ssh_keys.choices %} |
565 | + <li class="p-list__item"> |
566 | + <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> |
567 | + <aside class="p-accordion" role="tablist" aria-multiselect="true"> |
568 | + <ul class="p-accordion__list" style="margin-bottom: 0;"> |
569 | + <li class="p-accordion__group"> |
570 | + <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> |
571 | + <section class="p-accordion__panel" id="tab{{ forloop.counter0 }}-section" role="tabpanel" aria-hidden="true" aria-labelledby="tab{{ forloop.counter0 }}-section"> |
572 | + <dl> |
573 | + <dt>Type</dt> |
574 | + <dd>{{ key_info.type }}</dd> |
575 | + <dt>Text</dt> |
576 | + <dd><code>{{ key_info.text }}</code></dd> |
577 | + </dl> |
578 | + </section> |
579 | + </li> |
580 | + </ul> |
581 | + </aside> |
582 | + </li> |
583 | + {% endfor %} |
584 | + </ul> |
585 | + <input class="p-button--negative" type="submit" name="delete_keys" value="{% trans "Delete selected keys" %}"/> |
586 | + </form> |
587 | + </section> |
588 | + {% endif %} |
589 | + <hr> |
590 | </section> |
591 | -{% endif %} |
592 | - |
593 | -<h3>{% trans "Import new SSH key" %}</h3> |
594 | -<p>{% blocktrans %} |
595 | - Insert the contents of your public key (usually |
596 | - <code>~/.ssh/id_dsa.pub</code> or |
597 | - <code>~/.ssh/id_rsa.pub</code>).</p> |
598 | -<p>Note: Only SSH v2 keys are supported. |
599 | - {% endblocktrans %}</p> |
600 | - |
601 | -<form id="import_key" action="" method="POST"> |
602 | - {% csrf_token %} |
603 | - {{ import_key_form }} |
604 | - <input class="cta" type="submit" name="import_key" value="{% trans "Import SSH key" %}"/> |
605 | -</form> |
606 | + <h3>{% trans "Import new SSH key" %}</h3> |
607 | + <p>{% blocktrans %} |
608 | + Insert the contents of your public key (usually |
609 | + <code>~/.ssh/id_dsa.pub</code> or |
610 | + <code>~/.ssh/id_rsa.pub</code>).</p> |
611 | + <p>Note: Only SSH v2 keys are supported. |
612 | + {% endblocktrans %}</p> |
613 | + |
614 | + <form id="import_key" action="" method="POST"> |
615 | + {% csrf_token %} |
616 | + {{ import_key_form }} |
617 | + <input class="cta" type="submit" name="import_key" value="{% trans "Import SSH key" %}"/> |
618 | + </form> |
619 | {% endblock %} |
620 | + |
621 | {% block extra_js %} |
622 | -<script> |
623 | - var pubkey = document.getElementById('id_ssh_key'); |
624 | - var submit = document.querySelector('.cta'); |
625 | - var keytext = document.querySelector('.key-text'); |
626 | - var keytext_els = document.querySelectorAll('.key-text a'); |
627 | - |
628 | - if (pubkey.disabled) { |
629 | - submit.disabled = true; |
630 | - } |
631 | - |
632 | - if (keytext) { |
633 | - for (i = 0; i < keytext_els.length; ++i) { |
634 | - keytext_els[i].addEventListener('click', function() { |
635 | - this.classList.toggle('key-text-full'); |
636 | - }); |
637 | - } |
638 | - } |
639 | -</script> |
640 | + <script> |
641 | + // var pubkey = document.getElementById('id_ssh_key'); |
642 | + // var submit = document.querySelector('.cta'); |
643 | + // var keytext = document.querySelector('.key-text'); |
644 | + // var keytext_els = document.querySelectorAll('.key-text a'); |
645 | + // |
646 | + // if (pubkey.disabled) { |
647 | + // submit.disabled = true; |
648 | + // } |
649 | + // |
650 | + // if (keytext) { |
651 | + // for (i = 0; i < keytext_els.length; ++i) { |
652 | + // keytext_els[i].addEventListener('click', function() { |
653 | + // this.classList.toggle('key-text-full'); |
654 | + // }); |
655 | + // } |
656 | + // } |
657 | + </script> |
658 | + |
659 | + <script> |
660 | + /** |
661 | + Attaches event listeners for the accordion open and close click events. |
662 | + @param {String} accordionContainerSelector The selector of the accordion container. |
663 | + */ |
664 | + function setupAccordionListener(accordionContainerSelector) { |
665 | + /** |
666 | + Toggles the necessary values on the accordion panels and handles to show or |
667 | + hide depending on the supplied values. |
668 | + @param {HTMLElement} element The tab that acts as the handles for the |
669 | + accordion panes. |
670 | + @param {Boolean} show Whether to show or hide the accordion panel. |
671 | + */ |
672 | + const toggle = (element, show) => { |
673 | + element.setAttribute('aria-expanded', show); |
674 | + document |
675 | + .querySelector(element.getAttribute('aria-controls')) |
676 | + .setAttribute('aria-hidden', !show); |
677 | + } |
678 | + // Set up an event listener on the container so that panels can be added |
679 | + // and removed and events do not need to be managed separately. |
680 | + document |
681 | + .querySelector(accordionContainerSelector) |
682 | + .addEventListener('click', e => { |
683 | + const target = e.target; |
684 | + const isTargetOpen = target.getAttribute('aria-expanded') === 'true'; |
685 | + // Find any open panels within the container and close them. |
686 | + if (target.classList.contains('p-accordion__tab')) { |
687 | + e.currentTarget |
688 | + .querySelectorAll('[aria-expanded=true]') |
689 | + .forEach(element => toggle(element, false)); |
690 | + // Toggle the target. |
691 | + toggle(target, !isTargetOpen); |
692 | + } |
693 | + }); |
694 | + } |
695 | + |
696 | + setupAccordionListener('.delete-ssh-keys'); |
697 | + </script> |
698 | {% endblock %} |
699 | |
700 | === modified file 'src/webui/templates/bad_token.html' |
701 | --- src/webui/templates/bad_token.html 2019-08-05 13:47:39 +0000 |
702 | +++ src/webui/templates/bad_token.html 2019-08-21 16:17:19 +0000 |
703 | @@ -14,7 +14,6 @@ |
704 | {% endblock %} |
705 | |
706 | {% block content %} |
707 | -<section class="p-strip"> |
708 | <div class="row"> |
709 | <div class="col-8"> |
710 | <div class="p-notification--negative"> |
711 | @@ -28,5 +27,4 @@ |
712 | <p><a href="{{ 'support_form'|static_url }}">{{ "support_form"|static_url }}</a></p> |
713 | </div> |
714 | </div> |
715 | -</section> |
716 | {% endblock %} |
717 | |
718 | === modified file 'src/webui/templates/device/addition-generic.html' |
719 | --- src/webui/templates/device/addition-generic.html 2019-08-13 16:55:22 +0000 |
720 | +++ src/webui/templates/device/addition-generic.html 2019-08-21 16:17:19 +0000 |
721 | @@ -18,60 +18,58 @@ |
722 | {% endblock %} |
723 | |
724 | {% block content %} |
725 | - <section class="p-strip"> |
726 | - <h2>{% trans "Add device" %}</h2> |
727 | - <form method="post" action=""> |
728 | - {% csrf_token %} |
729 | - <div class="row"> |
730 | - <div class="p-form-validation is-error col-4"> |
731 | - <label for="id_name">{% trans "Name" %}</label> |
732 | - {{ form.name }} |
733 | - {% if form.name.errors %} |
734 | - <p class="p-form-validation__message"> |
735 | - <strong>Error:</strong> {{ form.name.errors|first }} |
736 | - </p> |
737 | - {% endif %} |
738 | - </div> |
739 | + <h2>{% trans "Add device" %}</h2> |
740 | + <form method="post" action=""> |
741 | + {% csrf_token %} |
742 | + <div class="row"> |
743 | + <div class="p-form-validation is-error col-4"> |
744 | + <label for="id_name">{% trans "Name" %}</label> |
745 | + {{ form.name }} |
746 | + {% if form.name.errors %} |
747 | + <p class="p-form-validation__message"> |
748 | + <strong>Error:</strong> {{ form.name.errors|first }} |
749 | + </p> |
750 | + {% endif %} |
751 | </div> |
752 | - {% block device_instructions %} |
753 | - <p> |
754 | - {% trans "Shared OATH HOTP/TOTP key:" %}<br> |
755 | - <code> |
756 | - {{ formatted_key }} |
757 | - </code> |
758 | - </p> |
759 | - <p> |
760 | - {% blocktrans %}Enter the shared OATH HOTP/TOTP key into your device. |
761 | - You can use both Time and Counter based methods. The system will recognize |
762 | - the one you've used that will be preserved for future authentications.{% endblocktrans %} |
763 | - </p> |
764 | - {% endblock %} |
765 | + </div> |
766 | + {% block device_instructions %} |
767 | + <p> |
768 | + {% trans "Shared OATH HOTP/TOTP key:" %}<br> |
769 | + <code> |
770 | + {{ formatted_key }} |
771 | + </code> |
772 | + </p> |
773 | + <p> |
774 | + {% blocktrans %}Enter the shared OATH HOTP/TOTP key into your device. |
775 | + You can use both Time and Counter based methods. The system will recognize |
776 | + the one you've used that will be preserved for future authentications.{% endblocktrans %} |
777 | + </p> |
778 | + {% endblock %} |
779 | |
780 | - <p>{% blocktrans %} |
781 | - Now, verify your device is configured correctly. Use your device |
782 | - <em>once</em> to generate a one-time password and enter it below. |
783 | - {% endblocktrans %}</p> |
784 | - <div class="row"> |
785 | - <div class="p-form-validation is-error col-4"> |
786 | - <label for="id_otp">{% trans "One-time password:" %}</label> |
787 | - {{ form.otp }} |
788 | - {% if form.otp.errors %} |
789 | + <p>{% blocktrans %} |
790 | + Now, verify your device is configured correctly. Use your device |
791 | + <em>once</em> to generate a one-time password and enter it below. |
792 | + {% endblocktrans %}</p> |
793 | + <div class="row"> |
794 | + <div class="p-form-validation is-error col-4"> |
795 | + <label for="id_otp">{% trans "One-time password:" %}</label> |
796 | + {{ form.otp }} |
797 | + {% if form.otp.errors %} |
798 | + <p class="p-form-validation__message"> |
799 | + <strong>Error:</strong> {{ form.otp.errors|first }} |
800 | + </p> |
801 | + {% else %} |
802 | + {% if error %} |
803 | <p class="p-form-validation__message"> |
804 | - <strong>Error:</strong> {{ form.otp.errors|first }} |
805 | + <strong>Error:</strong> {{ error }} |
806 | </p> |
807 | - {% else %} |
808 | - {% if error %} |
809 | - <p class="p-form-validation__message"> |
810 | - <strong>Error:</strong> {{ error }} |
811 | - </p> |
812 | - {% endif %} |
813 | {% endif %} |
814 | - </div> |
815 | + {% endif %} |
816 | </div> |
817 | - <input type="hidden" name="type" value="{{ type }}"> |
818 | - <input type="hidden" name="hex_key" value="{{ hex_key }}"> |
819 | - <button class="p-button--primary" type="submit" data-qa-id="confirm_add_device">{% trans "Add device" %}</button> |
820 | - <a data-qa-id="cancel_add_device" href="{{ device_list_path }}" class="p-button--neutral">{% trans "cancel" %}</a> |
821 | - </form> |
822 | - </section> |
823 | + </div> |
824 | + <input type="hidden" name="type" value="{{ type }}"> |
825 | + <input type="hidden" name="hex_key" value="{{ hex_key }}"> |
826 | + <button class="p-button--primary" type="submit" data-qa-id="confirm_add_device">{% trans "Add device" %}</button> |
827 | + <a data-qa-id="cancel_add_device" href="{{ device_list_path }}" class="p-button--neutral">{% trans "cancel" %}</a> |
828 | + </form> |
829 | {% endblock %} |
830 | |
831 | === modified file 'src/webui/templates/device/device-help.html' |
832 | --- src/webui/templates/device/device-help.html 2019-08-13 16:55:22 +0000 |
833 | +++ src/webui/templates/device/device-help.html 2019-08-21 16:17:19 +0000 |
834 | @@ -14,42 +14,40 @@ |
835 | {% endblock %} |
836 | |
837 | {% block content %} |
838 | - <section class="p-strip"> |
839 | - <h3>{% trans "Authentication device help" %}</h3> |
840 | - <p> |
841 | - {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %} |
842 | - If your device is lost or stolen or you are having trouble logging in, |
843 | - please review the |
844 | - <a href="{{2FFAQ}}#Help">2-Factor Auth FAQ</a> |
845 | - for details on how to get help and the type of information you will need |
846 | - to provide. |
847 | - {% endblocktrans %} |
848 | - </p> |
849 | - |
850 | - <h3>{% trans "Device lost or stolen?" %}</h3> |
851 | - <p> |
852 | - {% blocktrans %}We need to remove the device from your account to prevent |
853 | - someone using it to gain access to your account. Please contact us |
854 | - immediately to resolve this! You can reach ISD in the #isd channel on |
855 | - IRC, or IS in the #webops channel, or phone the IS emergency helpline. |
856 | - {% endblocktrans %} |
857 | - </p> |
858 | - |
859 | - <h3>{% trans "Problems logging in?" %}</h3> |
860 | - <p> |
861 | - {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %} |
862 | - We can help get a device working again or set you up with some temporary |
863 | - tokens to enable you to continue with your work. If it's not urgent, |
864 | - please send email to the ISD Support address as described in the |
865 | - <a href="{{2FFAQ}}#Help">2-Factor Auth FAQ</a> |
866 | - and someone will get back to you soon. |
867 | - {% endblocktrans %} |
868 | - </p> |
869 | - {% if support_phone %} |
870 | - <p> |
871 | - {% blocktrans %}If it is urgent, please phone the IS emergency helpline at |
872 | - <span id="support-phone">{{ support_phone }}</span>.{% endblocktrans %} |
873 | - </p> |
874 | - {% endif %} |
875 | - </section> |
876 | + <h3>{% trans "Authentication device help" %}</h3> |
877 | + <p> |
878 | + {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %} |
879 | + If your device is lost or stolen or you are having trouble logging in, |
880 | + please review the |
881 | + <a href="{{2FFAQ}}#Help">2-Factor Auth FAQ</a> |
882 | + for details on how to get help and the type of information you will need |
883 | + to provide. |
884 | + {% endblocktrans %} |
885 | + </p> |
886 | + |
887 | + <h3>{% trans "Device lost or stolen?" %}</h3> |
888 | + <p> |
889 | + {% blocktrans %}We need to remove the device from your account to prevent |
890 | + someone using it to gain access to your account. Please contact us |
891 | + immediately to resolve this! You can reach ISD in the #isd channel on |
892 | + IRC, or IS in the #webops channel, or phone the IS emergency helpline. |
893 | + {% endblocktrans %} |
894 | + </p> |
895 | + |
896 | + <h3>{% trans "Problems logging in?" %}</h3> |
897 | + <p> |
898 | + {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %} |
899 | + We can help get a device working again or set you up with some temporary |
900 | + tokens to enable you to continue with your work. If it's not urgent, |
901 | + please send email to the ISD Support address as described in the |
902 | + <a href="{{2FFAQ}}#Help">2-Factor Auth FAQ</a> |
903 | + and someone will get back to you soon. |
904 | + {% endblocktrans %} |
905 | + </p> |
906 | + {% if support_phone %} |
907 | + <p> |
908 | + {% blocktrans %}If it is urgent, please phone the IS emergency helpline at |
909 | + <span id="support-phone">{{ support_phone }}</span>.{% endblocktrans %} |
910 | + </p> |
911 | + {% endif %} |
912 | {% endblock %} |
913 | |
914 | === modified file 'src/webui/templates/device/list.html' |
915 | --- src/webui/templates/device/list.html 2019-08-13 16:55:22 +0000 |
916 | +++ src/webui/templates/device/list.html 2019-08-21 16:17:19 +0000 |
917 | @@ -17,7 +17,6 @@ |
918 | {% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %} |
919 | |
920 | {% block content %} |
921 | -<section class="p-strip"> |
922 | {% include "vanilla/common/missing_backup_device_warning.html" %} |
923 | {% include "vanilla/common/printed_codes_nearly_exhausted_warning.html" %} |
924 | <div id="auth-devices"> |
925 | @@ -59,5 +58,4 @@ |
926 | <a href="{{ 2FFAQ }}">2-Factor Auth FAQ</a> |
927 | {% endblocktrans %}</p> |
928 | </div> |
929 | -</section> |
930 | {% endblock %} |
931 | |
932 | === modified file 'src/webui/templates/device/removal.html' |
933 | --- src/webui/templates/device/removal.html 2019-08-13 16:55:22 +0000 |
934 | +++ src/webui/templates/device/removal.html 2019-08-21 16:17:19 +0000 |
935 | @@ -16,17 +16,15 @@ |
936 | {% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %} |
937 | |
938 | {% block content %} |
939 | - <section class="p-strip"> |
940 | - <h2>{% trans "Delete device?" %}</h2> |
941 | - <p>{% blocktrans %}Are you sure that you want to delete the following |
942 | - authentication device?{% endblocktrans %}</p> |
943 | - |
944 | - <p class="device-name" data-qa-id="device_removal_device_name">{{ name }}</p> |
945 | - |
946 | - <form method="post" action=""> |
947 | - {% csrf_token %} |
948 | - <button class="p-button--negative" type="submit" data-qa-id="delete_this_device">{% trans "Delete this device" %}</button> |
949 | - <a class="p-button--neutral" data-qa-id="cancel_deleting_this_device" href="{{ device_list_path }}">{% trans "Cancel" %}</a> |
950 | - </form> |
951 | - </section> |
952 | + <h2>{% trans "Delete device?" %}</h2> |
953 | + <p>{% blocktrans %}Are you sure that you want to delete the following |
954 | + authentication device?{% endblocktrans %}</p> |
955 | + |
956 | + <p class="device-name" data-qa-id="device_removal_device_name">{{ name }}</p> |
957 | + |
958 | + <form method="post" action=""> |
959 | + {% csrf_token %} |
960 | + <button class="p-button--negative" type="submit" data-qa-id="delete_this_device">{% trans "Delete this device" %}</button> |
961 | + <a class="p-button--neutral" data-qa-id="cancel_deleting_this_device" href="{{ device_list_path }}">{% trans "Cancel" %}</a> |
962 | + </form> |
963 | {% endblock %} |
964 | |
965 | === modified file 'src/webui/templates/device/rename.html' |
966 | --- src/webui/templates/device/rename.html 2019-08-13 16:55:22 +0000 |
967 | +++ src/webui/templates/device/rename.html 2019-08-21 16:17:19 +0000 |
968 | @@ -16,23 +16,21 @@ |
969 | {% block text_title %}<h1 class="u1-h-main">{% trans "My account" %}</h1>{% endblock %} |
970 | |
971 | {% block content %} |
972 | - <section class="p-strip"> |
973 | - <h2>{% trans "Rename device" %}</h2> |
974 | - <form method="post" action=""> |
975 | - {% csrf_token %} |
976 | - <div class="row"> |
977 | - <div class="p-form-validation is-error col-4"> |
978 | - <label for="id_name">Name</label> |
979 | - {{ form.name }} |
980 | - {% if form.name.errors %} |
981 | - <p class="p-form-validation__message"> |
982 | - <strong>Error:</strong> {{ form.name.errors|first }} |
983 | - </p> |
984 | - {% endif %} |
985 | - </div> |
986 | + <h2>{% trans "Rename device" %}</h2> |
987 | + <form method="post" action=""> |
988 | + {% csrf_token %} |
989 | + <div class="row"> |
990 | + <div class="p-form-validation is-error col-4"> |
991 | + <label for="id_name">Name</label> |
992 | + {{ form.name }} |
993 | + {% if form.name.errors %} |
994 | + <p class="p-form-validation__message"> |
995 | + <strong>Error:</strong> {{ form.name.errors|first }} |
996 | + </p> |
997 | + {% endif %} |
998 | </div> |
999 | - <button class="p-button--positive" type="submit" data-qa-id="rename_this_device">{% trans "Rename" %}</button> |
1000 | - <a class="p-button--neutral" href="{{ device_list_path }}" data-qa-id="cancel_renaming_this_device">{% trans "Cancel" %}</a> |
1001 | - </form> |
1002 | - </section> |
1003 | + </div> |
1004 | + <button class="p-button--positive" type="submit" data-qa-id="rename_this_device">{% trans "Rename" %}</button> |
1005 | + <a class="p-button--neutral" href="{{ device_list_path }}" data-qa-id="cancel_renaming_this_device">{% trans "Cancel" %}</a> |
1006 | + </form> |
1007 | {% endblock %} |
1008 | |
1009 | === modified file 'src/webui/templates/device/types.html' |
1010 | --- src/webui/templates/device/types.html 2019-08-13 16:55:22 +0000 |
1011 | +++ src/webui/templates/device/types.html 2019-08-21 16:17:19 +0000 |
1012 | @@ -18,69 +18,65 @@ |
1013 | {% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %} |
1014 | |
1015 | {% block content %} |
1016 | - <section class="p-strip"> |
1017 | - <h2>{% trans "Add a new authentication device" %}</h2> |
1018 | - <form method="post" action=""> |
1019 | - {% csrf_token %} |
1020 | - |
1021 | - <ul class="p-list"> |
1022 | - <li class="p-list__item"> |
1023 | - <div class="row"> |
1024 | - <div class="col-3"> |
1025 | - <input type="radio" name="type" value="google" id="type_google" checked="checked"> |
1026 | - <label for="type_google">{% trans "Smartphone or Tablet" %}</label> |
1027 | - </div> |
1028 | - <div class="col-5"> |
1029 | - <p>{% blocktrans %}Android, Apple, or Blackberry mobile device with the Google Authenticator app; or Windows phone with the Auth7 app{% endblocktrans %}</p> |
1030 | - </div> |
1031 | - </div> |
1032 | - </li> |
1033 | - <li class="p-list__item"> |
1034 | - <div class="row"> |
1035 | - <div class="col-3 col-medium-3"> |
1036 | - <input type="radio" name="type" value="yubi" id="type_yubi"> |
1037 | - <label for="type_yubi">{% trans "YubiKey" %}</label> |
1038 | - </div> |
1039 | - <div class="col-5 col-medium-3"> |
1040 | - <p>{% blocktrans %}USB YubiKey one time password generator{% endblocktrans %}</p> |
1041 | - </div> |
1042 | - </div> |
1043 | - </li> |
1044 | - <li class="p-list__item"> |
1045 | - <div class="row"> |
1046 | - <div class="col-3 col-medium-3"> |
1047 | - <input type="radio" name="type" value="generic" id="type_generic"> |
1048 | - <label for="type_generic">{% trans "Generic HOTP/TOTP device" %}</label> |
1049 | - </div> |
1050 | - <div class="col-5 col-medium-3"> |
1051 | - <p>{% blocktrans %}Any other OATH HOTP/TOTP compatible device{% endblocktrans %}</p> |
1052 | - </div> |
1053 | - </div> |
1054 | - </li> |
1055 | - <li class="p-list__item"> |
1056 | - <div class="row"> |
1057 | - <div class="col-3 col-medium-3"> |
1058 | - <input type="radio" name="type" value="paper" id="type_paper"> |
1059 | - <label for="type_paper">{% trans "Printable Backup Codes" %}</label> |
1060 | - </div> |
1061 | - <div class="col-5 col-medium-3"> |
1062 | - <p>{% blocktrans %}A list of backup codes to |
1063 | - print.{% endblocktrans %}</p> |
1064 | - </div> |
1065 | - </div> |
1066 | - </li> |
1067 | - </ul> |
1068 | - |
1069 | - <button class="p-button--positive" type="submit" data-qa-id="add_device_from_type">{% trans "Add device" %}</button> |
1070 | - <a class="p-button--neutral" data-qa-id="cancel_add_device_from_type" href="{{ device_list_path }}">{% trans "Cancel" %}</a> |
1071 | - <p> |
1072 | - {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %} |
1073 | - The <a href="{{2FFAQ}}#Devices">2-Factor Auth FAQ</a> |
1074 | - has details on compatible devices. |
1075 | - {% endblocktrans %} |
1076 | - </p> |
1077 | - |
1078 | - |
1079 | - </form> |
1080 | - </section> |
1081 | + <h2>{% trans "Add a new authentication device" %}</h2> |
1082 | + <form method="post" action=""> |
1083 | + {% csrf_token %} |
1084 | + |
1085 | + <ul class="p-list"> |
1086 | + <li class="p-list__item"> |
1087 | + <div class="row"> |
1088 | + <div class="col-3"> |
1089 | + <input type="radio" name="type" value="google" id="type_google" checked="checked"> |
1090 | + <label for="type_google">{% trans "Smartphone or Tablet" %}</label> |
1091 | + </div> |
1092 | + <div class="col-5"> |
1093 | + <p>{% blocktrans %}Android, Apple, or Blackberry mobile device with the Google Authenticator app; or Windows phone with the Auth7 app{% endblocktrans %}</p> |
1094 | + </div> |
1095 | + </div> |
1096 | + </li> |
1097 | + <li class="p-list__item"> |
1098 | + <div class="row"> |
1099 | + <div class="col-3 col-medium-3"> |
1100 | + <input type="radio" name="type" value="yubi" id="type_yubi"> |
1101 | + <label for="type_yubi">{% trans "YubiKey" %}</label> |
1102 | + </div> |
1103 | + <div class="col-5 col-medium-3"> |
1104 | + <p>{% blocktrans %}USB YubiKey one time password generator{% endblocktrans %}</p> |
1105 | + </div> |
1106 | + </div> |
1107 | + </li> |
1108 | + <li class="p-list__item"> |
1109 | + <div class="row"> |
1110 | + <div class="col-3 col-medium-3"> |
1111 | + <input type="radio" name="type" value="generic" id="type_generic"> |
1112 | + <label for="type_generic">{% trans "Generic HOTP/TOTP device" %}</label> |
1113 | + </div> |
1114 | + <div class="col-5 col-medium-3"> |
1115 | + <p>{% blocktrans %}Any other OATH HOTP/TOTP compatible device{% endblocktrans %}</p> |
1116 | + </div> |
1117 | + </div> |
1118 | + </li> |
1119 | + <li class="p-list__item"> |
1120 | + <div class="row"> |
1121 | + <div class="col-3 col-medium-3"> |
1122 | + <input type="radio" name="type" value="paper" id="type_paper"> |
1123 | + <label for="type_paper">{% trans "Printable Backup Codes" %}</label> |
1124 | + </div> |
1125 | + <div class="col-5 col-medium-3"> |
1126 | + <p>{% blocktrans %}A list of backup codes to |
1127 | + print.{% endblocktrans %}</p> |
1128 | + </div> |
1129 | + </div> |
1130 | + </li> |
1131 | + </ul> |
1132 | + |
1133 | + <button class="p-button--positive" type="submit" data-qa-id="add_device_from_type">{% trans "Add device" %}</button> |
1134 | + <a class="p-button--neutral" data-qa-id="cancel_add_device_from_type" href="{{ device_list_path }}">{% trans "Cancel" %}</a> |
1135 | + <p> |
1136 | + {% blocktrans with "twofactor_faq"|static_url as 2FFAQ %} |
1137 | + The <a href="{{2FFAQ}}#Devices">2-Factor Auth FAQ</a> |
1138 | + has details on compatible devices. |
1139 | + {% endblocktrans %} |
1140 | + </p> |
1141 | + </form> |
1142 | {% endblock %} |
1143 | |
1144 | === modified file 'src/webui/templates/registration/email_sent.html' |
1145 | --- src/webui/templates/registration/email_sent.html 2019-08-12 10:26:16 +0000 |
1146 | +++ src/webui/templates/registration/email_sent.html 2019-08-21 16:17:19 +0000 |
1147 | @@ -16,10 +16,7 @@ |
1148 | <h1>{{ email_heading }}</h1> |
1149 | {% endblock %} |
1150 | |
1151 | -{% block content_class %}{% endblock %} |
1152 | - |
1153 | {% block content %} |
1154 | -<section class="p-strip"> |
1155 | <div class="row"> |
1156 | <div class="col-8"> |
1157 | <h2 class="p-heading--three">{% trans "Step 2 of 3: Check your email" %}</h2> |
1158 | @@ -41,7 +38,6 @@ |
1159 | </div> |
1160 | </div> |
1161 | </div> |
1162 | -</section> |
1163 | {% if user.is_authenticated %}</div>{% endif %} |
1164 | |
1165 | {% endblock %} |
1166 | |
1167 | === modified file 'src/webui/templates/registration/forgot_password.html' |
1168 | --- src/webui/templates/registration/forgot_password.html 2019-08-12 10:26:16 +0000 |
1169 | +++ src/webui/templates/registration/forgot_password.html 2019-08-21 16:17:19 +0000 |
1170 | @@ -19,7 +19,6 @@ |
1171 | {% block content_class %}{% endblock %} |
1172 | |
1173 | {% block content %} |
1174 | -<section class="p-strip"> |
1175 | <div class="row"> |
1176 | <div class="col-8"> |
1177 | <h2 class="p-heading--three">{% trans "Step 1 of 3: Type your email address" %}</h2> |
1178 | @@ -48,5 +47,4 @@ |
1179 | </form> |
1180 | </div> |
1181 | </div> |
1182 | -</section> |
1183 | {% endblock %} |
1184 | |
1185 | === modified file 'src/webui/templates/registration/login.html' |
1186 | --- src/webui/templates/registration/login.html 2019-08-12 10:26:16 +0000 |
1187 | +++ src/webui/templates/registration/login.html 2019-08-21 16:17:19 +0000 |
1188 | @@ -42,8 +42,6 @@ |
1189 | {% block content_class %}{% endblock %} |
1190 | |
1191 | {% block content %} |
1192 | - |
1193 | -<section class="p-strip"> |
1194 | <div class="row"> |
1195 | {% if form.email.errors or form.password.errors or form.oath_token.errors or form.non_field_errors %} |
1196 | <div class="col-6"> |
1197 | @@ -84,8 +82,6 @@ |
1198 | </div> |
1199 | </aside> |
1200 | </div> |
1201 | -</section> |
1202 | - |
1203 | {% endblock %} |
1204 | |
1205 | {% block extra_js %} |
1206 | |
1207 | === modified file 'src/webui/templates/registration/logout.html' |
1208 | --- src/webui/templates/registration/logout.html 2019-08-12 10:26:16 +0000 |
1209 | +++ src/webui/templates/registration/logout.html 2019-08-21 16:17:19 +0000 |
1210 | @@ -17,20 +17,18 @@ |
1211 | {% block content_class %}{% endblock %} |
1212 | |
1213 | {% block content %} |
1214 | - <section class="p-strip"> |
1215 | - <div class="row"> |
1216 | - <div class="col-8"> |
1217 | - <p>{% blocktrans %}You are now logged out of the Ubuntu One website. However, you have not been automatically logged out of every website that uses this service.{% endblocktrans %}</p> |
1218 | + <div class="row"> |
1219 | + <div class="col-8"> |
1220 | + <p>{% blocktrans %}You are now logged out of the Ubuntu One website. However, you have not been automatically logged out of every website that uses this service.{% endblocktrans %}</p> |
1221 | |
1222 | - {% if return_to_url %} |
1223 | - <p> |
1224 | - <a href="{{ return_to_url }}">{% blocktrans %}Return to {{ return_to_site_name }}{% endblocktrans %}</a> |
1225 | - </p> |
1226 | - {% endif %} |
1227 | - </div> |
1228 | + {% if return_to_url %} |
1229 | + <p> |
1230 | + <a href="{{ return_to_url }}">{% blocktrans %}Return to {{ return_to_site_name }}{% endblocktrans %}</a> |
1231 | + </p> |
1232 | + {% endif %} |
1233 | </div> |
1234 | - {% if other_sites %} |
1235 | - {% include "widgets/other_sites.html" %} |
1236 | - {% endif %} |
1237 | - </section> |
1238 | + </div> |
1239 | + {% if other_sites %} |
1240 | + {% include "widgets/other_sites.html" %} |
1241 | + {% endif %} |
1242 | {% endblock %} |
1243 | |
1244 | === modified file 'src/webui/templates/registration/new_account.html' |
1245 | --- src/webui/templates/registration/new_account.html 2019-08-12 10:26:16 +0000 |
1246 | +++ src/webui/templates/registration/new_account.html 2019-08-21 16:17:19 +0000 |
1247 | @@ -30,8 +30,6 @@ |
1248 | {% block content_class %}{% endblock %} |
1249 | |
1250 | {% block content %} |
1251 | - |
1252 | -<section class="p-strip"> |
1253 | <div class="row"> |
1254 | <div class="col-6 create-account"> |
1255 | {% with selected_form="create" %} |
1256 | @@ -49,8 +47,6 @@ |
1257 | </div> |
1258 | </aside> |
1259 | </div> |
1260 | -</section> |
1261 | - |
1262 | {% endblock %} |
1263 | |
1264 | {% block extra_js %} |
1265 | |
1266 | === modified file 'src/webui/templates/registration/reset_password.html' |
1267 | --- src/webui/templates/registration/reset_password.html 2019-08-12 10:26:16 +0000 |
1268 | +++ src/webui/templates/registration/reset_password.html 2019-08-21 16:17:19 +0000 |
1269 | @@ -19,7 +19,6 @@ |
1270 | {% block content_class %}{% endblock %} |
1271 | |
1272 | {% block content %} |
1273 | -<section class="p-strip"> |
1274 | <div class="row"> |
1275 | <div class="col-6"> |
1276 | <h2 class="p-heading--three">{% trans "Step 3 of 3: Choose a new password" %}</h2> |
1277 | @@ -32,7 +31,6 @@ |
1278 | </form> |
1279 | </div> |
1280 | </div> |
1281 | -</section> |
1282 | {% endblock %} |
1283 | |
1284 | {% block extra_js %} |
1285 | |
1286 | === modified file 'src/webui/templates/ssh_messages/username_unset.html' |
1287 | --- src/webui/templates/ssh_messages/username_unset.html 2016-11-01 10:53:35 +0000 |
1288 | +++ src/webui/templates/ssh_messages/username_unset.html 2019-08-21 16:17:19 +0000 |
1289 | @@ -1,5 +1,5 @@ |
1290 | {% load i18n %} |
1291 | {% blocktrans %} |
1292 | -<p>To import an ssh key, you must have a username set in your Personal Details.</p> |
1293 | +To import an ssh key, you must have a username set in your Personal Details. |
1294 | {% endblocktrans %} |
1295 | -<p><a href="{% url 'account-index' %}">Edit Personal details</a></p> |
1296 | +<a href="{% url 'account-index' %}">Edit Personal details</a></p> |
1297 | |
1298 | === modified file 'src/webui/templates/static/faq.html' |
1299 | --- src/webui/templates/static/faq.html 2019-08-12 10:26:16 +0000 |
1300 | +++ src/webui/templates/static/faq.html 2019-08-21 16:17:19 +0000 |
1301 | @@ -24,7 +24,6 @@ |
1302 | {% url 'account-emails' as emails_url %} |
1303 | {% url 'forgot_password' as forgot_url %} |
1304 | {% url 'delete_account' as delete_url %} |
1305 | -<section class="p-strip"> |
1306 | <div class="row"> |
1307 | <div class="col-8"> |
1308 | {% trans "What is an Ubuntu One account?" as q %} |
1309 | @@ -379,7 +378,6 @@ |
1310 | </div> |
1311 | </div> |
1312 | </div> |
1313 | -</section> |
1314 | {% endblock %} |
1315 | |
1316 | {% block extra_js %} |
1317 | |
1318 | === modified file 'src/webui/templates/static/ubuntuone-account.html' |
1319 | --- src/webui/templates/static/ubuntuone-account.html 2019-07-16 16:01:05 +0000 |
1320 | +++ src/webui/templates/static/ubuntuone-account.html 2019-08-21 16:17:19 +0000 |
1321 | @@ -16,7 +16,6 @@ |
1322 | {% block text_title %}<h1>{% trans "Your Ubuntu One account" %}</h1>{% endblock %} |
1323 | |
1324 | {% block content %} |
1325 | -<section class="p-strip"> |
1326 | <div class="row"> |
1327 | <div class="col-8"> |
1328 | <h3>{% trans "One account to log in to everything on Ubuntu" %}</h3> |
1329 | @@ -46,5 +45,4 @@ |
1330 | </div> |
1331 | </div> |
1332 | </div> |
1333 | -</section> |
1334 | {% endblock %} |
1335 | |
1336 | === modified file 'src/webui/templates/vanilla/base.html' |
1337 | --- src/webui/templates/vanilla/base.html 2019-08-13 14:32:34 +0000 |
1338 | +++ src/webui/templates/vanilla/base.html 2019-08-21 16:17:19 +0000 |
1339 | @@ -59,36 +59,38 @@ |
1340 | {% endif %} |
1341 | {% endblock %} |
1342 | <div class="{% block content_class %}col-8{% endblock %}"> |
1343 | - {% block readonly %} |
1344 | - {% if readonly %} |
1345 | - <div class="p-notification--caution"> |
1346 | - <p class="p-notification__response"> |
1347 | - {% 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 %} |
1348 | - </p> |
1349 | - </div> |
1350 | - {% endif %} |
1351 | - {% endblock %} |
1352 | - {% block messages %} |
1353 | - {% if messages %} |
1354 | - <section class="p-strip is-shallow"> |
1355 | - {% for message in messages %} |
1356 | - <div class="row"> |
1357 | - <div class="col-12"> |
1358 | - <div class="p-notification"> |
1359 | - <p class="p-notification__response"> |
1360 | - {{ message }} |
1361 | - </p> |
1362 | + <section class="p-strip"> |
1363 | + {% block readonly %} |
1364 | + {% if readonly %} |
1365 | + <div class="p-notification--caution"> |
1366 | + <p class="p-notification__response"> |
1367 | + {% 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 %} |
1368 | + </p> |
1369 | + </div> |
1370 | + {% endif %} |
1371 | + {% endblock %} |
1372 | + {% block messages %} |
1373 | + {% if messages %} |
1374 | + <section class="p-strip is-shallow"> |
1375 | + {% for message in messages %} |
1376 | + <div class="row"> |
1377 | + <div class="col-12"> |
1378 | + <div class="p-notification"> |
1379 | + <p class="p-notification__response"> |
1380 | + {{ message }} |
1381 | + </p> |
1382 | + </div> |
1383 | </div> |
1384 | </div> |
1385 | - </div> |
1386 | - {% endfor %} |
1387 | - </section> |
1388 | - {% endif %} |
1389 | - {% endblock %} |
1390 | - {% block content %}{% endblock %} |
1391 | + {% endfor %} |
1392 | + </section> |
1393 | + {% endif %} |
1394 | + {% endblock %} |
1395 | + {% block content %}{% endblock %} |
1396 | + </section> |
1397 | </div> |
1398 | </div> |
1399 | - |
1400 | + </section> |
1401 | </div><!-- close #content --> |
1402 | |
1403 | {% include "vanilla/_footer.html" %} |
Code looks good, few comments inline. I think QA is better in person tomorrow.