Merge lp:~deadlight/canonical-identity-provider/resync-2fa into lp:~deadlight/canonical-identity-provider/vanilla

Proposed by Karl Williams on 2019-08-22
Status: Merged
Merge reported by: Karl Williams
Merged at revision: not available
Proposed branch: lp:~deadlight/canonical-identity-provider/resync-2fa
Merge into: lp:~deadlight/canonical-identity-provider/vanilla
Prerequisite: lp:~deadlight/canonical-identity-provider/language
Diff against target: 146 lines (+49/-68)
1 file modified
src/webui/templates/registration/sync_2fa.html (+49/-68)
To merge this branch: bzr merge lp:~deadlight/canonical-identity-provider/resync-2fa
Reviewer Review Type Date Requested Status
Anthony Dillon (community) 2019-08-22 Approve on 2019-08-23
Karl Williams Pending
Review via email: mp+371671@code.launchpad.net

Description of the change

Updated the 2fa resync page to Vanilla

QA:
- npm i
- ./node_modules/gulp/bin/gulp.js sass
- source env/bin/activate
- make start-db
- make run
- Visit http://[CONTAINER IP]:8000//sync_2fa

To post a comment you must log in.
Karl Williams (deadlight) wrote :

QA'd in person

Anthony Dillon (ya-bo-ng) wrote :

Some small suggestions in code

review: Needs Fixing
1714. By Karl Williams on 2019-08-23

Add vanilla notification and validation styles

Anthony Dillon (ya-bo-ng) wrote :

LGTM +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/webui/templates/registration/sync_2fa.html'
2--- src/webui/templates/registration/sync_2fa.html 2014-12-09 21:32:43 +0000
3+++ src/webui/templates/registration/sync_2fa.html 2019-08-23 14:06:35 +0000
4@@ -1,4 +1,4 @@
5-{% extends "base.html" %}
6+{% extends "vanilla/base.html" %}
7
8 {% load i18n %}
9
10@@ -7,88 +7,69 @@
11 {% block extra_css %}
12 {% if rpconfig and rpconfig.logo_url %}
13 <style type="text/css" data-qa-id="test_2fs_rp">
14- .title .trusted-rp-name {
15- background-image: url('{{ rpconfig.logo_url }}');
16- background-repeat: no-repeat;
17- background-position: 0 100%;
18- padding-left: 24px;
19- padding-top: 2px;
20- }
21+ .title .trusted-rp-name {
22+ background-image: url('{{ rpconfig.logo_url }}');
23+ background-repeat: no-repeat;
24+ background-position: 0 100%;
25+ padding-left: 24px;
26+ padding-top: 2px;
27+ }
28 </style>
29 {% endif %}
30 {% endblock %}
31
32+{% block content_class %}{% endblock %}
33+
34 {% block text_title %}
35- <h1 class="u1-h-main">{% trans "One account to log in to everything on Ubuntu" %}</h1>
36- <h2 class="u1-h-med u1-h-pair">{% trans "Enter three consecutive verification codes" %}</h2>
37+ <h1>{% trans "One account to log in to everything on Ubuntu" %}</h1>
38 {% endblock %}
39
40 {% block bodyclass %}{% endblock %}
41 {% block menu %}{% endblock %}
42
43 {% block content %}
44-<div class="yui3-g-r">
45-
46- <div id="auth" class="yui3-u-1-2">
47-
48- <div class="form-box">
49-
50- <p class="title twofactor-title" data-qa-id="ubuntu_2fsync_title">
51- {% if token %}{% url 'cancel' token as cancel_url %}
52- {% else %}{% url 'account-index' as cancel_url %}{% endif %}
53-
54- <a href="{{cancel_url}}" class="trusted-rp-name" data-qa-id="trusted_rp_2fsync">
55- {% if rpconfig and rpconfig.displayname %}
56- {{ rpconfig.displayname }}
57- {% else %}
58- Ubuntu One
59- {% endif %}
60- </a><span class="action-title">{% trans "2-factor synchronization" %}</span>
61- </p>
62-
63- <form id="sync-form" action="" method="post" name="syncform">
64- {% csrf_token %}
65-
66- {% if form.non_field_errors %}
67- <div class="input-row haserrors">
68- <span class="error">{{ form.non_field_errors|join:"" }}</span>
69- </div>
70- {% endif %}
71-
72- {% for field in form %}
73- <p id="oathtoken{{ forloop.counter }}" class="input-row oath-token{% if field.errors or form.non_field_errors %} haserrors{% endif %}">
74- <label for="{{ field.id_for_label }}">{% trans "Verification code" %} {{ forloop.counter }}:</label>
75-
76- {{ field }}
77-
78- {% if field.errors %}
79- <span class="error">{{ field.errors|join:"" }}</span>
80- {% endif %}
81- </p>
82- {% endfor %}
83-
84- <div class="actions">
85- {% if next %}<input type="hidden" name="next" value="{{ next }}">{% endif %}
86- <button type="submit" class="cta" name="continue" data-qa-id="sync_button">
87- <span>{% trans "Synchronize" %}</span>
88- </button>
89- </div>
90-
91- </form>
92-
93- </div>
94-
95+ <div class="row">
96+ <div id="auth" class="col-6">
97+ <div class="p-card">
98+ <h2>{% trans "Enter three consecutive verification codes" %}</h2>
99+ <hr>
100+ <form id="sync-form" action="" method="post" name="syncform">
101+ {% csrf_token %}
102+ {% if form.non_field_errors %}
103+ <div class="p-notification--negative">
104+ <p class="p-notification__response">
105+ <span class="p-notification__status">Error:</span>{{ form.non_field_errors|join:"" }}
106+ </p>
107+ </div>
108+ {% endif %}
109+
110+ {% for field in form %}
111+ <div id="oathtoken{{ forloop.counter }}" class="p-form-validation oath-token{% if field.errors or form.non_field_errors %} is-error{% endif %}">
112+ <label for="{{ field.id_for_label }}">{% trans "Verification code" %} {{ forloop.counter }}:</label>
113+ {{ field }}
114+ {% if field.errors %}
115+ <p class="p-form-validation__message">
116+ <strong>Error:</strong> {{ field.errors|join:"" }}
117+ </p>
118+ {% endif %}
119+ </div>
120+ {% endfor %}
121+
122+ {% if next %}<input type="hidden" name="next" value="{{ next }}">{% endif %}
123+ <button type="submit" class="p-button--positive" name="continue" data-qa-id="sync_button">
124+ <span>{% trans "Synchronize" %}</span>
125+ </button>
126+ </form>
127+ </div>
128 </div>
129-
130- <div class="yui3-u-1-3">
131-
132+ <div class="col-4">
133+ <div class="p-card">
134 {% include "registration/two_factor_information.html" %}
135-
136+ </div>
137 </div>
138-
139-</div>
140+ </div>
141 {% endblock %}
142
143 {% block extra_js %}
144-{% include "common/sync_2fa_javascript.html" %}
145+ {% include "common/sync_2fa_javascript.html" %}
146 {% endblock %}

Subscribers

People subscribed via source and target branches

to all changes: