Merge lp:~sinzui/launchpad/css-ui-0 into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Merged at revision: 12097
Proposed branch: lp:~sinzui/launchpad/css-ui-0
Merge into: lp:launchpad
Diff against target: 560 lines (+149/-117)
16 files modified
lib/canonical/launchpad/icing/style-3-0.css.in (+2/-2)
lib/canonical/launchpad/icing/style.css (+0/-1)
lib/canonical/launchpad/offline-maintenance-haproxy.html (+42/-32)
lib/canonical/launchpad/offline-maintenance.html (+11/-1)
lib/canonical/launchpad/offline-staging-code-update.html (+11/-1)
lib/canonical/launchpad/offline-staging-db-update.html (+11/-1)
lib/canonical/launchpad/offline-unplanned-haproxy.html (+42/-32)
lib/canonical/launchpad/offline-unplanned.html (+11/-1)
lib/canonical/launchpad/webapp/interfaces.py (+5/-13)
lib/canonical/launchpad/webapp/login.py (+2/-2)
lib/canonical/launchpad/webapp/notifications.py (+3/-12)
lib/lp/app/browser/tests/test_launchpad.py (+1/-1)
lib/lp/app/stories/basics/xx-notifications.txt (+2/-8)
lib/lp/app/templates/base-layout-macros.pt (+0/-4)
lib/lp/blueprints/browser/tests/test_specification.py (+3/-3)
lib/lp/registry/browser/person.py (+3/-3)
To merge this branch: bzr merge lp:~sinzui/launchpad/css-ui-0
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Review via email: mp+43936@code.launchpad.net

Description of the change

Update browser notices and offline pages.

    Launchpad bug:
        https://bugs.launchpad.net/bugs/36287
        https://bugs.launchpad.net/bugs/253558
        https://bugs.launchpad.net/bugs/330035
    Pre-implementation: no one
    Test command: ./bin/test -vv -t notifications -t test_launchpad

Bug #36287 [NOTICE and INFO logging levels should be merged]
    NOTICE and INFO messages are shown identically. NOTICE seems to be
    custom fluff and should be removed.

Bug #253558 [New message styling obscures useful content]
     the message class styles obscure page content in multiple locations.

Bug #330035 ["Please try again" page is crooked]
    "Please try again" page <https://launchpad.net/offline.html>, the heading
    is correctly horizontally centered with respect to the whole viewport; but
    when the browser window is wider than 60em, the body text is way off to
    the left.

--------------------------------------------------------------------

RULES

Bug #36287 [NOTICE and INFO logging levels should be merged]
    * Remove NOTICE. Update the few callsite that use it to use INFO instead.

Bug #253558 [New message styling obscures useful content]
    * Add a top margin of 1em to clear the previous content. Use em units
      for margin and padding to keep the distance proportional to the font.

Bug #330035 ["Please try again" page is crooked]
    * The offline css needs a margin rule.
    * Several of the offline pages are trying to load the mast css file
      which cannot be guaranteed to be served. Inline the font and offline
      rules to ensure all pages are centered with the correct font.
    * Remove the unused .offline style from the style sheet.

QA

Bug #36287 [NOTICE and INFO logging levels should be merged]
    * Mark a blueprint as started.
    * Verify an info notice is shown. (This will look identical to
      product because the template macro converted NOTICE to INFO)

Bug #253558 [New message styling obscures useful content]
    * Mark a blueprint as started.
    * Verify the info icon is below the registration line.

Bug #330035 ["Please try again" page is crooked]
    * Not QAable while the server is up. The html file in the tree can
      be looked at with a browser without a running server.

LINT

    lib/canonical/launchpad/offline-maintenance-haproxy.html
    lib/canonical/launchpad/offline-maintenance.html
    lib/canonical/launchpad/offline-staging-code-update.html
    lib/canonical/launchpad/offline-staging-db-update.html
    lib/canonical/launchpad/offline-unplanned-haproxy.html
    lib/canonical/launchpad/offline-unplanned.html
    lib/canonical/launchpad/browser/tests/test_launchpad.py
    lib/canonical/launchpad/icing/style-3-0.css.in
    lib/canonical/launchpad/icing/style.css
    lib/canonical/launchpad/webapp/interfaces.py
    lib/canonical/launchpad/webapp/login.py
    lib/canonical/launchpad/webapp/notifications.py
    lib/lp/app/stories/basics/xx-notifications.txt
    lib/lp/app/templates/base-layout-macros.pt
    lib/lp/blueprints/browser/tests/test_specification.py
    lib/lp/registry/browser/person.py

