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
=== modified file 'lib/canonical/launchpad/icing/style-3-0.css'
--- lib/canonical/launchpad/icing/style-3-0.css 2011-06-28 19:24:39 +0000
+++ lib/canonical/launchpad/icing/style-3-0.css 2011-07-01 10:34:30 +0000
@@ -518,6 +518,7 @@
518th, td {518th, td {
519 vertical-align: baseline;519 vertical-align: baseline;
520 }520 }
521.head th,
521thead th, tr.thead th {522thead th, tr.thead th {
522 text-align: left;523 text-align: left;
523 vertical-align: bottom;524 vertical-align: bottom;
@@ -624,6 +625,7 @@
624table.listing th {625table.listing th {
625 font-weight: bold;626 font-weight: bold;
626 }627 }
628table.listing .head, table.listing .head th,
627table.listing thead, table.listing thead th, table.listing tfoot tr,629table.listing thead, table.listing thead th, table.listing tfoot tr,
628table.listing tr.thead th {630table.listing tr.thead th {
629 border: 1px solid #d2d2d2;631 border: 1px solid #d2d2d2;
@@ -658,6 +660,12 @@
658 border: 1px #d2d2d2;660 border: 1px #d2d2d2;
659 border-style: dotted none none none;661 border-style: dotted none none none;
660 }662 }
663table.listing .section-break td {
664 border-width: 1px 0 0 0;
665 border-style: solid;
666 border-color: #d2d2d2;
667 height: 1em;
668 }
661table.listing .note td {669table.listing .note td {
662 border-style: none;670 border-style: none;
663 }671 }
664672
=== modified file 'lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt'
--- lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt 2010-12-18 00:54:04 +0000
+++ lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt 2011-07-01 10:34:30 +0000
@@ -12,13 +12,13 @@
12 ... country = extract_text(header.find('th'))12 ... country = extract_text(header.find('th'))
13 ... mirrors = []13 ... mirrors = []
14 ... for tr in header.findNextSiblings('tr'):14 ... for tr in header.findNextSiblings('tr'):
15 ... if 'highlight' in str(tr.attrs):15 ... if 'head' in str(tr.attrs):
16 ... print "%s: %s" % (country, mirrors)16 ... print "%s: %s" % (country, mirrors)
17 ... country = extract_text(tr.find('th'))17 ... country = extract_text(tr.find('th'))
18 ... if country == 'Total':18 ... if country == 'Total':
19 ... break19 ... break
20 ... mirrors = []20 ... mirrors = []
21 ... elif 'lesser' in str(tr.attrs):21 ... elif 'section-break' in str(tr.attrs):
22 ... # This is an empty row to visually separate the mirrors22 ... # This is an empty row to visually separate the mirrors
23 ... # from different countries, so we'll just skip it.23 ... # from different countries, so we'll just skip it.
24 ... pass24 ... pass
2525
=== modified file 'lib/lp/registry/templates/distributionmirror-macros.pt'
--- lib/lp/registry/templates/distributionmirror-macros.pt 2010-12-16 20:40:07 +0000
+++ lib/lp/registry/templates/distributionmirror-macros.pt 2011-07-01 10:34:30 +0000
@@ -16,16 +16,14 @@
16 <table class="listing" id="mirrors_list">16 <table class="listing" id="mirrors_list">
17 <tbody>17 <tbody>
18 <tal:country_and_mirrors repeat="country_and_mirrors mirrors_by_country">18 <tal:country_and_mirrors repeat="country_and_mirrors mirrors_by_country">
19 <tr class="highlight">19 <tr class="head">
20 <th colspan="2" style="text-align: left"20 <th colspan="2"
21 tal:content="country_and_mirrors/country" />21 tal:content="country_and_mirrors/country" />
22 <th style="text-align: left"22 <th tal:content="country_and_mirrors/throughput"/>
23 tal:content="country_and_mirrors/throughput"/>23 <th tal:condition="show_mirror_type">
24 <th style="text-align: left" tal:condition="show_mirror_type">
25 Type24 Type
26 </th>25 </th>
27 <th style="text-align: left"26 <th tal:define="mirror_count country_and_mirrors/number">
28 tal:define="mirror_count country_and_mirrors/number">
29 <tal:count replace="mirror_count" />27 <tal:count replace="mirror_count" />
30 <span tal:condition="python:mirror_count == 1">mirror</span>28 <span tal:condition="python:mirror_count == 1">mirror</span>
31 <span tal:condition="python:mirror_count != 1">mirrors</span>29 <span tal:condition="python:mirror_count != 1">mirrors</span>
@@ -59,20 +57,19 @@
59 Include a blank row after the last entry of a country to provide57 Include a blank row after the last entry of a country to provide
60 vertical spacing to separate the next country.58 vertical spacing to separate the next country.
61 </tal:comment>59 </tal:comment>
62 <tr class="lesser">60 <tr class="section-break">
63 <td>&nbsp;</td>61 <td colspan="5" />
64 </tr>62 </tr>
6563
66 </tal:country_and_mirrors>64 </tal:country_and_mirrors>
67 <tr class="highlight">65 <tr class="head">
68 <th colspan="5" style="text-align: left; font-weight: bold;">Total</th>66 <th colspan="5" >Total</th>
69 </tr>67 </tr>
70 <tr>68 <tr>
71 <td colspan="2" />69 <td colspan="2" />
72 <td style="text-align: left; font-weight: bold;"70 <td tal:content="total_throughput" />
73 tal:content="total_throughput" />
74 <td tal:condition="show_mirror_type"></td>71 <td tal:condition="show_mirror_type"></td>
75 <td style="text-align: left; font-weight: bold;">72 <td>
76 <tal:count replace="total_mirror_count" />73 <tal:count replace="total_mirror_count" />
77 <span tal:condition="python:total_mirror_count == 1">mirror</span>74 <span tal:condition="python:total_mirror_count == 1">mirror</span>
78 <span tal:condition="python:total_mirror_count != 1">mirrors</span>75 <span tal:condition="python:total_mirror_count != 1">mirrors</span>