Merge lp:~jblount/libubuntuone/classy-error-pages into lp:libubuntuone

Proposed by Joshua Blount
Status: Rejected
Rejected by: Stuart Langridge
Proposed branch: lp:~jblount/libubuntuone/classy-error-pages
Merge into: lp:libubuntuone
Diff against target: 621 lines (+521/-7)
7 files modified
data/Makefile.am (+4/-1)
data/connecting.html (+34/-0)
data/in_development.html (+34/-0)
data/load_error.html (+41/-0)
data/reset.css (+49/-0)
data/screen.css (+336/-0)
libubuntuone/u1-music-store.c (+23/-6)
To merge this branch: bzr merge lp:~jblount/libubuntuone/classy-error-pages
Reviewer Review Type Date Requested Status
Stuart Langridge (community) Disapprove
Rodrigo Moya (community) Needs Fixing
Eric Casteleijn (community) Approve
Review via email: mp+21513@code.launchpad.net

Description of the change

Adds some css and html to make the error pages look nice / right / good.

To post a comment you must log in.
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

Looks ok to me, although I just merged another branch that adds a new page (initial page when loading the real store), so I think this is going to have conflicts, so can you please merge with trunk and add that other page please?

Revision history for this message
Eric Casteleijn (thisfred) wrote :

Looks good, code builds.

review: Approve
55. By Joshua Blount

merged with trunk

Revision history for this message
Joshua Blount (jblount) wrote :

> Looks ok to me, although I just merged another branch that adds a new page
> (initial page when loading the real store), so I think this is going to have
> conflicts, so can you please merge with trunk and add that other page please?

I merged with trunk, but could you please once over it and make sure I didn't get rid of anything?

Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

Ok, there are a few problems:

* in_development.html seems to be missing, right? Also, the call to load that file seems to be missing also.
* There are some leaks in the C code:

552 + calculated_file_url = g_strdup_printf("%s?%s",
553 + g_filename_to_uri(calculated_file_path, NULL, NULL),
554 + reload_url);

g_filename_to_uri returns a newly-allocated string, so you need to store it in a variable, use it to g_strdup_printf calculated_file_url, and then g_free it.

