Merge lp:~deadlight/canonical-identity-provider/notifications-and-errors into lp:~deadlight/canonical-identity-provider/vanilla

Proposed by Karl Williams
Status: Merged
Merged at revision: 1717
Proposed branch: lp:~deadlight/canonical-identity-provider/notifications-and-errors
Merge into: lp:~deadlight/canonical-identity-provider/vanilla
Diff against target: 336 lines (+107/-103)
7 files modified
src/webui/templates/403-csrf.html (+26/-27)
src/webui/templates/404-no-token.html (+12/-12)
src/webui/templates/404.html (+8/-10)
src/webui/templates/500.html (+28/-22)
src/webui/templates/cookies.html (+5/-5)
src/webui/templates/limitexceeded.html (+13/-13)
src/webui/templates/readonly.html (+15/-14)
To merge this branch: bzr merge lp:~deadlight/canonical-identity-provider/notifications-and-errors
Reviewer Review Type Date Requested Status
Anthony Dillon (community) Approve
Review via email: mp+372065@code.launchpad.net

Description of the change

Converted a selection of small templates to Vanilla styling

QA:
- npm i
- ./node_modules/gulp/bin/gulp.js sass
- source env/bin/activate
- make start-db
- make run
- Change line 19 of settings_devel.py to "DEBUG = False"
- Visit http://[CONTAINER IP]:8000/NOT-A-REAL-PAGE and see the 404 message

Others are harder to view in development but use a similar template

To post a comment you must log in.
Revision history for this message
Anthony Dillon (ya-bo-ng) wrote :

Few comments in the code.

review: Needs Fixing
1717. By Karl Williams

HTML updates for error pages

