Merge lp:~huwshimi/launchpad/table-headings-728187 into lp:launchpad

Proposed by Huw Wilkins
Status: Merged
Approved by: Huw Wilkins
Approved revision: no longer in the source branch.
Merged at revision: 13352
Proposed branch: lp:~huwshimi/launchpad/table-headings-728187
Merge into: lp:launchpad
Diff against target: 105 lines (+21/-16)
3 files modified
lib/canonical/launchpad/icing/style-3-0.css (+8/-0)
lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt (+2/-2)
lib/lp/registry/templates/distributionmirror-macros.pt (+11/-14)
To merge this branch: bzr merge lp:~huwshimi/launchpad/table-headings-728187
Reviewer Review Type Date Requested Status
Benji York (community) code Approve
Review via email: mp+66008@code.launchpad.net

Commit message

[r=benji][bug=728187] On mirror pages: fixed table headings to be consistent with other tables in LP, removed redundant inline styles and replaced some with external CSS and fixed bottom table lines length.

Description of the change

Fixed table headings to be consistent with other tables in LP (bug #728187). Because this has multiple table headers I couldn't just reuse the existing classes.

Also removed redundant inline styles and replaced some with external CSS.

Fixed bottom table lines length.

A screenshot of all these fixes is here: https://launchpadlibrarian.net/74192351/table_headers.png

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

This branch looks good.

One thought: if it works, it'd be a slight improvement (IMHO) to use
colspan="5" for the blank row instead of having five table cells. In
fact it might be even nicer to give the last row a custom class and
style that row such that the spacing is achieved without having a blank
row.

review: Approve (code)
Revision history for this message
Huw Wilkins (huwshimi) wrote :

I have modified this to remove the empty cells and added a css classes to manage height and style. I could not remove the row altogether as we still require the surrounding borders (I guess technically this is possible, but only by adding more HTML/CSS).

Revision history for this message
Benji York (benji) wrote :

I like it.

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 2011-06-28 19:24:39 +0000
3+++ lib/canonical/launchpad/icing/style-3-0.css 2011-07-01 10:34:30 +0000
4@@ -518,6 +518,7 @@
5 th, td {
6 vertical-align: baseline;
7 }
8+.head th,
9 thead th, tr.thead th {
10 text-align: left;
11 vertical-align: bottom;
12@@ -624,6 +625,7 @@
13 table.listing th {
14 font-weight: bold;
15 }
16+table.listing .head, table.listing .head th,
17 table.listing thead, table.listing thead th, table.listing tfoot tr,
18 table.listing tr.thead th {
19 border: 1px solid #d2d2d2;
20@@ -658,6 +660,12 @@
21 border: 1px #d2d2d2;
22 border-style: dotted none none none;
23 }
24+table.listing .section-break td {
25+ border-width: 1px 0 0 0;
26+ border-style: solid;
27+ border-color: #d2d2d2;
28+ height: 1em;
29+ }
30 table.listing .note td {
31 border-style: none;
32 }
33
34=== modified file 'lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt'
35--- lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt 2010-12-18 00:54:04 +0000
36+++ lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt 2011-07-01 10:34:30 +0000
37@@ -12,13 +12,13 @@
38 ... country = extract_text(header.find('th'))
39 ... mirrors = []
40 ... for tr in header.findNextSiblings('tr'):
41- ... if 'highlight' in str(tr.attrs):
42+ ... if 'head' in str(tr.attrs):
43 ... print "%s: %s" % (country, mirrors)
44 ... country = extract_text(tr.find('th'))
45 ... if country == 'Total':
46 ... break
47 ... mirrors = []
48- ... elif 'lesser' in str(tr.attrs):
49+ ... elif 'section-break' in str(tr.attrs):
50 ... # This is an empty row to visually separate the mirrors
51 ... # from different countries, so we'll just skip it.
52 ... pass
53
54=== modified file 'lib/lp/registry/templates/distributionmirror-macros.pt'
55--- lib/lp/registry/templates/distributionmirror-macros.pt 2010-12-16 20:40:07 +0000
56+++ lib/lp/registry/templates/distributionmirror-macros.pt 2011-07-01 10:34:30 +0000
57@@ -16,16 +16,14 @@
58 <table class="listing" id="mirrors_list">
59 <tbody>
60 <tal:country_and_mirrors repeat="country_and_mirrors mirrors_by_country">
61- <tr class="highlight">
62- <th colspan="2" style="text-align: left"
63+ <tr class="head">
64+ <th colspan="2"
65 tal:content="country_and_mirrors/country" />
66- <th style="text-align: left"
67- tal:content="country_and_mirrors/throughput"/>
68- <th style="text-align: left" tal:condition="show_mirror_type">
69+ <th tal:content="country_and_mirrors/throughput"/>
70+ <th tal:condition="show_mirror_type">
71 Type
72 </th>
73- <th style="text-align: left"
74- tal:define="mirror_count country_and_mirrors/number">
75+ <th tal:define="mirror_count country_and_mirrors/number">
76 <tal:count replace="mirror_count" />
77 <span tal:condition="python:mirror_count == 1">mirror</span>
78 <span tal:condition="python:mirror_count != 1">mirrors</span>
79@@ -59,20 +57,19 @@
80 Include a blank row after the last entry of a country to provide
81 vertical spacing to separate the next country.
82 </tal:comment>
83- <tr class="lesser">
84- <td>&nbsp;</td>
85+ <tr class="section-break">
86+ <td colspan="5" />
87 </tr>
88
89 </tal:country_and_mirrors>
90- <tr class="highlight">
91- <th colspan="5" style="text-align: left; font-weight: bold;">Total</th>
92+ <tr class="head">
93+ <th colspan="5" >Total</th>
94 </tr>
95 <tr>
96 <td colspan="2" />
97- <td style="text-align: left; font-weight: bold;"
98- tal:content="total_throughput" />
99+ <td tal:content="total_throughput" />
100 <td tal:condition="show_mirror_type"></td>
101- <td style="text-align: left; font-weight: bold;">
102+ <td>
103 <tal:count replace="total_mirror_count" />
104 <span tal:condition="python:total_mirror_count == 1">mirror</span>
105 <span tal:condition="python:total_mirror_count != 1">mirrors</span>