^ There is a lot of lint in these files. I can fix this after the review.

IMPLEMENTATION

Bug #36287 [NOTICE and INFO logging levels should be merged]
    Removed NOTICE and and its tests. Updated the account and spec uses
    notices to use INFO.
    lib/canonical/launchpad/browser/tests/test_launchpad.py
    lib/canonical/launchpad/webapp/interfaces.py
    lib/canonical/launchpad/webapp/login.py
    lib/canonical/launchpad/webapp/notifications.py
    lib/lp/app/templates/base-layout-macros.pt
    lib/lp/blueprints/browser/tests/test_specification.py
    lib/lp/registry/browser/person.py
    lib/lp/app/stories/basics/xx-notifications.txt

Bug #253558 [New message styling obscures useful content]
    Added 1em to the top margin and updated the padding to be in em units.
    lib/canonical/launchpad/icing/style-3-0.css.in

Bug #330035 ["Please try again" page is crooked]
    Inlined the CSS rules for the pages and removed the rule that was never
    loaded.
    lib/canonical/launchpad/offline-maintenance-haproxy.html
    lib/canonical/launchpad/offline-maintenance.html
    lib/canonical/launchpad/offline-staging-code-update.html
    lib/canonical/launchpad/offline-staging-db-update.html
    lib/canonical/launchpad/offline-unplanned-haproxy.html
    lib/canonical/launchpad/offline-unplanned.html
    lib/canonical/launchpad/icing/style.css

To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :
Download full text (3.4 KiB)

Hi Curtis,

This branch looks good. I just have some minor comments.

-Edwin

>=== modified file 'lib/canonical/launchpad/offline-maintenance-haproxy.html'
>--- lib/canonical/launchpad/offline-maintenance-haproxy.html 2010-04-01 13:43:01 +0000
>+++ lib/canonical/launchpad/offline-maintenance-haproxy.html 2010-12-16 18:25:39 +0000
>@@ -6,7 +6,17 @@
> <head>
> <title>Launchpad is offline for maintenance</title>
> <style type="text/css" media="screen, print">
>- .offline{text-align:center;margin:2em 0}
>+ html, body {
>+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
>+ }
>+ .offline {
>+ text-align: center;
>+ max-width: 60em;
>+ }
>+ .offline > * {
>+ margin-left: auto;
>+ margin-right: auto;
>+ }
> </style>
> </head>
> <body>

This file has CR/LF. How did that happen?

>=== modified file 'lib/canonical/launchpad/offline-unplanned-haproxy.html'
>--- lib/canonical/launchpad/offline-unplanned-haproxy.html 2010-03-02 10:42:06 +0000
>+++ lib/canonical/launchpad/offline-unplanned-haproxy.html 2010-12-16 18:25:39 +0000
>@@ -6,7 +6,17 @@
> <head>
> <title>Please try again</title>
> <style type="text/css" media="screen, print">
>- .offline{text-align:center;margin:2em 0}
>+ html, body {
>+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
>+ }
>+ .offline {
>+ text-align: center;
>+ max-width: 60em;
>+ }
>+ .offline > * {
>+ margin-left: auto;
>+ margin-right: auto;
>+ }
> </style>
> </head>
> <body>

CR/LF again.

>=== modified file 'lib/canonical/launchpad/webapp/interfaces.py'
>--- lib/canonical/launchpad/webapp/interfaces.py 2010-11-02 19:55:24 +0000
>+++ lib/canonical/launchpad/webapp/interfaces.py 2010-12-16 18:25:39 +0000
>@@ -568,15 +568,12 @@
> """Matches the standard logging levels, with the addition of notice
> (which we should probably add to our log levels as well)
> """

The above docstring should be updated.