Revision history for this message
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/403-csrf.html'
2--- src/webui/templates/403-csrf.html 2014-12-09 21:32:43 +0000
3+++ src/webui/templates/403-csrf.html 2019-09-02 07:49:30 +0000
4@@ -1,41 +1,40 @@
5-{% extends "base.html" %}
6+{% extends "vanilla/base.html" %}
7 {% load i18n %}
8
9 {% comment %}
10-Copyright 2010-2013 Canonical Ltd. This software is licensed under the
11+Copyright 2010-2019 Canonical Ltd. This software is licensed under the
12 GNU Affero General Public License version 3 (see the file LICENSE).
13 {% endcomment %}
14
15 {% block title %}
16- {% comment %}Translators: This is the title of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
17- {% trans "Stale request" %}
18+ {% comment %}Translators: This is the title of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
19+ {% trans "Stale request" %}
20 {% endblock %}
21
22 {% block text_title %}
23- {% comment %}Translators: This is the heading of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
24- <h1 class="main">{% trans "Your page was stale." %}</h1>
25+ {% comment %}Translators: This is the heading of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
26+ <h1>{% trans "Your page was stale." %}</h1>
27 {% endblock %}
28
29 {% block content %}
30- <div>
31- <p>
32- {% comment %}Translators: This is the text of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
33- {% blocktrans %}Apologies, the page you came from was a little old. Perhaps you navigated here from a browser window other than the one you used to login. If so, try using the other browser window. Or, try your action again, starting from our home page.{% endblocktrans %}
34- </p>
35-
36- <h3>{% trans "The most common reasons for seeing this page are:" %}</h3>
37- <dl class="u1-list">
38- <dt>{% trans "Cookies have been disabled either globally or selectively." %}</dt>
39- <dd>{% blocktrans %}Ubuntu One requires cookies for delivering the best experience. Please make sure cookies are allowed for Ubuntu One.{% endblocktrans %}</dd>
40-
41- <dt>{% trans "HTTP Referer header is disabled." %}</dt>
42- <dd>{% blocktrans %}Ubuntu One requires the HTTP Referer header to be present in the request. Please make sure this header isn't being blocked by any browser extensions.{% endblocktrans %}</dd>
43- </dl>
44-
45- <p>{% blocktrans %}If neither of these solve the issue, please try accessing Ubuntu One from a completely fresh, unconfigured browser. This will help us better diagnose the problem in case it's still happening. If the issue is solved by using a clean browser session, try to verify your browser settings and extensions.{% endblocktrans %}</p>
46-
47- {% include "static/_contact_support_snippet.html" %}
48-
49- <a class="btn" href="/"><span><span>{% trans "Go to our home page" %}</span></span></a>
50- </div>
51+ <div class="row">
52+ <p>
53+ {% comment %}Translators: This is the text of a page only displayed when the browser request was old (ie. had an incorrect csrf token).{% endcomment %}
54+ {% blocktrans %}Apologies, the page you came from was a little old. Perhaps you navigated here from a browser window other than the one you used to login. If so, try using the other browser window. Or, try your action again, starting from our home page.{% endblocktrans %}
55+ </p>
56+
57+ <h3>{% trans "The most common reasons for seeing this page are:" %}</h3>
58+ <dl>
59+ <dt>{% trans "Cookies have been disabled either globally or selectively." %}</dt>
60+ <dd>{% blocktrans %}Ubuntu One requires cookies for delivering the best experience. Please make sure cookies are allowed for Ubuntu One.{% endblocktrans %}</dd>
61+ <dt>{% trans "HTTP Referer header is disabled." %}</dt>
62+ <dd>{% blocktrans %}Ubuntu One requires the HTTP Referer header to be present in the request. Please make sure this header isn't being blocked by any browser extensions.{% endblocktrans %}</dd>
63+ </dl>
64+
65+ <p>{% blocktrans %}If neither of these solve the issue, please try accessing Ubuntu One from a completely fresh, unconfigured browser. This will help us better diagnose the problem in case it's still happening. If the issue is solved by using a clean browser session, try to verify your browser settings and extensions.{% endblocktrans %}</p>
66+
67+ {% include "static/_contact_support_snippet.html" %}
68+
69+ <a href="/">{% trans "Go to our home page" %}</a>
70+ </div>
71 {% endblock %}
72
73=== modified file 'src/webui/templates/404-no-token.html'
74--- src/webui/templates/404-no-token.html 2019-05-10 19:47:22 +0000
75+++ src/webui/templates/404-no-token.html 2019-09-02 07:49:30 +0000
76@@ -1,4 +1,4 @@
77-{% extends "base.html" %}
78+{% extends "vanilla/base.html" %}
79 {% load i18n %}
80
81 {% comment %}
82@@ -7,21 +7,21 @@
83 {% endcomment %}
84
85 {% block title %}
86- {% trans "Not found" %}
87+ {% trans "Not found" %}
88 {% endblock %}
89
90 {% block text_title %}
91- <h1 class="main">Invalid address validation link</h1>
92+ <h1>Invalid address validation link</h1>
93 {% endblock %}
94
95 {% block content %}
96- <div>
97- <p>{% blocktrans %}You clicked on an e-mail address validation link from Ubuntu One SSO; however, the information from the link seems to be invalid or stale.{% endblocktrans %}</p>
98- <p>{% blocktrans %}This could be for one of the following reasons:{% endblocktrans %}</p>
99- <ol class="u1-list">
100- <li>{% blocktrans %}The link has already been used. You don't need to validate your address again. {% endblocktrans %}</li>
101- <li>{% blocktrans %}You created your Ubuntu One SSO account while starting a session on another site. You must click the validation link on the same browser where you started your session on the other site.{% endblocktrans %}</li>
102- </ol>
103- <p>{% blocktrans %}You can also go to <a href="{{email_url}}">Your account's e-mail page</a> and click on "Verify" next to the e-mail address you want to verify. This is the best solution if you are unable to click the link on the same browser where you started your session on the other site.{% endblocktrans %}</p>
104- </div>
105+ <div class="row">
106+ <p>{% blocktrans %}You clicked on an e-mail address validation link from Ubuntu One SSO; however, the information from the link seems to be invalid or stale.{% endblocktrans %}</p>
107+ <p>{% blocktrans %}This could be for one of the following reasons:{% endblocktrans %}</p>
108+ <ol class="p-list">
109+ <li class="p-list__item">{% blocktrans %}The link has already been used. You don't need to validate your address again. {% endblocktrans %}</li>
110+ <li class="p-list__item">{% blocktrans %}You created your Ubuntu One SSO account while starting a session on another site. You must click the validation link on the same browser where you started your session on the other site.{% endblocktrans %}</li>
111+ </ol>
112+ <p>{% blocktrans %}You can also go to <a href="{{email_url}}">Your account's e-mail page</a> and click on "Verify" next to the e-mail address you want to verify. This is the best solution if you are unable to click the link on the same browser where you started your session on the other site.{% endblocktrans %}</p>
113+ </div>
114 {% endblock %}
115
116=== modified file 'src/webui/templates/404.html'
117--- src/webui/templates/404.html 2014-12-09 21:32:43 +0000
118+++ src/webui/templates/404.html 2019-09-02 07:49:30 +0000
119@@ -1,24 +1,22 @@
120-{% extends "base.html" %}
121+{% extends "vanilla/base.html" %}
122 {% load i18n %}
123
124 {% comment %}
125-Copyright 2010 Canonical Ltd. This software is licensed under the
126+Copyright 2019 Canonical Ltd. This software is licensed under the
127 GNU Affero General Public License version 3 (see the file LICENSE).
128 {% endcomment %}
129
130 {% block title %}
131- {% trans "Not found" %}
132+ {% trans "Not found" %}
133 {% endblock %}
134
135 {% block text_title %}
136- <h1 class="main">Lost something?</h1>
137+ <h1>Lost something?</h1>
138 {% endblock %}
139
140 {% block content %}
141- <div>
142- <p>{% blocktrans %}There's no page with this address in the Ubuntu One service. Check that you entered the address correctly and try again.{% endblocktrans %}</p>
143- <p>
144- {% blocktrans %}(Error <abbr>ID</abbr>: {{oopsid}}){% endblocktrans %}
145- </p>
146- </div>
147+ <p>{% blocktrans %}There's no page with this address in the Ubuntu One service. Check that you entered the address correctly and try again.{% endblocktrans %}</p>
148+ {% if oopsid %}
149+ <p>{% blocktrans %}(Error <abbr>ID</abbr>: {{oopsid}}){% endblocktrans %}</p>
150+ {% endif %}
151 {% endblock %}
152
153=== modified file 'src/webui/templates/500.html'
154--- src/webui/templates/500.html 2015-09-30 19:30:01 +0000
155+++ src/webui/templates/500.html 2019-09-02 07:49:30 +0000
156@@ -1,36 +1,42 @@
157-{% extends "base.html" %}
158+{% extends "vanilla/base.html" %}
159 {% load i18n %}
160
161 {% comment %}
162-Copyright 2010 Canonical Ltd. This software is licensed under the
163+Copyright 2019 Canonical Ltd. This software is licensed under the
164 GNU Affero General Public License version 3 (see the file LICENSE).
165 {% endcomment %}
166
167 {% block title %}
168- {% trans "Oops!" %}
169+ {% trans "Oops!" %}
170 {% endblock %}
171
172 {% block text_title %}
173- <h1 class="main">Oops!</h1>
174+ <h1>Oops!</h1>
175 {% endblock %}
176
177 {% block content %}
178- <div>
179- <h3>
180- {% blocktrans %}Sorry, something just went wrong in Ubuntu One.{% endblocktrans %}
181- </h3>
182- {% if errormsg %}<p>{{ errormsg }}</p>{% endif %}
183- <p>
184- {% blocktrans %}We&#8217;ve recorded what happened, and we&#8217;ll fix it as soon as possible. Apologies for the inconvenience.{% endblocktrans %}
185- </p>
186- <p>
187- OOPS <abbr>ID</abbr>: {{ oopsid }}
188- </p>
189- {% if request.sentry.id %}
190- <p>Sentry <abbr>ID</abbr>: {{ request.sentry.id }}</p>
191- {% endif %}
192- <pre style="overflow:auto">
193-{{traceback}}
194- </pre>
195- </div>
196+ <div class="row">
197+ <h3>
198+ {% blocktrans %}Sorry, something just went wrong in Ubuntu One.{% endblocktrans %}
199+ </h3>
200+ {% if errormsg %}
201+ <div class="p-notification--negative">
202+ <p class="p-notification__response">
203+ <span class="p-notification__status">Error: </span>{{ errormsg }}
204+ </p>
205+ </div>
206+ {% endif %}
207+ <p>
208+ {% blocktrans %}We&#8217;ve recorded what happened, and we&#8217;ll fix it as soon as possible. Apologies for the inconvenience.{% endblocktrans %}
209+ </p>
210+ <p>
211+ OOPS <abbr>ID</abbr>: {{ oopsid }}
212+ </p>
213+ {% if request.sentry.id %}
214+ <p>Sentry <abbr>ID</abbr>: {{ request.sentry.id }}</p>
215+ {% endif %}
216+ <pre style="overflow:auto">
217+ {{traceback}}
218+ </pre>
219+ </div>
220 {% endblock %}
221
222=== modified file 'src/webui/templates/cookies.html'
223--- src/webui/templates/cookies.html 2012-12-04 18:51:42 +0000
224+++ src/webui/templates/cookies.html 2019-09-02 07:49:30 +0000
225@@ -9,13 +9,13 @@
226 {% block title %}{% trans "Cookies required" %}{% endblock %}
227
228 {% block text_title %}
229- <h1 class="main">{% trans "Cookies required" %}</h1>
230+ <h1>{% trans "Cookies required" %}</h1>
231 {% endblock %}
232
233 {% block content %}
234-<div>
235- <p>
236- {% blocktrans %}Cookies are required to use this service. Please enable cookies in your browser.{% endblocktrans %}
237- </p>
238+<div class="row">
239+ <p>
240+ {% blocktrans %}Cookies are required to use this service. Please enable cookies in your browser.{% endblocktrans %}
241+ </p>
242 </div>
243 {% endblock %}
244
245=== modified file 'src/webui/templates/limitexceeded.html'
246--- src/webui/templates/limitexceeded.html 2014-12-09 21:32:43 +0000
247+++ src/webui/templates/limitexceeded.html 2019-09-02 07:49:30 +0000
248@@ -1,27 +1,27 @@
249-{% extends "base.html" %}
250+{% extends "vanilla/base.html" %}
251 {% load i18n %}
252
253 {% comment %}
254-Copyright 2010 Canonical Ltd. This software is licensed under the
255+Copyright 2019 Canonical Ltd. This software is licensed under the
256 GNU Affero General Public License version 3 (see the file LICENSE).
257 {% endcomment %}
258
259 {% block title %}
260- {% trans "Rate limit exceeded" %}
261+ {% trans "Rate limit exceeded" %}
262 {% endblock %}
263
264 {% block text_title %}
265- <h1 class="main">{% trans "Rate limit exceeded" %}</h1>
266+ <h1>{% trans "Rate limit exceeded" %}</h1>
267 {% endblock %}
268
269 {% block content %}
270- <div>
271- <p>
272- {% blocktrans %}You have made too many failed requests to the Ubuntu One authentication server over a short period of time.{% endblocktrans %}
273- </p>
274- <p>
275- {% blocktrans %}Please try again in a while.{% endblocktrans %}
276- </p>
277- <a class="btn" href="/"><span><span>{% trans "Try again" %}</span></span></a>
278- </div>
279+ <div class="row">
280+ <p>
281+ {% blocktrans %}You have made too many failed requests to the Ubuntu One authentication server over a short period of time.{% endblocktrans %}
282+ </p>
283+ <p>
284+ {% blocktrans %}Please try again in a while.{% endblocktrans %}
285+ </p>
286+ <a href="/">{% trans "Try again" %}</a>
287+ </div>
288 {% endblock %}
289
290=== modified file 'src/webui/templates/readonly.html'
291--- src/webui/templates/readonly.html 2012-12-04 18:51:42 +0000
292+++ src/webui/templates/readonly.html 2019-09-02 07:49:30 +0000
293@@ -1,28 +1,29 @@
294-{% extends "base.html" %}
295+{% extends "vanilla/base.html" %}
296 {% load i18n %}
297
298 {% comment %}
299-Copyright 2010 Canonical Ltd. This software is licensed under the
300+Copyright 2019 Canonical Ltd. This software is licensed under the
301 GNU Affero General Public License version 3 (see the file LICENSE).
302 {% endcomment %}
303
304 {% block title %}
305- {% trans "Read-only mode" %}
306+ {% trans "Read-only mode" %}
307 {% endblock %}
308
309 {% block text_title %}
310- <h1 class="main">{% trans "We're currently in read-only mode." %}</h1>
311+ <h1>{% trans "We're currently in read-only mode." %}</h1>
312 {% endblock %}
313
314 {% block content %}
315- <div>
316- <p>
317- {% blocktrans %}Apologies, the page you're requesting isn't accessible at the moment, as we're running with a minimum set of features. Hopefully we will have the full service up and running again in no time.{% endblocktrans %}
318- </p>
319- <p>
320- {% blocktrans %}Please try again in a while.{% endblocktrans %}
321- </p>
322- <a class="btn" href=""><span><span>{% trans "Try again" %}</span></span></a> {% trans "or" %}
323- <a class="btn alt" href="/"><span><span>{% trans "Go to our home page" %}</span></span></a>
324- </div>
325+ <div class="row">
326+ <p>
327+ {% blocktrans %}Apologies, the page you're requesting isn't accessible at the moment, as we're running with a minimum set of features. Hopefully we will have the full service up and running again in no time.{% endblocktrans %}
328+ </p>
329+ <p>
330+ {% blocktrans %}Please try again in a while.{% endblocktrans %}
331+ </p>
332+ <p>
333+ <a href=""><span><span>{% trans "Try again" %}</span></span></a> {% trans "or" %}
334+ <a href="/"><span><span>{% trans "go to our home page" %}</span></span></a>
335+ </div>
336 {% endblock %}

Subscribers

People subscribed via source and target branches

to all changes: