Merge lp:~deadlight/canonical-identity-provider/my-account into lp:~deadlight/canonical-identity-provider/vanilla
- my-account
- Merge into vanilla
Proposed by
Karl Williams
Status: | Merged |
---|---|
Approved by: | Karl Williams |
Approved revision: | 1700 |
Merged at revision: | 1700 |
Proposed branch: | lp:~deadlight/canonical-identity-provider/my-account |
Merge into: | lp:~deadlight/canonical-identity-provider/vanilla |
Diff against target: |
681 lines (+300/-173) 17 files modified
src/identityprovider/forms.py (+2/-2) src/identityprovider/static_src/scss/styles.scss (+24/-0) src/webui/templates/account/edit.html (+111/-160) src/webui/templates/registration/email_sent.html (+2/-0) src/webui/templates/registration/forgot_password.html (+2/-0) src/webui/templates/registration/login.html (+2/-0) src/webui/templates/registration/logout.html (+2/-0) src/webui/templates/registration/new_account.html (+2/-0) src/webui/templates/registration/reset_password.html (+2/-0) src/webui/templates/static/faq.html (+1/-0) src/webui/templates/vanilla/_footer.html (+1/-1) src/webui/templates/vanilla/base.html (+11/-10) src/webui/templates/vanilla/common/missing_backup_device_warning.html (+19/-0) src/webui/templates/vanilla/common/printed_codes_nearly_exhausted_warning.html (+15/-0) src/webui/templates/vanilla/common/unverified_email_warning.html (+14/-0) src/webui/templates/vanilla/widgets/passwords.html (+40/-0) src/webui/templates/vanilla/widgets/personal-menu.html (+50/-0) |
To merge this branch: | bzr merge lp:~deadlight/canonical-identity-provider/my-account |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Anthony Dillon (community) | Approve | ||
Karl Williams | Pending | ||
Review via email: mp+371201@code.launchpad.net |
Commit message
Description of the change
Converted the My Account page to Vanilla Framework
QA:
- npm i
- ./node_
In container:
- source env/bin/activate
- make mail-debug
In container (new terminal)
- source env/bin/activate
- make start-db
- make run
- Visit http://[CONTAINER IP]:8000/ in your browser
- Create an account using the form
- See that you are prompted to confirm your account
- Look at the "mail-debug" terminal and copy the link to confirm your account
- QA the page visually and functionally
- Add auth devices and backup codes to see how the page changes
NOTE: The radio buttons on the auth device section do not yet work and are not visible
To post a comment you must log in.
Revision history for this message
Barry McGee (barry-mcgee) wrote : | # |
- 1699. By Karl Williams
-
Remove superfluous spaces
- 1700. By Karl Williams
-
Add border to left menu
Revision history for this message
Karl Williams (deadlight) : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/identityprovider/forms.py' |
2 | --- src/identityprovider/forms.py 2019-06-18 20:13:31 +0000 |
3 | +++ src/identityprovider/forms.py 2019-08-12 13:50:47 +0000 |
4 | @@ -290,8 +290,8 @@ |
5 | emails_url = reverse('account-emails') |
6 | text = _( |
7 | 'Only verified email addresses are listed. Click ' |
8 | - '<a href="%s">Manage email addresses</a> ' |
9 | - 'to add and verify email addresses.') % emails_url |
10 | + '"Manage email addresses" ' |
11 | + 'to add and verify email addresses.') |
12 | |
13 | # add and display a dropdown with the valid choices |
14 | self.fields['preferred_email'] = PreferredEmailField( |
15 | |
16 | === modified file 'src/identityprovider/static_src/scss/styles.scss' |
17 | --- src/identityprovider/static_src/scss/styles.scss 2019-08-05 13:10:19 +0000 |
18 | +++ src/identityprovider/static_src/scss/styles.scss 2019-08-12 13:50:47 +0000 |
19 | @@ -31,3 +31,27 @@ |
20 | display: none; |
21 | } |
22 | } |
23 | + |
24 | +//Side navigation for logged in users |
25 | +.p-sidebar { |
26 | + border-right: 1px solid $color-mid-light; |
27 | + |
28 | + .is-active { |
29 | + position: relative; |
30 | + |
31 | + &::before { |
32 | + background-color: $color-mid-light; |
33 | + bottom: -$spv-inner--x-small; |
34 | + content: ''; |
35 | + left: -$sph-inner; |
36 | + position: absolute; |
37 | + top: -$spv-inner--x-small; |
38 | + width: $bar-thickness; |
39 | + } |
40 | + } |
41 | +} |
42 | + |
43 | +// Fix for mixed buttons |
44 | +[class^="p-button"] + [class^="p-button"] { |
45 | + margin-left: $sph-inner; |
46 | +} |
47 | |
48 | === modified file 'src/webui/templates/account/edit.html' |
49 | --- src/webui/templates/account/edit.html 2018-07-31 15:57:21 +0000 |
50 | +++ src/webui/templates/account/edit.html 2019-08-12 13:50:47 +0000 |
51 | @@ -1,207 +1,158 @@ |
52 | -{% extends "base.html" %} |
53 | +{% extends "vanilla/base.html" %} |
54 | {% load i18n static url_with_token %} |
55 | |
56 | {% comment %} |
57 | -Copyright 2010 Canonical Ltd. This software is licensed under the |
58 | +Copyright 2010-2019 Canonical Ltd. This software is licensed under the |
59 | GNU Affero General Public License version 3 (see the file LICENSE). |
60 | {% endcomment %} |
61 | |
62 | {% block html_extra %}data-qa-id="edit_account"{% endblock %} |
63 | |
64 | {% block title %} |
65 | - {% blocktrans %}Personal details{% endblocktrans %} |
66 | + {% blocktrans %}Personal details{% endblocktrans %} |
67 | {% endblock %} |
68 | |
69 | -{% block text_title %}<h1 class="u1-h-main">{% trans "Personal details" %}</h1>{% endblock %} |
70 | +{% block text_title %}<h1>{% trans "My account" %}</h1>{% endblock %} |
71 | |
72 | {% block extra_css %} |
73 | |
74 | - {% if last_authenticated_sites %} |
75 | + {% if last_authenticated_sites %} |
76 | <style type="text/css"> |
77 | - {% for site in last_authenticated_sites %} |
78 | + {% for site in last_authenticated_sites %} |
79 | {% if rpconfig.logo_url %} |
80 | - a[href='{{site.trust_root}}'] { |
81 | + a[href='{{site.trust_root}}'] { |
82 | background-image: url('{{ rpconfig.logo_url }}'); |
83 | background-repeat: no-repeat; |
84 | background-position: 0 0; |
85 | padding-left: 24px; |
86 | padding-top: 1px; |
87 | - } |
88 | + } |
89 | {% endif %} |
90 | - {% endfor %} |
91 | + {% endfor %} |
92 | </style> |
93 | - {% endif %} |
94 | + {% endif %} |
95 | |
96 | {% endblock %} |
97 | |
98 | {% block content %} |
99 | - |
100 | -<div> |
101 | -{% include "common/unverified_email_warning.html" %} |
102 | -{% include "common/missing_backup_device_warning.html" %} |
103 | -{% include "common/printed_codes_nearly_exhausted_warning.html" %} |
104 | -</div> |
105 | - |
106 | -<form action="" method="post" class="edit-account-details" data-qa-id="edit_fieldsets"> |
107 | - {% csrf_token %} |
108 | - <fieldset class=""> |
109 | - |
110 | - <div data-qa-id="personal_details"></div> |
111 | - |
112 | - <div class="{% if form.displayname.errors %}haserrors {% endif %}name-input input-row"> |
113 | + <section class="p-strip"> |
114 | + {% include "vanilla/common/unverified_email_warning.html" %} |
115 | + {% include "vanilla/common/missing_backup_device_warning.html" %} |
116 | + {% include "vanilla/common/printed_codes_nearly_exhausted_warning.html" %} |
117 | + <h2>Personal details</h2> |
118 | + <form action="" method="post" class="edit-account-details" data-qa-id="edit_fieldsets"> |
119 | + {% csrf_token %} |
120 | + <div data-qa-id="personal_details"></div> |
121 | + |
122 | + <div class="row"> |
123 | + <div class="col-8"> |
124 | + <div class="p-form-validation{% if form.displayname.errors %} is-error{% endif %}"> |
125 | <label class="formLabel" for="id_displayname">{% trans "Full name:" %}</label> |
126 | {{ form.displayname }} |
127 | {% if form.displayname.errors %} |
128 | - <span class="error"> |
129 | - {{ form.displayname.errors|first }} |
130 | - </span> |
131 | + <p class="p-form-validation__message"> |
132 | + <strong>Error:</strong> {{ form.displayname.errors|first }} |
133 | + </p> |
134 | {% endif %} |
135 | - </div> |
136 | + </div> |
137 | |
138 | - {% if form.username %} |
139 | - <div class="{% if form.username.errors %}haserrors {% endif %}username-input input-row"> |
140 | + {% if form.username %} |
141 | + <div class="p-form-validation{% if form.username.errors %} is-error{% endif %}"> |
142 | <label class="formLabel" for="id_username">{% trans "Username:" %}</label> |
143 | {{ form.username }} |
144 | {% if form.username.errors %} |
145 | - <span class="error"> |
146 | - {{ form.username.errors|first }} |
147 | - </span> |
148 | + <p class="p-form-validation__message"> |
149 | + <strong>Error:</strong> {{ form.username.errors|first }} |
150 | + </p> |
151 | {% endif %} |
152 | - </div> |
153 | - {% endif %} |
154 | + </div> |
155 | + {% endif %} |
156 | |
157 | - <div class="{% if form.preferred_email.errors %}haserrors {% endif %}preferred-email-input input-row"> |
158 | + <div class="p-form-validation {{% if form.preferred_email.errors %} is-error{% endif %}"> |
159 | <label class="formLabel tooltip" for="id_preferred_email"> |
160 | - {% trans "Preferred email address:" %} |
161 | - |
162 | - <span class="description tooltip sprite help question-mark" |
163 | - title="{%spaceless%} |
164 | - {% blocktrans %}This email address is passed on to other sites when requested as part of the login process.{% endblocktrans %} |
165 | - {{ form.preferred_email.help_text }} |
166 | - {% endspaceless %}"> |
167 | - ? |
168 | - </span> |
169 | - |
170 | + {% 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> |
171 | </label> |
172 | |
173 | {% if form.preferred_email %} |
174 | - {% if form.preferred_email.errors %} |
175 | - <span class="error"> |
176 | - {{ form.preferred_email.errors|first }} |
177 | - </span> |
178 | - {% endif %} |
179 | - {{ form.preferred_email }} |
180 | + {% if form.preferred_email.errors %} |
181 | + <p class="p-form-validation__message"> |
182 | + <strong>Error: </strong>{{ form.preferred_email.errors|first }} |
183 | + </p> |
184 | + {% endif %} |
185 | + {{ form.preferred_email }} |
186 | {% else %} |
187 | - {# Manually added, it will be ignored by the django form #} |
188 | - <input type="text" value="{{ unverified_email|default_if_none:'' }}" disabled="true" /> |
189 | - {% endif %} |
190 | - |
191 | - </div> |
192 | - |
193 | - {% if not embedded %} |
194 | - <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> |
195 | - {% endif %} |
196 | - |
197 | - {% if not readonly %} |
198 | - {% include "widgets/passwords.html" with edit_account_labels=1 fields=form %} |
199 | - {% endif %} |
200 | - |
201 | - </fieldset> |
202 | - |
203 | - {% if enable_device_prefs %} |
204 | - <fieldset class="undecorated boxed device-prefs"> |
205 | - <h4 class="legend" data-qa-id="authentication_devices">{% trans "Authentication devices" %}</h4> |
206 | - <div class="{% if form.twofactor_required.errors %}haserrors {% endif %}twofactor-input input-row"> |
207 | - {{ form.twofactor_required }} |
208 | - {% if form.twofactor_required.errors %} |
209 | - <span class="error">{{ form.twofactor_required.errors|first }}</span> |
210 | - {% endif %} |
211 | - </div> |
212 | - <div class="{% if form.warn_about_backup_device.errors %}haserrors {% endif %}backupdevice-warn-input input-row"> |
213 | - {{ form.warn_about_backup_device }} |
214 | - <label class="formLabel" for="id_warn_about_backup_device"> |
215 | - {{ form.warn_about_backup_device.label }} |
216 | - </label> |
217 | - {% if form.warn_about_backup_device.errors %} |
218 | - <span class="error">{{ form.warn_about_backup_device.errors|first }}</span> |
219 | - {% endif %} |
220 | - </div> |
221 | - </fieldset> |
222 | - {% endif %} |
223 | - |
224 | - <p class="actions"> |
225 | - {% if not readonly %} |
226 | - <button type="submit" class="btn cta" name="update" data-qa-id="update_preferences"> |
227 | - <span>{% trans "Save changes" %}</span> |
228 | - </button> |
229 | - {% endif %} |
230 | - {% if token %} |
231 | - {% trans "or" %} |
232 | - <a id="exit" href="{% if require_username %}{% url 'server-decide' token %}?continue{% else %}.{% endif %}">{% trans "exit without updating" %}</a> |
233 | - {% endif %} |
234 | - </p> |
235 | -</form> |
236 | - |
237 | -<p><a href="/+delete" data-qa-id="delete_account_link">{% trans "Permanently delete account" %}</a></p> |
238 | - |
239 | -{% include "widgets/last_auth_sites.html" %} |
240 | + {# Manually added, it will be ignored by the django form #} |
241 | + <input type="text" value="{{ unverified_email|default_if_none:'' }}" disabled="true" /> |
242 | + {% endif %} |
243 | + </div> |
244 | + |
245 | + {% if not embedded %} |
246 | + <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> |
247 | + {% endif %} |
248 | + </div> |
249 | + </div> |
250 | + |
251 | + {% if not readonly %} |
252 | + <div class="p-strip is-shallow"> |
253 | + <hr> |
254 | + </div> |
255 | + |
256 | + <div class="row"> |
257 | + <div class="col-8"> |
258 | + {% include "widgets/passwords.html" with edit_account_labels=1 fields=form %} |
259 | + </div> |
260 | + </div> |
261 | + {% endif %} |
262 | + |
263 | + {% if enable_device_prefs %} |
264 | + <div class="p-strip is-shallow"> |
265 | + <hr> |
266 | + </div> |
267 | + <h4 class="legend" data-qa-id="authentication_devices">{% trans "Authentication devices" %}</h4> |
268 | + <div class="p-form-validation{% if form.twofactor_required.errors %} is-errors{% endif %}"> |
269 | + {{ form.twofactor_required }} |
270 | + {% if form.twofactor_required.errors %} |
271 | + <p class="p-form-validation__message"> |
272 | + <strong>Error:</strong> {{ form.twofactor_required.errors|first }} |
273 | + </p> |
274 | + {% endif %} |
275 | + </div> |
276 | + |
277 | + <div class="p-form-validation{% if form.warn_about_backup_device.errors %} is-error{% endif %}"> |
278 | + {{ form.warn_about_backup_device }} |
279 | + <label class="formLabel" for="id_warn_about_backup_device"> |
280 | + {{ form.warn_about_backup_device.label }} |
281 | + </label> |
282 | + {% if form.warn_about_backup_device.errors %} |
283 | + <p class="p-form-validation__message"> |
284 | + <strong>Error:</strong> {{ form.warn_about_backup_device.errors|first }} |
285 | + </p> |
286 | + {% endif %} |
287 | + </div> |
288 | + {% endif %} |
289 | + |
290 | + <div class="p-strip is-shallow"> |
291 | + <hr> |
292 | + </div> |
293 | + |
294 | + {% if not readonly %} |
295 | + <button type="submit" class="p-button--positive" name="update" data-qa-id="update_preferences"> |
296 | + <span>{% trans "Save changes" %}</span> |
297 | + </button> |
298 | + {% endif %} |
299 | + {% if token %} |
300 | + {% trans "or" %} |
301 | + <p><a id="exit" href="{% if require_username %}{% url 'server-decide' token %}?continue{% else %}.{% endif %}">{% trans "exit without updating" %}</a></p> |
302 | + {% endif %} |
303 | + </form> |
304 | + |
305 | + <p><a href="/+delete" data-qa-id="delete_account_link">{% trans "Permanently delete account" %}</a></p> |
306 | + |
307 | + {% include "widgets/last_auth_sites.html" %} |
308 | + </section> |
309 | |
310 | {% endblock %} |
311 | |
312 | {% block extra_js %} |
313 | - |
314 | -{% include "registration/_password_meter.html" with pwd_selector="#id_password" pwd_confirm_selector="#id_passwordconfirm" %} |
315 | - |
316 | -<script type="text/javascript"> |
317 | - |
318 | - YUI({ |
319 | - groups: { |
320 | - |
321 | - u1: { |
322 | - base: '{% static "identityprovider/js/u1/build/" %}', |
323 | - combine: {{ combine|lower }}, |
324 | - root: 'identityprovider/js/u1/build/', |
325 | - modules: { |
326 | - 'one-widget-tooltip': { |
327 | - type: 'js', |
328 | - path: 'one-widget-tooltip/one-widget-tooltip-min.js' |
329 | - } |
330 | - } |
331 | - } |
332 | - } |
333 | - }).use('one-widget-tooltip', function(Y) { |
334 | - |
335 | - tt = new Y.U1.Widget.Tooltip({ |
336 | - triggerNodes:".tooltip", |
337 | - delegate: ".tooltip", |
338 | - shim:false, |
339 | - hideDelay: 1500, |
340 | - autoHideDelay: 100000, |
341 | - zIndex:100, |
342 | - compass: 'east', |
343 | - content: '<p class="tooltip-title">{% trans "Preferred email address" %}</p>' + |
344 | - '<p>{% blocktrans %}This email address is passed on to other sites when requested as part of the login process.{% endblocktrans %}</p>' + |
345 | - '<p>{{ form.preferred_email.help_text|escapejs }}</p>', |
346 | - escapeHTML: false |
347 | - }); |
348 | - |
349 | - // lighter version |
350 | - tt.get('srcNode').addClass('tooltip-light'); |
351 | - |
352 | - // users should be able to enter tooltip to click links |
353 | - tt.on('mouseover', function () { |
354 | - this._clearTimers(); |
355 | - }, tt); |
356 | - tt.on('mouseleave', function () { |
357 | - this.hide(); |
358 | - }, tt); |
359 | - |
360 | - tt.render(); |
361 | - |
362 | - |
363 | - }); |
364 | - |
365 | -</script> |
366 | - |
367 | - |
368 | + {% include "registration/_password_meter.html" with pwd_selector="#id_password" pwd_confirm_selector="#id_passwordconfirm" %} |
369 | {% endblock %} |
370 | |
371 | === modified file 'src/webui/templates/registration/email_sent.html' |
372 | --- src/webui/templates/registration/email_sent.html 2019-08-05 13:47:39 +0000 |
373 | +++ src/webui/templates/registration/email_sent.html 2019-08-12 13:50:47 +0000 |
374 | @@ -16,6 +16,8 @@ |
375 | <h1>{{ email_heading }}</h1> |
376 | {% endblock %} |
377 | |
378 | +{% block content_class %}{% endblock %} |
379 | + |
380 | {% block content %} |
381 | <section class="p-strip"> |
382 | <div class="row"> |
383 | |
384 | === modified file 'src/webui/templates/registration/forgot_password.html' |
385 | --- src/webui/templates/registration/forgot_password.html 2019-07-30 13:29:30 +0000 |
386 | +++ src/webui/templates/registration/forgot_password.html 2019-08-12 13:50:47 +0000 |
387 | @@ -16,6 +16,8 @@ |
388 | |
389 | {% block content_id %}auth{% endblock %} |
390 | |
391 | +{% block content_class %}{% endblock %} |
392 | + |
393 | {% block content %} |
394 | <section class="p-strip"> |
395 | <div class="row"> |
396 | |
397 | === modified file 'src/webui/templates/registration/login.html' |
398 | --- src/webui/templates/registration/login.html 2019-07-26 13:31:34 +0000 |
399 | +++ src/webui/templates/registration/login.html 2019-08-12 13:50:47 +0000 |
400 | @@ -39,6 +39,8 @@ |
401 | {% endif %} |
402 | {% endblock %} |
403 | |
404 | +{% block content_class %}{% endblock %} |
405 | + |
406 | {% block content %} |
407 | |
408 | <section class="p-strip"> |
409 | |
410 | === modified file 'src/webui/templates/registration/logout.html' |
411 | --- src/webui/templates/registration/logout.html 2019-07-22 09:32:22 +0000 |
412 | +++ src/webui/templates/registration/logout.html 2019-08-12 13:50:47 +0000 |
413 | @@ -14,6 +14,8 @@ |
414 | <h1>{% trans "You have been logged out" %}</h1> |
415 | {% endblock %} |
416 | |
417 | +{% block content_class %}{% endblock %} |
418 | + |
419 | {% block content %} |
420 | <section class="p-strip"> |
421 | <div class="row"> |
422 | |
423 | === modified file 'src/webui/templates/registration/new_account.html' |
424 | --- src/webui/templates/registration/new_account.html 2019-07-26 13:31:34 +0000 |
425 | +++ src/webui/templates/registration/new_account.html 2019-08-12 13:50:47 +0000 |
426 | @@ -27,6 +27,8 @@ |
427 | |
428 | {% block content_id %}auth{% endblock %} |
429 | |
430 | +{% block content_class %}{% endblock %} |
431 | + |
432 | {% block content %} |
433 | |
434 | <section class="p-strip"> |
435 | |
436 | === modified file 'src/webui/templates/registration/reset_password.html' |
437 | --- src/webui/templates/registration/reset_password.html 2019-08-05 13:47:39 +0000 |
438 | +++ src/webui/templates/registration/reset_password.html 2019-08-12 13:50:47 +0000 |
439 | @@ -16,6 +16,8 @@ |
440 | |
441 | {% block content_id %}auth{% endblock %} |
442 | |
443 | +{% block content_class %}{% endblock %} |
444 | + |
445 | {% block content %} |
446 | <section class="p-strip"> |
447 | <div class="row"> |
448 | |
449 | === modified file 'src/webui/templates/static/faq.html' |
450 | --- src/webui/templates/static/faq.html 2019-08-05 13:29:33 +0000 |
451 | +++ src/webui/templates/static/faq.html 2019-08-12 13:50:47 +0000 |
452 | @@ -18,6 +18,7 @@ |
453 | <h1 class="main">{% trans "Frequently asked questions" %}</h1> |
454 | {% endblock %} |
455 | |
456 | +{% block content_class %}{% endblock %} |
457 | {% block content %} |
458 | {% url 'account-index' as home_url %} |
459 | {% url 'account-emails' as emails_url %} |
460 | |
461 | === modified file 'src/webui/templates/vanilla/_footer.html' |
462 | --- src/webui/templates/vanilla/_footer.html 2019-07-22 09:32:22 +0000 |
463 | +++ src/webui/templates/vanilla/_footer.html 2019-08-12 13:50:47 +0000 |
464 | @@ -5,7 +5,7 @@ |
465 | GNU Affero General Public License version 3 (see the file LICENSE). |
466 | {% endcomment %} |
467 | |
468 | -<footer class="p-strip" data-qa-id="ubuntuone_footer"> |
469 | +<footer class="p-strip u-no-padding--top" data-qa-id="ubuntuone_footer"> |
470 | <hr> |
471 | <div class="row"> |
472 | <p>{% trans "Ubuntu One. One place to log in to everything on Ubuntu." %}</p> |
473 | |
474 | === modified file 'src/webui/templates/vanilla/base.html' |
475 | --- src/webui/templates/vanilla/base.html 2019-07-26 13:31:34 +0000 |
476 | +++ src/webui/templates/vanilla/base.html 2019-08-12 13:50:47 +0000 |
477 | @@ -1,6 +1,5 @@ |
478 | {% load i18n static_url combo staticfiles %} |
479 | <!DOCTYPE html> |
480 | - |
481 | <!--[if IE 7 ]><html class="ie7" lang="en" dir="ltr"><![endif]--> |
482 | <!--[if IE 8 ]><html class="ie8" lang="en" dir="ltr"><![endif]--> |
483 | <!--[if (gte IE 9)|!(IE)]><!--><html lang="en" dir="ltr" class="no-js" {% block html_extra %}{% endblock %}><!--<![endif]--> |
484 | @@ -42,13 +41,6 @@ |
485 | |
486 | <div id="cont" role="main"> |
487 | {% include "vanilla/_header.html" %} |
488 | - |
489 | - {% block menu %} |
490 | - {% if user.is_authenticated %} |
491 | - {% include "widgets/personal-menu.html" %} |
492 | - {% endif %} |
493 | - {% endblock %} |
494 | - |
495 | <div id="content"> |
496 | <section class="p-strip--dark p-cip-hero"> |
497 | <div class="row"> |
498 | @@ -86,8 +78,17 @@ |
499 | {% endif %} |
500 | {% endblock %} |
501 | |
502 | - <div id="{% block content_id %}box{% endblock %}"> |
503 | - {% block content %}{% endblock %} |
504 | + <div id="{% block content_id %}box{% endblock %}" class="row"> |
505 | + {% block menu %} |
506 | + {% if user.is_authenticated %} |
507 | + <div class="col-4 p-sidebar"> |
508 | + {% include "vanilla/widgets/personal-menu.html" %} |
509 | + </div> |
510 | + {% endif %} |
511 | + {% endblock %} |
512 | + <div class="{% block content_class %}col-8{% endblock %}"> |
513 | + {% block content %}{% endblock %} |
514 | + </div> |
515 | </div> |
516 | |
517 | </div><!-- close #content --> |
518 | |
519 | === added directory 'src/webui/templates/vanilla/common' |
520 | === added file 'src/webui/templates/vanilla/common/missing_backup_device_warning.html' |
521 | --- src/webui/templates/vanilla/common/missing_backup_device_warning.html 1970-01-01 00:00:00 +0000 |
522 | +++ src/webui/templates/vanilla/common/missing_backup_device_warning.html 2019-08-12 13:50:47 +0000 |
523 | @@ -0,0 +1,19 @@ |
524 | +{% load i18n %} |
525 | + |
526 | +{% if need_backup_device_warning %} |
527 | +{% url 'device-addition' as add_device %} |
528 | +<div id="missing_backup_device" class="p-notification--caution"> |
529 | + <p class="p-notification__response"> |
530 | + <span class="p-notification__status">{% blocktrans %}Warning:{% endblocktrans %}</span> |
531 | + {% blocktrans %}We strongly recommend having two authentication devices, |
532 | + a <strong>primary</strong> device and a <strong>secondary</strong> |
533 | + or backup device. |
534 | + <br><br> |
535 | + Having two authentication devices means you can continue to access your |
536 | + account with your secondary device should your primary device be lost or |
537 | + stolen. |
538 | + <br><br> |
539 | + Click to <a href="{{ add_device }}">add a backup device</a>.{% endblocktrans %} |
540 | + </p> |
541 | +</div> |
542 | +{% endif %} |
543 | |
544 | === added file 'src/webui/templates/vanilla/common/printed_codes_nearly_exhausted_warning.html' |
545 | --- src/webui/templates/vanilla/common/printed_codes_nearly_exhausted_warning.html 1970-01-01 00:00:00 +0000 |
546 | +++ src/webui/templates/vanilla/common/printed_codes_nearly_exhausted_warning.html 2019-08-12 13:50:47 +0000 |
547 | @@ -0,0 +1,15 @@ |
548 | +{% load i18n url_with_token %} |
549 | + |
550 | +{% if paper_devices_needing_renewal %} |
551 | +<div id="exhausted_warning" class="p-notification--caution"> |
552 | + <p class="p-notification__response"> |
553 | + <span class="p-notification__status">{% blocktrans %}Warning:{% endblocktrans %}</span> |
554 | + {% blocktrans %}Your printed list of backup codes is nearly used up. |
555 | + Please print a new list for the following devices.{% endblocktrans %} |
556 | + <br><br> |
557 | + {% for device in paper_devices_needing_renewal %} |
558 | + {{ device.name }} <a href="{% url_with_token 'device-print' device_id=device.id %}" class="btn-sm"><span>{% trans 'Generate New Codes' %}</span></a> |
559 | + {% endfor %} |
560 | + </p> |
561 | +</div> |
562 | +{% endif %} |
563 | |
564 | === added file 'src/webui/templates/vanilla/common/unverified_email_warning.html' |
565 | --- src/webui/templates/vanilla/common/unverified_email_warning.html 1970-01-01 00:00:00 +0000 |
566 | +++ src/webui/templates/vanilla/common/unverified_email_warning.html 2019-08-12 13:50:47 +0000 |
567 | @@ -0,0 +1,14 @@ |
568 | +{% load i18n url_with_token %} |
569 | + |
570 | +{% if need_verify_email_warning %} |
571 | +{% url_with_token 'verify_email' email_address=unverified_email.email as verify_url %} |
572 | +<div class="p-notification--caution"> |
573 | + <p class="p-notification__response"> |
574 | + <span class="p-notification__status">{% blocktrans %}Warning:{% endblocktrans %}</span> |
575 | + {% blocktrans %} |
576 | + You have not verified your email address {{ unverified_email }}. |
577 | + Click to <a href="{{ verify_url }}">verify your email address</a>. |
578 | + {% endblocktrans %} |
579 | + </p> |
580 | +</div> |
581 | +{% endif %} |
582 | |
583 | === added file 'src/webui/templates/vanilla/widgets/passwords.html' |
584 | --- src/webui/templates/vanilla/widgets/passwords.html 1970-01-01 00:00:00 +0000 |
585 | +++ src/webui/templates/vanilla/widgets/passwords.html 2019-08-12 13:50:47 +0000 |
586 | @@ -0,0 +1,40 @@ |
587 | +{% load i18n %} |
588 | +{% if fields.oldpassword %} |
589 | +<p>{% trans "To edit any details on this page, you must confirm your current password." %}</p> |
590 | + |
591 | +{% if edit_account_labels %} |
592 | +<div class="p-form-validation{% if fields.oldpassword.errors or fields.non_field_errors %} is-error{% endif %}"> |
593 | + <label for="id_oldpassword">{% trans "Current password" %}</label> |
594 | + {{ fields.oldpassword }} |
595 | + {% if fields.oldpassword.errors %} |
596 | + <p class="p-form-validation__message"> |
597 | + <strong>Error:</strong> {{ fields.oldpassword.errors|first }} |
598 | + </p> |
599 | + {% endif %} |
600 | +</div> |
601 | +{% endif %} |
602 | +{% endif %} |
603 | + |
604 | +{% if edit_account_labels %} |
605 | +<div class="p-form-validation{% if fields.password.errors or fields.non_field_errors %} is-error{% endif %}"> |
606 | + <label for="id_password">{% trans "Choose password" %}</label> |
607 | + {{ fields.password }} |
608 | + {% if fields.password.errors %} |
609 | + <p class="p-form-validation__message"> |
610 | + <strong>Error:</strong> {{ fields.password.errors|first }} |
611 | + </p> |
612 | + {% endif %} |
613 | +</div> |
614 | +{% endif %} |
615 | + |
616 | +{% if edit_account_labels %} |
617 | +<div class="p-form-validation{% if fields.passwordconfirm.errors or fields.non_field_errors %} is-error{% endif %}"> |
618 | + <label for="id_passwordconfirm">{% trans "Re-type password" %}</label> |
619 | + {{ fields.passwordconfirm }} |
620 | + {% if fields.passwordconfirm.errors %} |
621 | + <p class="p-form-validation__message"> |
622 | + <strong>Error:</strong> {{ fields.passwordconfirm.errors|first }} |
623 | + </p> |
624 | + {% endif %} |
625 | +</div> |
626 | +{% endif %} |
627 | |
628 | === added file 'src/webui/templates/vanilla/widgets/personal-menu.html' |
629 | --- src/webui/templates/vanilla/widgets/personal-menu.html 1970-01-01 00:00:00 +0000 |
630 | +++ src/webui/templates/vanilla/widgets/personal-menu.html 2019-08-12 13:50:47 +0000 |
631 | @@ -0,0 +1,50 @@ |
632 | +{% comment %} |
633 | +Copyright 2010-2019 Canonical Ltd. This software is licensed under |
634 | +the GNU Affero General Public License version 3 (see the file |
635 | +LICENSE). |
636 | +{% endcomment %} |
637 | + |
638 | +{% load gargoyle_tags %} |
639 | +{% load i18n %} |
640 | +{% load menu_item %} |
641 | +{% load url_with_token %} |
642 | +<div class="p-strip"> |
643 | + <ul class="p-list"> |
644 | + {% url_with_token 'account-index' as account_url %} |
645 | + |
646 | + {% if current_section == 'account' %} |
647 | + {% menu_item "account2" _("Personal details") account_url None "p-list__item is-active" %} |
648 | + {% else %} |
649 | + {% menu_item "account2" _("Personal details") account_url None "p-list__item" %} |
650 | + {% endif %} |
651 | + |
652 | + {% if not token and not readonly %} |
653 | + {% ifswitch TWOFACTOR %} |
654 | + {% url 'device-list' as device_url %} |
655 | + {% if current_section == 'devices' %} |
656 | + {% menu_item "devices" _("Authentication devices") device_url None "p-list__item is-active" %} |
657 | + {% else %} |
658 | + {% menu_item "devices" _("Authentication devices") device_url None "p-list__item" %} |
659 | + {% endif %} |
660 | + {% endifswitch %} |
661 | + {% url 'applications' as applications_url %} |
662 | + {% if current_section == 'applications' %} |
663 | + {% menu_item "applications" _("Applications") applications_url None "p-list__item is-active" %} |
664 | + {% else %} |
665 | + {% menu_item "applications" _("Applications") applications_url None "p-list__item" %} |
666 | + {% endif %} |
667 | + {% ifswitch SSH_KEY_INTEGRATION %} |
668 | + {% url 'ssh_keys' as ssh_url %} |
669 | + {% menu_item "ssh_keys" _("SSH keys") ssh_url None "p-list__item" %} |
670 | + {% endifswitch %} |
671 | + {% url 'auth_log' as auth_log_url %} |
672 | + {% if current_section == 'auth_log' %} |
673 | + {% menu_item "auth_log" _("Account activity") auth_log_url None "p-list__item is-active" %} |
674 | + {% menu_item "auth_log" _("Account activity") auth_log_url None "p-list__item is-active" %} |
675 | + {% else %} |
676 | + {% menu_item "auth_log" _("Account activity") auth_log_url None "p-list__item" %} |
677 | + {% endif %} |
678 | + {% endif %} |
679 | + |
680 | + </ul> |
681 | +</div> |
Some small comments when eye-balling code. No QA.