>- # XXX mpt 2006-03-22 bugs=36287:
>- # NOTICE and INFO should be merged.
> DEBUG = logging.DEBUG # A debugging message
> INFO = logging.INFO # simple confirmation of a change
>- NOTICE = logging.INFO + 5 # action had effects you might not have intended
> WARNING = logging.WARNING # action will not be successful unless you ...
> ERROR = logging.ERROR # the previous action did not succeed, and why
>
>- ALL_LEVELS = (DEBUG, INFO, NOTICE, WARNING, ERROR)
>+ ALL_LEVELS = (DEBUG, INFO, WARNING, ERROR)
>
>
> class INotification(Interface):
>=== modified file 'lib/canonical/launchpad/webapp/notifications.py'
>--- lib/canonical/launchpad/webapp/notifications.py 2010-08-20 20:31:18 +0000
>+++ lib/canonical/launchpad/webapp/notifications.py 2010-12-16 18:25:39 +0000
>@@ -334,8 +327,6 @@
> structured('Debug notification <b>%d</b>' % count))
> response.addInfoNotification(
> structured('Info notification <b>%d</b>' % count))
>- response.addNoticeNotificat...

Read more...

review: Approve (code)
Revision history for this message
Curtis Hovey (sinzui) wrote :

On Thu, 2010-12-16 at 22:15 +0000, Edwin Grubbs wrote:
> Review: Approve code
> Hi Curtis,
>
> This branch looks good. I just have some minor comments.
>
> -Edwin
>
> >=== modified file 'lib/canonical/launchpad/offline-maintenance-haproxy.html'
> >--- lib/canonical/launchpad/offline-maintenance-haproxy.html 2010-04-01 13:43:01 +0000
> >+++ lib/canonical/launchpad/offline-maintenance-haproxy.html 2010-12-16 18:25:39 +0000
> >@@ -6,7 +6,17 @@
> > <head>
> > <title>Launchpad is offline for maintenance</title>
> > <style type="text/css" media="screen, print">
> >- .offline{text-align:center;margin:2em 0}
> >+ html, body {
> >+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
> >+ }
> >+ .offline {
> >+ text-align: center;
> >+ max-width: 60em;
> >+ }
> >+ .offline > * {
> >+ margin-left: auto;
> >+ margin-right: auto;
> >+ }
> > </style>
> > </head>
> > <body>
>
>
> This file has CR/LF. How did that happen?

I think they have always been like that. Both haproxy page may have been
cargo culted from somewhere else.

