Merge lp:~jpds/launchpad/fix_50580 into lp:launchpad

Proposed by Jonathan Davies
Status: Merged
Merged at revision: 10042
Proposed branch: lp:~jpds/launchpad/fix_50580
Merge into: lp:launchpad
Diff against target: 66 lines (+20/-3)
3 files modified
lib/canonical/launchpad/icing/style-3-0.css (+10/-0)
lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt (+4/-0)
lib/lp/registry/templates/distributionmirror-macros.pt (+6/-3)
To merge this branch: bzr merge lp:~jpds/launchpad/fix_50580
Reviewer Review Type Date Requested Status
Michael Nelson (community) ui Approve
Abel Deuring (community) code Approve
Guilherme Salgado code Pending
Brad Crittenden Pending
Review via email: mp+15892@code.launchpad.net

Commit message

Use coloured mirror statuses on +archivemirrors and archive mirror pages.

To post a comment you must log in.
Revision history for this message
Jonathan Davies (jpds) wrote :

= Summary =

Use different font colours for the statuses of mirrored releases.

This branch fixes bug #50580.

Revision history for this message
Abel Deuring (adeuring) wrote :

Hi Jonathan,

nice work, thanks for for this branch, and esepcially for adding the tests.
Since this is a UI change, I'll ask one of the UI reviewer to have a look too.

review: Approve (code)
Revision history for this message
Michael Nelson (michael.nelson) wrote :

> Hi Jonathan,
>
> nice work, thanks for for this branch, and esepcially for adding the tests.
> Since this is a UI change, I'll ask one of the UI reviewer to have a look too.

Hi Jonathan,

Thanks for doing this! I've just merged it and taken a look locally, but there's only one mirror there with a known lastupdate. Just a thought for next time, it's helpful to either provide a script that populates the local db with suitable data to demo, or a screenshot etc.

Great!

review: Approve (ui)
Revision history for this message
Guilherme Salgado (salgado) wrote :

On Fri, 2009-12-11 at 12:32 +0000, Michael Nelson wrote:
> Review: Approve ui
> > Hi Jonathan,
> >
> > nice work, thanks for for this branch, and esepcially for adding the tests.
> > Since this is a UI change, I'll ask one of the UI reviewer to have a look too.
>
> Hi Jonathan,
>
> Thanks for doing this! I've just merged it and taken a look locally,
> but there's only one mirror there with a known lastupdate. Just a
> thought for next time, it's helpful to either provide a script that
> populates the local db with suitable data to demo, or a screenshot
> etc.

Even better would be to add mirrors to the -dev sampledata. To do that
you can just create the mirrors on https://launchpad.dev and follow the
instructions on database/sampledata/README

--
Guilherme Salgado <email address hidden>

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'
2--- lib/canonical/launchpad/icing/style-3-0.css 2009-12-07 13:53:47 +0000
3+++ lib/canonical/launchpad/icing/style-3-0.css 2009-12-11 00:13:18 +0000
4@@ -967,3 +967,13 @@
5 .codeimportREVIEWED {color: green;}
6 .codeimportSUSPENDED {color: red;}
7 .codeimportFAILING {color: red;}
8+
9+.distromirrorstatusUP {color: green;}
10+.distromirrorstatusONEHOURBEHIND {color: green;}
11+.distromirrorstatusTWOHOURSBEHIND {color: green;}
12+.distromirrorstatusFOURHOURSBEHIND {color: green;}
13+.distromirrorstatusSIXHOURSBEHIND {color: #f60;}
14+.distromirrorstatusONEDAYBEHIND {color: #f60;}
15+.distromirrorstatusTWODAYSBEHIND {color: red;}
16+.distromirrorstatusONEWEEKBEHIND {color: red;}
17+.distromirrorstatusUNKNOWN {color: grey;}
18
19=== modified file 'lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt'
20--- lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt 2009-11-22 15:43:16 +0000
21+++ lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt 2009-12-11 00:13:18 +0000
22@@ -47,6 +47,10 @@
23 (u'Archive-mirror', u'http', u'128 Kbps', u'Last update unknown')]
24 United Kingdom:
25 [(u'Canonical-archive', u'http', u'100 Mbps', u'Last update unknown')]
26+ >>> find_tags_by_class(browser.contents, 'distromirrorstatusSIXHOURSBEHIND')
27+ [<span class="distromirrorstatusSIXHOURSBEHIND">Six hours behind</span>]
28+ >>> find_tags_by_class(browser.contents, 'distromirrorstatusUNKNOWN')[0]
29+ <span class="distromirrorstatusUNKNOWN">Last update unknown</span>
30
31 Freshness doesn't make sense for CD mirrors so it is not shown for them.
32
33
34=== modified file 'lib/lp/registry/templates/distributionmirror-macros.pt'
35--- lib/lp/registry/templates/distributionmirror-macros.pt 2009-10-26 18:40:04 +0000
36+++ lib/lp/registry/templates/distributionmirror-macros.pt 2009-12-11 00:13:18 +0000
37@@ -50,7 +50,8 @@
38 </td>
39 <td tal:condition="show_freshness"
40 tal:define="freshness mirror/getOverallFreshness">
41- <span tal:replace="freshness/title" />
42+ <span tal:content="freshness/title"
43+ tal:attributes="class string:distromirrorstatus${freshness/name}" />
44 </td>
45 </tr>
46
47@@ -110,7 +111,8 @@
48 <tr tal:repeat="arch_series arch_series">
49 <td tal:content="arch_series/distro_arch_series/distroseries/title" />
50 <td tal:content="arch_series/distro_arch_series/architecturetag" />
51- <td tal:content="arch_series/freshness/title" />
52+ <td tal:content="arch_series/freshness/title"
53+ tal:attributes="class string:distromirrorstatus${arch_series/freshness/name}" />
54 </tr>
55 </tbody>
56 </table>
57@@ -132,7 +134,8 @@
58 <tbody>
59 <tr tal:repeat="source_series source_series">
60 <td tal:content="source_series/distroseries/title" />
61- <td tal:content="source_series/freshness/title" />
62+ <td tal:content="source_series/freshness/title"
63+ tal:attributes="class string:distromirrorstatus${source_series/freshness/name}" />
64 </tr>
65 </tbody>
66 </table>