* also, we use the GNOME coding style for couchdb-glib (because it's going to be included in GNOME soon), so could you please add a space after the function name and before the '(' character?

Apart from that it looks ok, so please fix that and I'll approve it

review: Needs Fixing
56. By Joshua Blount

added in_development.html template

Revision history for this message
Stuart Langridge (sil) wrote :

Rejecting because instead we'll use https://code.edge.launchpad.net/~sil/libubuntuone/classy-error-pages/ which fixes Rodrigo's issues.

review: Disapprove

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/Makefile.am'
--- data/Makefile.am 2010-02-17 12:57:19 +0000
+++ data/Makefile.am 2010-03-19 11:51:34 +0000
@@ -2,6 +2,9 @@
2js_DATA = \2js_DATA = \
3 u1-library-override.js \3 u1-library-override.js \
4 u1-preview.js \4 u1-preview.js \
5 u1-songs-clickable.js5 u1-songs-clickable.js \
6 load_error.html \
7 connecting.html \
8 staticstyle.css
69
7EXTRA_DIST = $(js_DATA)10EXTRA_DIST = $(js_DATA)
811
=== added file 'data/connecting.html'
--- data/connecting.html 1970-01-01 00:00:00 +0000
+++ data/connecting.html 2010-03-19 11:51:34 +0000
@@ -0,0 +1,34 @@
1<!doctype html>
2<html>
3<head>
4<title>Loading error</title>
5<link rel="stylesheet" href="reset.css" type="text/css" media="all">
6<link rel="stylesheet" href="screen.css" type="text/css" media="all">
7
8</head>
9<body class="downloads">
10<div id="header">
11
12<div class="wrap">
13<h1 id="logo">Ubuntu One Music Store</h1>
14
15</div><!-- close .wrap -->
16</div><!-- close #header -->
17
18<div class="superfluous">
19<div id="content">
20<div class="access">
21 <h1>Connecting</h1>
22<h2>o hai we are helping you connect to ubuntu one in an unstyled fashion</h2>
23</div>
24</div>
25
26</div>
27</div>
28<div id="footer">
29<div class="wrap">
30</div>
31</div>
32</body>
33</html>
34
035
=== added directory 'data/img'
=== added file 'data/img/button-left.png'
1Binary files data/img/button-left.png 1970-01-01 00:00:00 +0000 and data/img/button-left.png 2010-03-19 11:51:34 +0000 differ36Binary files data/img/button-left.png 1970-01-01 00:00:00 +0000 and data/img/button-left.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/button-right.png'
2Binary files data/img/button-right.png 1970-01-01 00:00:00 +0000 and data/img/button-right.png 2010-03-19 11:51:34 +0000 differ37Binary files data/img/button-right.png 1970-01-01 00:00:00 +0000 and data/img/button-right.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/content_top.png'
3Binary files data/img/content_top.png 1970-01-01 00:00:00 +0000 and data/img/content_top.png 2010-03-19 11:51:34 +0000 differ38Binary files data/img/content_top.png 1970-01-01 00:00:00 +0000 and data/img/content_top.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/downloads_background.png'
4Binary files data/img/downloads_background.png 1970-01-01 00:00:00 +0000 and data/img/downloads_background.png 2010-03-19 11:51:34 +0000 differ39Binary files data/img/downloads_background.png 1970-01-01 00:00:00 +0000 and data/img/downloads_background.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/footer_clouds.png'
5Binary files data/img/footer_clouds.png 1970-01-01 00:00:00 +0000 and data/img/footer_clouds.png 2010-03-19 11:51:34 +0000 differ40Binary files data/img/footer_clouds.png 1970-01-01 00:00:00 +0000 and data/img/footer_clouds.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/green_check.png'
6Binary files data/img/green_check.png 1970-01-01 00:00:00 +0000 and data/img/green_check.png 2010-03-19 11:51:34 +0000 differ41Binary files data/img/green_check.png 1970-01-01 00:00:00 +0000 and data/img/green_check.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/header_background.png'
7Binary files data/img/header_background.png 1970-01-01 00:00:00 +0000 and data/img/header_background.png 2010-03-19 11:51:34 +0000 differ42Binary files data/img/header_background.png 1970-01-01 00:00:00 +0000 and data/img/header_background.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/logo.png'
8Binary files data/img/logo.png 1970-01-01 00:00:00 +0000 and data/img/logo.png 2010-03-19 11:51:34 +0000 differ43Binary files data/img/logo.png 1970-01-01 00:00:00 +0000 and data/img/logo.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/menu.png'
9Binary files data/img/menu.png 1970-01-01 00:00:00 +0000 and data/img/menu.png 2010-03-19 11:51:34 +0000 differ44Binary files data/img/menu.png 1970-01-01 00:00:00 +0000 and data/img/menu.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/orange_x.png'
10Binary files data/img/orange_x.png 1970-01-01 00:00:00 +0000 and data/img/orange_x.png 2010-03-19 11:51:34 +0000 differ45Binary files data/img/orange_x.png 1970-01-01 00:00:00 +0000 and data/img/orange_x.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/search.png'
11Binary files data/img/search.png 1970-01-01 00:00:00 +0000 and data/img/search.png 2010-03-19 11:51:34 +0000 differ46Binary files data/img/search.png 1970-01-01 00:00:00 +0000 and data/img/search.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/img/superfluous-bubbles.png'
12Binary files data/img/superfluous-bubbles.png 1970-01-01 00:00:00 +0000 and data/img/superfluous-bubbles.png 2010-03-19 11:51:34 +0000 differ47Binary files data/img/superfluous-bubbles.png 1970-01-01 00:00:00 +0000 and data/img/superfluous-bubbles.png 2010-03-19 11:51:34 +0000 differ
=== added file 'data/in_development.html'
--- data/in_development.html 1970-01-01 00:00:00 +0000
+++ data/in_development.html 2010-03-19 11:51:34 +0000
@@ -0,0 +1,34 @@
1<!doctype html>
2<html>
3<head>
4<title>Loading error</title>
5<link rel="stylesheet" href="reset.css" type="text/css" media="all">
6<link rel="stylesheet" href="screen.css" type="text/css" media="all">
7
8</head>
9<body class="downloads">
10<div id="header">
11
12<div class="wrap">
13<h1 id="logo">Ubuntu One Music Store</h1>
14
15</div><!-- close .wrap -->
16</div><!-- close #header -->
17
18<div class="superfluous">
19<div id="content">
20<div class="access">
21 <h1>In development</h1>
22<h2>The music store is under development, please be patient</h2>
23</div>
24</div>
25
26</div>
27</div>
28<div id="footer">
29<div class="wrap">
30</div>
31</div>
32</body>
33</html>
34
035
=== added file 'data/load_error.html'
--- data/load_error.html 1970-01-01 00:00:00 +0000
+++ data/load_error.html 2010-03-19 11:51:34 +0000
@@ -0,0 +1,41 @@
1<!doctype html>
2<html>
3<head>
4<title>Loading error</title>
5<link rel="stylesheet" href="reset.css" type="text/css" media="all">
6<link rel="stylesheet" href="screen.css" type="text/css" media="all">
7
8<script>
9function reload() {
10 reload_url = location.search.substr(1);
11 location.href = reload_url;
12 return false;
13}
14</script>
15</head>
16<body class="downloads">
17<div id="header">
18
19<div class="wrap">
20<h1 id="logo">Ubuntu One Music Store</h1>
21
22</div><!-- close .wrap -->
23</div><!-- close #header -->
24
25<div class="superfluous">
26<div id="content">
27<div class="access">
28 <h1>Internet connection is required to access the music store</h1>
29<h2>Please connect and reload.</h2>
30<p><button onclick="reload()"><span>Reload</span></button></p>
31</div>
32</div>
33
34</div>
35</div>
36<div id="footer">
37<div class="wrap">
38</div>
39</div>
40</body>
41</html>
042
=== added file 'data/reset.css'
--- data/reset.css 1970-01-01 00:00:00 +0000
+++ data/reset.css 2010-03-19 11:51:34 +0000
@@ -0,0 +1,49 @@
1pan, applet, object, iframe,
2h1, h2, h3, h4, h5, h6, p, blockquote, pre,
3a, abbr, acronym, address, big, cite, code,
4del, dfn, em, font, img, ins, kbd, q, s, samp,
5small, strike, strong, sub, sup, tt, var,
6dl, dt, dd, ol, ul, li,
7fieldset, form, label, legend,
8table, caption, tbody, tfoot, thead, tr, th, td {
9 margin: 0;
10 padding: 0;
11 border: 0;
12 outline: 0;
13 font-weight: inherit;
14 font-style: inherit;
15 font-size: 100%;
16 font-family: inherit;
17 vertical-align: baseline;
18}
19/* remember to define focus styles! */
20:focus {
21 outline: 0;
22}
23body {
24 line-height: 1;
25 color: black;
26 background: white;
27}
28ol, ul {
29 list-style: none;
30}
31/* tables still need 'cellspacing="0"' in the markup */
32table {
33 border-collapse: separate;
34 border-spacing: 0;
35}
36caption, th, td {
37 text-align: left;
38 font-weight: normal;
39}
40blockquote:before, blockquote:after,
41q:before, q:after {
42 content: "";
43}
44blockquote, q {
45 quotes: "" "";
46}
47
48strong {font-weight: bold;}
49em {font-style: italic;}
050
=== added file 'data/screen.css'
--- data/screen.css 1970-01-01 00:00:00 +0000
+++ data/screen.css 2010-03-19 11:51:34 +0000
@@ -0,0 +1,336 @@
1/* copied from original html */
2
3#downloads {
4 padding: 0;
5 margin: 0;
6}
7#downloads li {
8 overflow: hidden; /* enclose floats */
9 zoom: 1; /* hasLayout in IE */
10 border-bottom: 1px dotted black;
11 list-style: none;
12 padding: 0;
13 margin: 0;
14}
15
16li .metadata {
17 float: left;
18 width: 450px;
19}
20
21.progress .progress-bar {
22 float: right;
23 width: 154px;
24 height: 13px;
25 background: url(img/progress-bar-background.png) no-repeat left;
26}
27
28.progress .progress-bar .gradient {
29 height: 13px;
30 background: url(img/gradient.png) no-repeat left;
31 -webkit-transition: width 2s linear;
32 /* 2s should be the same as the Rhythmbox update interval */
33}
34.progress .progress-string {
35 float: right;
36 clear: right;
37}
38
39.progress .progress-complete {
40 background: url(img/musicstore-complete-tick.png) no-repeat right;
41 padding-right: 28px;
42 -webkit-transition: opacity 0.5s linear;
43 height: 20px;
44 padding-top: 10px;
45 display: inline-block;
46}
47
48/* originating with this file */
49
50body {
51 font-family: "bitstream vera sans", "dejavu sans", verdana, sans-serif;
52 margin: 0 auto;
53 font-size: 11px;
54 line-height: 14px;
55}
56
57.wrap {
58 margin: 0 auto;
59 width: 730px;
60}
61
62#header {
63 background: url(img/header_background.png) repeat-x;
64 height: 86px;
65 min-width: 550px;
66 margin-bottom: 0;
67 margin-top: -50px;
68 }
69
70#header ul {padding: 0; margin: 0;}
71#header ul li {display: inline; margin: 0; padding: 0;}
72
73#header ul#home_nav {float: left;}
74
75ul#home_nav li a {
76 display: block;
77 float: left;
78 text-indent: -9999px;
79 width: 26px;
80 height: 41px;
81}
82
83ul#home_nav li.back a {
84 background: url(img/menu.png) no-repeat;
85 background-position: 0 0;
86}
87
88ul#home_nav li.back a:hover {
89 background: url(img/menu.png) no-repeat;
90 background-position: 0 -41px;
91
92}
93
94ul#home_nav li.home a {
95 width: 42px;
96 background: url(img/menu.png) no-repeat;
97 background-position: -26px 0;
98}
99
100ul#home_nav li.home a:hover {
101 width: 42px;
102 background: url(img/menu.png) no-repeat;
103 background-position: -26px -41px;
104}
105
106#header ul#nav {
107 float: right;
108 background: url(img/menu.png) no-repeat;
109 background-position: top right;
110 padding-right: 38px;
111}
112
113#nav li a {
114 float: left;
115 display: block;
116 text-indent: -9999px;
117 height: 41px;
118}
119
120#nav li.new a {
121 width: 57px;
122 background: #000 url(img/menu.png) no-repeat;
123 background-position: -320px 0;
124}
125
126#nav li.new a:hover {
127 background: #000 url(img/menu.png) no-repeat;
128 background-position: -320px -41px;;
129}
130
131#nav li.just_added a {
132 width: 90px;
133 background: url(img/menu.png) no-repeat;
134 background-position: -377px 0;
135}
136
137#nav li.just_added a:hover {
138 background: url(img/menu.png) no-repeat;
139 background-position: -377px -41px;
140}
141
142#nav li.browse a {
143 width: 69px;
144 background: url(img/menu.png) no-repeat;
145 background-position: -467px 0;
146}
147
148#nav li.browse a:hover {
149 background: url(img/menu.png) no-repeat;
150 background-position: -467px -41px;
151}
152
153#nav li.downloads a {
154 width: 109px;
155 background: url(img/menu.png) no-repeat;
156 background-position: -536px 0;
157}
158
159body.downloads #nav li.downloads a:hover, #nav li.downloads a:hover {
160 background: url(img/menu.png) no-repeat;
161 background-position: -536px -41px;
162}
163
164body.downloads #nav li.downloads a {
165 background: url(img/menu.png) no-repeat;
166 background-position: -536px -82px;
167}
168
169#nav li.basket a {
170 width: 65px;
171 background: url(img/menu.png) no-repeat;
172 background-position: -645px 0;
173}
174
175#nav li.basket a:hover {
176 background: url(img/menu.png) no-repeat;
177 background-position: -645px -41px;
178}
179
180#nav li.help a {
181 width: 52px;
182 background: url(img/menu.png) no-repeat;
183 background-position: -710px 0;
184 }
185
186#nav li.help a:hover {
187 background: url(img/menu.png) no-repeat;
188 background-position: -710px -41px;
189 }
190
191.navish {overflow: auto;}
192
193h1#logo {
194 margin-top: 60px;
195 display: block;
196 text-indent: -9999px;
197 background: url(img/logo.png) no-repeat;
198 width: 190px;
199 height: 15px;
200 float: left;
201}
202
203#header form {
204 float: right;
205 margin-top: 10px;
206}
207
208#content {
209 margin: 0 auto;
210 width: 760px;
211 background: url(img/content_top.png) no-repeat;
212 min-height: 300px;
213 text-align: left;
214 padding-top: 25px;
215}
216
217.access {
218 margin: 0 auto;
219 width: 500px;
220 margin-top: 130px;
221 }
222
223#content .access h1 {
224 font-weight: bold;
225 margin: 0;
226 font-size: 15px;
227 margin-bottom: 10px;
228 }
229
230#content .access h2 {
231 font-weight: normal;
232 font-size: 13px;
233 margin: 0;
234 margin-bottom: 20px;
235 }
236
237#content h2 {
238 font-size: 20px;
239 font-weight: normal;
240 margin: 0;
241 padding: 0;
242 text-align: left;
243 margin-bottom: 25px;
244 margin-left: 15px;
245}
246
247.progress {
248 text-align: right;
249 float: right;
250 width: 280px;
251}
252
253ul.downloading {
254 color: #8f8f8f;
255 border-top: 1px dotted #999999;
256 border-bottom: 1px dotted #999999;
257 margin-left: 15px;
258}
259
260ul.downloading li {
261 border-bottom: 1px dotted #d6d6d6;
262 padding-top: 20px;
263 padding-bottom: 20px;
264 overflow: auto;
265}
266
267ul.downloading li.last {
268 border-bottom: none;
269}
270
271
272.superfluous {
273 background: url(img/downloads_background.png) repeat-x 50% 100%;
274 padding-bottom: 100px;
275}
276
277
278#footer {
279 background: url(img/superfluous-bubbles.png) no-repeat 380px 0%;
280 margin: 0 auto;
281 margin-top: -75px;
282 width: 750px;
283 padding-top: 100px;
284}
285
286button#music-search {
287 background: url(img/search.png) no-repeat;
288 text-indent: -9999px;
289 width: 77px;
290 height: 22px;
291 border: 0;
292}
293
294
295.progress p, .progress .progress-string {padding-right: 3px;}
296
297p.copyright {color: #8f8f8f; margin-bottom: 8px;}
298
299#pagination {
300 overflow: hidden; /* enclose floats */
301 zoom: 1;
302}
303#pagination #count {
304 float: left;
305}
306#pagination #pages {
307 float: right;
308}
309#pagination #pages a {
310 text-decoration: none;
311 margin: 4px;
312 color: #8f8f8f;
313}
314#pagination #pages a.current {
315 color: #f58027;
316}
317
318button {
319 background: url(img/button-left.png) no-repeat left;
320 border: 0;
321 padding: 0;
322 padding-left: 7px;
323 display: inline-block;
324 text-align: center;
325 }
326
327
328button span {
329 background: url(img/button-right.png) no-repeat right;
330 display: block;
331 white-space: nowrap;
332 color: white;
333 font-size: 12px;
334 padding: 4px 24px 3px 15px;
335 margin-left: 1px;
336 }
0337
=== added file 'data/staticstyle.css'
=== modified file 'libubuntuone/u1-music-store.c'
--- libubuntuone/u1-music-store.c 2010-03-12 16:12:36 +0000
+++ libubuntuone/u1-music-store.c 2010-03-19 11:51:34 +0000
@@ -37,10 +37,10 @@
37#define U1_NOT_LOGGED_IN_STORE_URL "/music/store-no-token"37#define U1_NOT_LOGGED_IN_STORE_URL "/music/store-no-token"
38#define U1_NOT_REGISTERED_URL "https://one.ubuntu.com/music/notregistered?returnUrl="38#define U1_NOT_REGISTERED_URL "https://one.ubuntu.com/music/notregistered?returnUrl="
3939
40#define U1_DEFAULT_ERROR_PAGE "load_error.html"
41#define U1_IN_DEVELOPMENT_PAGE "in_development.html"
42#define U1_CONNECTING_PAGE "connecting.html"
40#define U1_INITIAL_PAGE "<html><body>Loading Ubuntu One music store</body></html>"43#define U1_INITIAL_PAGE "<html><body>Loading Ubuntu One music store</body></html>"
41#define U1_DEFAULT_ERROR_PAGE "<html><body>Could not load Music Store</body></html>"
42#define U1_IN_DEVELOPMENT_PAGE "<html><body>The music store is under development, please be patient</body></html>"
43#define U1_CONNECTING_PAGE "<html><body>Connecting to Ubuntu One. Please wait...</body></html>"
4444
45struct _U1MusicStorePrivate {45struct _U1MusicStorePrivate {
46 DBusGConnection *bus;46 DBusGConnection *bus;
@@ -151,6 +151,24 @@
151 object_class->finalize = u1_music_store_finalize;151 object_class->finalize = u1_music_store_finalize;
152}152}
153153
154
155static void
156load_internal_html_page (WebKitWebView *web_view, const gchar *file_name, gchar *reload_url)
157{
158 gchar *calculated_file_path, *calculated_file_url;
159 calculated_file_path = g_build_path ("/", U1_JAVASCRIPT_DIR, file_name, NULL);
160 if (reload_url == NULL) {
161 calculated_file_url = g_filename_to_uri(calculated_file_path, NULL, NULL);
162 } else {
163 calculated_file_url = g_strdup_printf("%s?%s",
164 g_filename_to_uri(calculated_file_path, NULL, NULL),
165 reload_url);
166 }
167 webkit_web_view_open (web_view, calculated_file_url);
168 g_free(calculated_file_url);
169 g_free(calculated_file_path);
170}
171
154static void172static void
155parse_oauth_string (const gchar *string, gchar **oauth_token, gchar **oauth_token_secret)173parse_oauth_string (const gchar *string, gchar **oauth_token, gchar **oauth_token_secret)
156{174{
@@ -319,7 +337,7 @@
319 gboolean success;337 gboolean success;
320 GError *error = NULL;338 GError *error = NULL;
321339
322 webkit_web_view_load_string (web_view, U1_CONNECTING_PAGE, "text/html", "utf-8", "file:///");340 load_internal_html_page(web_view, U1_CONNECTING_PAGE, NULL);
323341
324 proxy = dbus_g_proxy_new_for_name (music_store->priv->bus, "com.ubuntuone.Authentication",342 proxy = dbus_g_proxy_new_for_name (music_store->priv->bus, "com.ubuntuone.Authentication",
325 "/", "com.ubuntuone.Authentication");343 "/", "com.ubuntuone.Authentication");
@@ -648,8 +666,7 @@
648load_error_cb (WebKitWebView *web_view, WebKitWebFrame *frame, const gchar *uri, GError *error, gpointer user_data)666load_error_cb (WebKitWebView *web_view, WebKitWebFrame *frame, const gchar *uri, GError *error, gpointer user_data)
649{667{
650 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);668 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
651669 load_internal_html_page(web_view, U1_DEFAULT_ERROR_PAGE, uri);
652 webkit_web_view_load_string (web_view, U1_DEFAULT_ERROR_PAGE, "text/html", "utf-8", "file:///");
653670
654 return TRUE;671 return TRUE;
655}672}

Subscribers

People subscribed via source and target branches