--
__Curtis C. Hovey_________
http://launchpad.net/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/icing/style-3-0.css.in'
2--- lib/canonical/launchpad/icing/style-3-0.css.in 2010-10-31 20:18:45 +0000
3+++ lib/canonical/launchpad/icing/style-3-0.css.in 2010-12-17 14:00:43 +0000
4@@ -969,8 +969,8 @@
5 border: solid #666;
6 border-width: 1px 2px 2px 1px;
7 color: black;
8- margin: 0 auto 10px auto;
9- padding: 0 10px 10px 20px;
10+ margin: 1em auto 1em auto;
11+ padding: 0 1em 1em 2em;
12 width: 30em;
13 }
14 .error.message::before, .warning.message::before,
15
16=== modified file 'lib/canonical/launchpad/icing/style.css'
17--- lib/canonical/launchpad/icing/style.css 2010-11-19 20:34:37 +0000
18+++ lib/canonical/launchpad/icing/style.css 2010-12-17 14:00:43 +0000
19@@ -32,7 +32,6 @@
20 .exception {color: #cc0000;}
21 .discreet, .lesser, .duplicate-details {font-size: 90%;}
22 .extra-discreet {font-size: 75%;}
23-.offline {text-align: center; margin: 2em 0;}
24 .unavailable {color: #999; background: none;}
25
26 .duplicate-details p { padding: 0em; margin-top: 0em; margin-bottom: 0.2em; }
27
28=== modified file 'lib/canonical/launchpad/offline-maintenance-haproxy.html'
29--- lib/canonical/launchpad/offline-maintenance-haproxy.html 2010-04-01 13:43:01 +0000
30+++ lib/canonical/launchpad/offline-maintenance-haproxy.html 2010-12-17 14:00:43 +0000
31@@ -1,32 +1,42 @@
32-HTTP/1.1 503 Service Unavailable
33-Content-Type: text/html
34-
35-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
36-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
37- <head>
38- <title>Launchpad is offline for maintenance</title>
39- <style type="text/css" media="screen, print">
40- .offline{text-align:center;margin:2em 0}
41- </style>
42- </head>
43- <body>
44- <div class="offline">
45- <!-- Before editing, please see
46- https://bugs.launchpad.net/bugs/475371, especially comment #2,
47- for details on this file. In particular, please maintain the
48- \r\n line endings, at least for the HTTP header lines. -->
49- <h1>Sorry</h1>
50- <p>
51- Launchpad is offline for scheduled maintenance.
52- We should be back soon.
53- </p>
54- <p>
55- You can find more information on the
56- <a href="http://identi.ca/launchpadstatus">Launchpad system status
57- </a> page.
58- </p>
59- <p>Thanks for your patience.</p>
60-
61- </div>
62- </body>
63-</html>
64+HTTP/1.1 503 Service Unavailable
65+Content-Type: text/html
66+
67+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
68+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
69+ <head>
70+ <title>Launchpad is offline for maintenance</title>
71+ <style type="text/css" media="screen, print">
72+ html, body {
73+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
74+ }
75+ .offline {
76+ text-align: center;
77+ max-width: 60em;
78+ }
79+ .offline > * {
80+ margin-left: auto;
81+ margin-right: auto;
82+ }
83+ </style>
84+ </head>
85+ <body>
86+ <div class="offline">
87+ <!-- Before editing, please see
88+ https://bugs.launchpad.net/bugs/475371, especially comment #2,
89+ for details on this file. In particular, please maintain the
90+ \r\n line endings, at least for the HTTP header lines. -->
91+ <h1>Sorry</h1>
92+ <p>
93+ Launchpad is offline for scheduled maintenance.
94+ We should be back soon.
95+ </p>
96+ <p>
97+ You can find more information on the
98+ <a href="http://identi.ca/launchpadstatus">Launchpad system status
99+ </a> page.
100+ </p>
101+ <p>Thanks for your patience.</p>
102+
103+ </div>
104+ </body>
105+</html>
106
107=== modified file 'lib/canonical/launchpad/offline-maintenance.html'
108--- lib/canonical/launchpad/offline-maintenance.html 2010-04-01 13:43:01 +0000
109+++ lib/canonical/launchpad/offline-maintenance.html 2010-12-17 14:00:43 +0000
110@@ -3,7 +3,17 @@
111 <head>
112 <title>Launchpad is offline for maintenance</title>
113 <style type="text/css" media="screen, print">
114- @import url(https://launchpad.net/+icing/rev5/+combo.css);
115+ html, body {
116+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
117+ }
118+ .offline {
119+ text-align: center;
120+ max-width: 60em;
121+ }
122+ .offline > * {
123+ margin-left: auto;
124+ margin-right: auto;
125+ }
126 </style>
127 </head>
128 <body>
129
130=== modified file 'lib/canonical/launchpad/offline-staging-code-update.html'
131--- lib/canonical/launchpad/offline-staging-code-update.html 2010-05-14 15:52:49 +0000
132+++ lib/canonical/launchpad/offline-staging-code-update.html 2010-12-17 14:00:43 +0000
133@@ -3,7 +3,17 @@
134 <head>
135 <title>Please try again</title>
136 <style type="text/css" media="screen, print">
137- @import url(https://launchpad.net/+icing/rev5/combo.css);
138+ html, body {
139+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
140+ }
141+ .offline {
142+ text-align: center;
143+ max-width: 60em;
144+ }
145+ .offline > * {
146+ margin-left: auto;
147+ margin-right: auto;
148+ }
149 </style>
150 </head>
151 <body>
152
153=== modified file 'lib/canonical/launchpad/offline-staging-db-update.html'
154--- lib/canonical/launchpad/offline-staging-db-update.html 2010-05-14 15:52:49 +0000
155+++ lib/canonical/launchpad/offline-staging-db-update.html 2010-12-17 14:00:43 +0000
156@@ -3,7 +3,17 @@
157 <head>
158 <title>Please try again</title>
159 <style type="text/css" media="screen, print">
160- @import url(https://launchpad.net/+icing/rev5/combo.css);
161+ html, body {
162+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
163+ }
164+ .offline {
165+ text-align: center;
166+ max-width: 60em;
167+ }
168+ .offline > * {
169+ margin-left: auto;
170+ margin-right: auto;
171+ }
172 </style>
173 </head>
174 <body>
175
176=== modified file 'lib/canonical/launchpad/offline-unplanned-haproxy.html'
177--- lib/canonical/launchpad/offline-unplanned-haproxy.html 2010-03-02 10:42:06 +0000
178+++ lib/canonical/launchpad/offline-unplanned-haproxy.html 2010-12-17 14:00:43 +0000
179@@ -1,32 +1,42 @@
180-HTTP/1.1 503 Service Unavailable
181-Content-Type: text/html
182-
183-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
184-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
185- <head>
186- <title>Please try again</title>
187- <style type="text/css" media="screen, print">
188- .offline{text-align:center;margin:2em 0}
189- </style>
190- </head>
191- <body>
192- <div class="offline">
193- <!-- Before editing, please see
194- https://bugs.launchpad.net/bugs/475371, especially comment #2,
195- for details on this file. In particular, please maintain the
196- \r\n line endings, at least for the HTTP header lines. -->
197- <h1>Please try again</h1>
198- <p>
199- Sorry, there was a problem connecting to the Launchpad server.
200- </p>
201- <p>
202- Try reloading this page in a minute or two.
203- If the problem persists, let us know in
204- <a href="irc://chat.freenode.net/#launchpad"
205- >the #launchpad IRC channel on Freenode</a>.
206- </p>
207- <p>Thanks for your patience.</p>
208-
209- </div>
210- </body>
211-</html>
212+HTTP/1.1 503 Service Unavailable
213+Content-Type: text/html
214+
215+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
216+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
217+ <head>
218+ <title>Please try again</title>
219+ <style type="text/css" media="screen, print">
220+ html, body {
221+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
222+ }
223+ .offline {
224+ text-align: center;
225+ max-width: 60em;
226+ }
227+ .offline > * {
228+ margin-left: auto;
229+ margin-right: auto;
230+ }
231+ </style>
232+ </head>
233+ <body>
234+ <div class="offline">
235+ <!-- Before editing, please see
236+ https://bugs.launchpad.net/bugs/475371, especially comment #2,
237+ for details on this file. In particular, please maintain the
238+ \r\n line endings, at least for the HTTP header lines. -->
239+ <h1>Please try again</h1>
240+ <p>
241+ Sorry, there was a problem connecting to the Launchpad server.
242+ </p>
243+ <p>
244+ Try reloading this page in a minute or two.
245+ If the problem persists, let us know in
246+ <a href="irc://chat.freenode.net/#launchpad"
247+ >the #launchpad IRC channel on Freenode</a>.
248+ </p>
249+ <p>Thanks for your patience.</p>
250+
251+ </div>
252+ </body>
253+</html>
254
255=== modified file 'lib/canonical/launchpad/offline-unplanned.html'
256--- lib/canonical/launchpad/offline-unplanned.html 2010-01-04 12:58:17 +0000
257+++ lib/canonical/launchpad/offline-unplanned.html 2010-12-17 14:00:43 +0000
258@@ -3,7 +3,17 @@
259 <head>
260 <title>Please try again</title>
261 <style type="text/css" media="screen, print">
262- @import url(https://launchpad.net/+icing/rev5/combo.css);
263+ html, body {
264+ font-family: UbuntuBeta, Ubuntu, 'Bitstream Vera Sans', 'DejaVu Sans', Tahoma, sans-serif;
265+ }
266+ .offline {
267+ text-align: center;
268+ max-width: 60em;
269+ }
270+ .offline > * {
271+ margin-left: auto;
272+ margin-right: auto;
273+ }
274 </style>
275 </head>
276 <body>
277
278=== modified file 'lib/canonical/launchpad/webapp/interfaces.py'
279--- lib/canonical/launchpad/webapp/interfaces.py 2010-11-02 19:55:24 +0000
280+++ lib/canonical/launchpad/webapp/interfaces.py 2010-12-17 14:00:43 +0000
281@@ -565,18 +565,13 @@
282 #
283
284 class BrowserNotificationLevel:
285- """Matches the standard logging levels, with the addition of notice
286- (which we should probably add to our log levels as well)
287- """
288- # XXX mpt 2006-03-22 bugs=36287:
289- # NOTICE and INFO should be merged.
290+ """Matches the standard logging levels."""
291 DEBUG = logging.DEBUG # A debugging message
292 INFO = logging.INFO # simple confirmation of a change
293- NOTICE = logging.INFO + 5 # action had effects you might not have intended
294 WARNING = logging.WARNING # action will not be successful unless you ...
295 ERROR = logging.ERROR # the previous action did not succeed, and why
296
297- ALL_LEVELS = (DEBUG, INFO, NOTICE, WARNING, ERROR)
298+ ALL_LEVELS = (DEBUG, INFO, WARNING, ERROR)
299
300
301 class INotification(Interface):
302@@ -593,7 +588,7 @@
303
304 def __getitem__(index_or_levelname):
305 """Retrieve an INotification by index, or a list of INotification
306- instances by level name (DEBUG, NOTICE, INFO, WARNING, ERROR).
307+ instances by level name (DEBUG, INFO, WARNING, ERROR).
308 """
309
310 def __iter__():
311@@ -616,7 +611,7 @@
312 have been set when redirect() is called.
313 """
314
315- def addNotification(msg, level=BrowserNotificationLevel.NOTICE):
316+ def addNotification(msg, level=BrowserNotificationLevel.INFO):
317 """Append the given message to the list of notifications.
318
319 A plain string message will be CGI escaped. Passing a message
320@@ -629,7 +624,7 @@
321 or an instance of `IStructuredString`.
322
323 :param level: One of the `BrowserNotificationLevel` values: DEBUG,
324- INFO, NOTICE, WARNING, ERROR.
325+ INFO, WARNING, ERROR.
326 """
327
328 def removeAllNotifications():
329@@ -649,9 +644,6 @@
330 def addInfoNotification(msg):
331 """Shortcut to addNotification(msg, INFO)."""
332
333- def addNoticeNotification(msg):
334- """Shortcut to addNotification(msg, NOTICE)."""
335-
336 def addWarningNotification(msg):
337 """Shortcut to addNotification(msg, WARNING)."""
338
339
340=== modified file 'lib/canonical/launchpad/webapp/login.py'
341--- lib/canonical/launchpad/webapp/login.py 2010-10-26 15:47:24 +0000
342+++ lib/canonical/launchpad/webapp/login.py 2010-12-17 14:00:43 +0000
343@@ -119,7 +119,7 @@
344 target = self.getRedirectURL(current_url, query_string)
345 # A dance to assert that we want to break the rules about no
346 # unauthenticated sessions. Only after this next line is it safe
347- # to use the ``addNoticeNotification`` method.
348+ # to use the ``addInfoNotification`` method.
349 allowUnauthenticatedSession(self.request)
350 self.request.response.redirect(target)
351 # Maybe render page with a link to the redirection?
352@@ -365,7 +365,7 @@
353 # The authentication failed (or was canceled), but the user is
354 # already logged in, so we just add a notification message and
355 # redirect.
356- self.request.response.addNoticeNotification(
357+ self.request.response.addInfoNotification(
358 _(u'Your authentication failed but you were already '
359 'logged into Launchpad.'))
360 self._redirect()
361
362=== modified file 'lib/canonical/launchpad/webapp/notifications.py'
363--- lib/canonical/launchpad/webapp/notifications.py 2010-08-20 20:31:18 +0000
364+++ lib/canonical/launchpad/webapp/notifications.py 2010-12-17 14:00:43 +0000
365@@ -16,7 +16,6 @@
366
367 from datetime import datetime
368
369-from zope.app.security.interfaces import IUnauthenticatedPrincipal
370 from zope.interface import implements
371 from zope.session.interfaces import ISession
372
373@@ -114,7 +113,6 @@
374 >>> response.addNotification("Whatever", BrowserNotificationLevel.DEBUG)
375 >>> response.addDebugNotification('Debug')
376 >>> response.addInfoNotification('Info')
377- >>> response.addNoticeNotification('Notice')
378 >>> response.addWarningNotification('Warning')
379
380 And an odd one to test Bug #54987
381@@ -127,11 +125,10 @@
382
383 >>> for notification in response.notifications:
384 ... print "%d -- %s" % (notification.level, notification.message)
385- 25 -- <b>&lt;Fnord&gt;</b>
386+ 20 -- <b>&lt;Fnord&gt;</b>
387 10 -- Whatever
388 10 -- Debug
389 20 -- Info
390- 25 -- Notice
391 30 -- Warning
392 40 -- Error
393
394@@ -144,7 +141,7 @@
395 >>> for notification in ISession(request)[SESSION_KEY]['notifications']:
396 ... print "%d -- %s" % (notification.level, notification.message)
397 ... break
398- 25 -- <b>&lt;Fnord&gt;</b>
399+ 20 -- <b>&lt;Fnord&gt;</b>
400
401 If there are no notifications, the session is not touched. This ensures
402 that we don't needlessly burden the session storage.
403@@ -172,7 +169,7 @@
404 # which would be bad.
405 _notifications = None
406
407- def addNotification(self, msg, level=BrowserNotificationLevel.NOTICE):
408+ def addNotification(self, msg, level=BrowserNotificationLevel.INFO):
409 """See `INotificationResponse`."""
410 self.notifications.append(
411 Notification(level, escape(msg)))
412@@ -237,10 +234,6 @@
413 """See `INotificationResponse`."""
414 self.addNotification(msg, BrowserNotificationLevel.INFO)
415
416- def addNoticeNotification(self, msg):
417- """See `INotificationResponse`."""
418- self.addNotification(msg, BrowserNotificationLevel.NOTICE)
419-
420 def addWarningNotification(self, msg):
421 """See `INotificationResponse`."""
422 self.addNotification(msg, BrowserNotificationLevel.WARNING)
423@@ -334,8 +327,6 @@
424 structured('Debug notification <b>%d</b>' % count))
425 response.addInfoNotification(
426 structured('Info notification <b>%d</b>' % count))
427- response.addNoticeNotification(
428- structured('Notice notification <b>%d</b>' % count))
429 response.addWarningNotification(
430 structured('Warning notification <b>%d</b>' %count))
431 response.addErrorNotification(
432
433=== renamed file 'lib/canonical/launchpad/browser/tests/test_launchpad.py' => 'lib/lp/app/browser/tests/test_launchpad.py'
434--- lib/canonical/launchpad/browser/tests/test_launchpad.py 2010-10-21 04:41:30 +0000
435+++ lib/lp/app/browser/tests/test_launchpad.py 2010-12-17 14:00:43 +0000
436@@ -127,7 +127,7 @@
437 def assertDisplaysNotice(self, path, notification):
438 """Assert that traversal redirects back with the specified notice."""
439 self.assertDisplaysNotification(
440- path, notification, BrowserNotificationLevel.NOTICE)
441+ path, notification, BrowserNotificationLevel.INFO)
442
443 def assertDisplaysError(self, path, notification):
444 """Assert that traversal redirects back with the specified notice."""
445
446=== renamed file 'lib/canonical/launchpad/pagetests/standalone/xx-notifications.txt' => 'lib/lp/app/stories/basics/xx-notifications.txt'
447--- lib/canonical/launchpad/pagetests/standalone/xx-notifications.txt 2009-10-22 18:13:42 +0000
448+++ lib/lp/app/stories/basics/xx-notifications.txt 2010-12-17 14:00:43 +0000
449@@ -15,8 +15,8 @@
450 ...<div class="error message">Error notification <b>2</b></div>
451 ...<div class="warning message">Warning notification <b>1</b></div>
452 ...<div class="warning message">Warning notification <b>2</b></div>
453-...<div class="informational message">Notice notification <b>1</b></div>
454-...<div class="informational message">Notice notification <b>2</b></div>
455+...<div class="informational message">Info notification <b>1</b></div>
456+...<div class="informational message">Info notification <b>2</b></div>
457 ...<div class="debug message">Debug notification <b>1</b></div>
458 ...<div class="debug message">Debug notification <b>2</b></div>
459 ...
460@@ -49,8 +49,6 @@
461 ...<div class="error message">Error notification <b>2</b></div>
462 ...<div class="warning message">Warning notification <b>1</b></div>
463 ...<div class="warning message">Warning notification <b>2</b></div>
464-...<div class="informational message">Notice notification <b>1</b></div>
465-...<div class="informational message">Notice notification <b>2</b></div>
466 ...<div class="informational message">Info notification <b>1</b></div>
467 ...<div class="informational message">Info notification <b>2</b></div>
468 ...<div class="debug message">Debug notification <b>1</b></div>
469@@ -90,8 +88,6 @@
470 ...<div class="error message">Error notification <b>2</b></div>
471 ...<div class="warning message">Warning notification <b>1</b></div>
472 ...<div class="warning message">Warning notification <b>2</b></div>
473-...<div class="informational message">Notice notification <b>1</b></div>
474-...<div class="informational message">Notice notification <b>2</b></div>
475 ...<div class="informational message">Info notification <b>1</b></div>
476 ...<div class="informational message">Info notification <b>2</b></div>
477 ...<div class="debug message">Debug notification <b>1</b></div>
478@@ -151,8 +147,6 @@
479 ...<div class="error message">Error notification <b>2</b></div>
480 ...<div class="warning message">Warning notification <b>1</b></div>
481 ...<div class="warning message">Warning notification <b>2</b></div>
482-...<div class="informational message">Notice notification <b>1</b></div>
483-...<div class="informational message">Notice notification <b>2</b></div>
484 ...<div class="informational message">Info notification <b>1</b></div>
485 ...<div class="informational message">Info notification <b>2</b></div>
486 ...<div class="debug message">Debug notification <b>1</b></div>
487
488=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
489--- lib/lp/app/templates/base-layout-macros.pt 2010-12-14 20:53:23 +0000
490+++ lib/lp/app/templates/base-layout-macros.pt 2010-12-17 14:00:43 +0000
491@@ -23,10 +23,6 @@
492 tal:content="structure notification/message"
493 >A warning notification message</div>
494 <div class="informational message"
495- tal:repeat="notification notifications/notice"
496- tal:content="structure notification/message"
497- >A notice notification message</div>
498- <div class="informational message"
499 tal:repeat="notification notifications/info"
500 tal:content="structure notification/message"
501 >An info notification message</div>
502
503=== modified file 'lib/lp/blueprints/browser/tests/test_specification.py'
504--- lib/lp/blueprints/browser/tests/test_specification.py 2010-12-01 11:26:57 +0000
505+++ lib/lp/blueprints/browser/tests/test_specification.py 2010-12-17 14:00:43 +0000
506@@ -129,7 +129,7 @@
507 SpecificationImplementationStatus.STARTED, spec.implementation_status)
508 self.assertEqual(spec.owner, spec.starter)
509 [notification] = view.request.notifications
510- self.assertEqual(BrowserNotificationLevel.NOTICE, notification.level)
511+ self.assertEqual(BrowserNotificationLevel.INFO, notification.level)
512 self.assertEqual(
513 'Blueprint is now considered "Started".', notification.message)
514
515@@ -162,7 +162,7 @@
516 spec.implementation_status)
517 self.assertIs(None, spec.starter)
518 [notification] = view.request.notifications
519- self.assertEqual(BrowserNotificationLevel.NOTICE, notification.level)
520+ self.assertEqual(BrowserNotificationLevel.INFO, notification.level)
521 self.assertEqual(
522 'Blueprint is now considered "Not started".', notification.message)
523
524@@ -182,7 +182,7 @@
525 spec.implementation_status)
526 self.assertEqual(spec.owner, spec.completer)
527 [notification] = view.request.notifications
528- self.assertEqual(BrowserNotificationLevel.NOTICE, notification.level)
529+ self.assertEqual(BrowserNotificationLevel.INFO, notification.level)
530 self.assertEqual(
531 'Blueprint is now considered "Complete".', notification.message)
532
533
534=== modified file 'lib/lp/registry/browser/person.py'
535--- lib/lp/registry/browser/person.py 2010-12-15 22:05:43 +0000
536+++ lib/lp/registry/browser/person.py 2010-12-17 14:00:43 +0000
537@@ -1538,7 +1538,7 @@
538 def deactivate_action(self, action, data):
539 self.context.deactivateAccount(data['comment'])
540 logoutPerson(self.request)
541- self.request.response.addNoticeNotification(
542+ self.request.response.addInfoNotification(
543 _(u'Your account has been deactivated.'))
544 self.next_url = self.request.getApplicationURL()
545
546@@ -1810,12 +1810,12 @@
547 # email is sent to the user.
548 data['password'] = 'invalid'
549 self.person.setPreferredEmail(None)
550- self.request.response.addNoticeNotification(
551+ self.request.response.addInfoNotification(
552 u'The account "%s" has been suspended.' % (
553 self.context.displayname))
554 if (data['status'] == AccountStatus.ACTIVE
555 and self.context.status != AccountStatus.ACTIVE):
556- self.request.response.addNoticeNotification(
557+ self.request.response.addInfoNotification(
558 u'The user is reactivated. He must use the '
559 u'"forgot password" to log in.')
560 self.updateContextFromData(data)