launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #09579
[Merge] lp:~huwshimi/launchpad/sidebar-cleanup into lp:launchpad
Huw Wilkins has proposed merging lp:~huwshimi/launchpad/sidebar-cleanup into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #434781 in Launchpad itself: "Series and milestone targeted bugs portlets don't have numbers line up"
https://bugs.launchpad.net/launchpad/+bug/434781
For more details, see:
https://code.launchpad.net/~huwshimi/launchpad/sidebar-cleanup/+merge/113475
This branch cleans up a lot of our sidebar HTML/CSS. It makes the UI more consistent, it makes the HTML/CSS more consistent and removes code.
In this branch:
- Sidebar CSS all lives in one file now (sidebar_portlets.css)
- Removed some inline styles and replaced with consistent classes for the involvement portlet.
- Standardised the UI, HTML and CSS of portlets with counts (status counts, tags, series, milestones).
- Fixed some spacing issues with CVE reports and tags porlets.
- Renamed a few css files.
--
https://code.launchpad.net/~huwshimi/launchpad/sidebar-cleanup/+merge/113475
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~huwshimi/launchpad/sidebar-cleanup into lp:launchpad.
=== renamed file 'lib/canonical/launchpad/icing/css/components/portlet.css' => 'lib/canonical/launchpad/icing/css/components/portlets.css'
=== renamed file 'lib/canonical/launchpad/icing/css/components/pofiling_info.css' => 'lib/canonical/launchpad/icing/css/components/profiling_info.css'
=== renamed file 'lib/canonical/launchpad/icing/css/components/sidebar_components.css' => 'lib/canonical/launchpad/icing/css/components/sidebar_portlets.css'
--- lib/canonical/launchpad/icing/css/components/sidebar_components.css 2012-05-17 20:55:46 +0000
+++ lib/canonical/launchpad/icing/css/components/sidebar_portlets.css 2012-07-05 01:50:24 +0000
@@ -1,17 +1,15 @@
-/* =========================
- Universal
+/******************************************************************************
Side portlets
*/
.side {
padding: 0.5em;
}
.side .portlet {
- width: 90%;
- margin: 0 auto 1em;
+ margin: 0 0 1em 0;
+ padding: 0.5em;
+ background: #fbfbfb;
border: 1px solid #dedede;
border-radius: 5px;
- padding: 0.5em;
- background: #fbfbfb;
}
.side h2 {
font-size: 16px;
@@ -21,9 +19,15 @@
font-size: 14px;
line-height: 18px;
}
-.side ul {
- background: #fbfbfb;
+.side div.breaker,
+.side li.breaker {
+ margin: 8px 0;
+ border-top: 1px solid #e3e3e3;
}
+
+/******************************************************************************
+ Downloads portlet
+*/
.downloads li {
margin: 0;
padding: 2px 0 0;
@@ -39,27 +43,33 @@
padding-right: 40px;
color: #fff;
}
+.downloads .version,
+.downloads .released {
+ background: #d3e3c7;
+ padding: 0.2em 1em;
+ }
.downloads .version {
border-radius: 5px 5px 0 0;
- background: #d3e3c7;
- padding: 0.2em 1em;
}
.downloads .released {
margin: .3em 0 .5em 0;
border-radius: 0 0 5px 5px;
- background: #d3e3c7;
- padding: 0.2em 1em;
}
.downloads .alternate {
padding: 0 0 0 1em;
}
+
+/******************************************************************************
+ Involvement portlet
+*/
.involvement li {
border-top: 1px solid #d0d0d0;
padding: 0;
font-weight: bold;
}
+.involvement li.first,
.involvement li.single {
- border-top: 0;
+ border-top: none;
}
.involvement a {
display: block;
@@ -68,9 +78,7 @@
.involvement li.disabled {
color: #cccccc;
}
-.involvement-service-links li.disabled img {
- margin-bottom: 0;
- }
+.involvement-service-links li.disabled img,
.involvement-service-links li.disabled span {
margin-bottom: 0;
}
@@ -86,6 +94,10 @@
text-decoration: none;
background-color: #eee;
}
+
+/******************************************************************************
+ Announcements portlet
+*/
.announcements li {
margin-bottom: 0.5em;
/* Some announcements have long strings of characters as section headers
@@ -106,3 +118,17 @@
.announcement .registered {
margin-top: -2px;
}
+
+/******************************************************************************
+ Data list portlet
+*/
+.side ul.data-list li {
+ padding-bottom: 0;
+ }
+.side ul.data-list span.count {
+ display: inline-block;
+ min-width: 3em;
+ text-align: right;
+ padding-right: 0.25em;
+ }
+
=== modified file 'lib/canonical/launchpad/icing/style.css'
--- lib/canonical/launchpad/icing/style.css 2012-06-04 17:47:25 +0000
+++ lib/canonical/launchpad/icing/style.css 2012-07-05 01:50:24 +0000
@@ -665,23 +665,6 @@
display: inline;
}
-/* Tags portlet */
-.tag-list {
- margin-bottom: 0.5em;
- }
-.tag-list li {
- padding-bottom: 0;
- }
-.tag-count {
- display: inline-block;
- min-width: 1.5em;
- text-align: right;
- padding-right: 0.25em;
- }
-.edit-official-tags {
- margin-top: 1em;
-}
-
/* === Translations === */
.translation code {font-weight: bold;} /* an interpolation code, such as %i */
=== modified file 'lib/lp/answers/browser/questiontarget.py'
--- lib/lp/answers/browser/questiontarget.py 2012-02-17 04:09:06 +0000
+++ lib/lp/answers/browser/questiontarget.py 2012-07-05 01:50:24 +0000
@@ -113,7 +113,7 @@
return """
<div id="involvement" class="portlet involvement">
<ul>
- <li style="border: none">
+ <li class="single">
<a class="menu-link-ask_question sprite answers"
href="%s">Ask a question</a>
</li>
=== modified file 'lib/lp/app/templates/navigationmenu-related-pages.pt'
--- lib/lp/app/templates/navigationmenu-related-pages.pt 2009-08-25 18:50:32 +0000
+++ lib/lp/app/templates/navigationmenu-related-pages.pt 2012-07-05 01:50:24 +0000
@@ -2,7 +2,7 @@
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
id="related-pages" class="portlet">
- <h2 tal:content="view/title">Menu title</h2>
+ <h2 tal:condition="view/title" tal:content="view/title">Menu title</h2>
<ul>
<tal:link tal:repeat="link view/links">
=== modified file 'lib/lp/blueprints/browser/specificationtarget.py'
--- lib/lp/blueprints/browser/specificationtarget.py 2012-05-17 07:46:56 +0000
+++ lib/lp/blueprints/browser/specificationtarget.py 2012-07-05 01:50:24 +0000
@@ -454,7 +454,7 @@
return """
<div id="involvement" class="portlet involvement">
<ul>
- <li style="border: none">
+ <li class="first">
<a class="menu-link-register_blueprint sprite blueprints"
href="%s">Register a blueprint</a>
</li>
=== modified file 'lib/lp/bugs/javascript/tests/test_bugtarget_portlet_bugtags.js'
--- lib/lp/bugs/javascript/tests/test_bugtarget_portlet_bugtags.js 2012-02-10 10:07:48 +0000
+++ lib/lp/bugs/javascript/tests/test_bugtarget_portlet_bugtags.js 2012-07-05 01:50:24 +0000
@@ -19,9 +19,9 @@
module.setup_taglist({io_provider: mockio});
mockio.success({
responseText:
- '<div class="portletBody"><div class="section">' +
+ '<div class="portletBody">' +
'<h2>Tags</h2><ul class="tag-list">' +
- '</ul></div></div>',
+ '</ul></div>',
responseHeaders: {'Content-type': 'text/html'}});
Y.Assert.areEqual('/launchpad/+bugtarget-portlet-tags-content',
mockio.last_request.url,
@@ -33,9 +33,9 @@
module.setup_taglist({io_provider: mockio});
mockio.success({
responseText:
- '<div class="portletBody"><div class="section">' +
+ '<div class="portletBody">' +
'<h2>Tags</h2><ul class="tag-list">' +
- '</ul></div></div>',
+ '</ul></div>',
responseHeaders: {'Content-type': 'text/html'}});
var tags = Y.all('.tag-list li');
var show_more_link = Y.one('#show-more-tags-link');
@@ -51,7 +51,7 @@
test_twenty_tags_or_fewer: function() {
var mockio = new Y.lp.testing.mockio.MockIo();
- var response = '<div class="portletBody"><div class="section">' +
+ var response = '<div class="portletBody">' +
'<h2>Tags</h2><ul class="tag-list">';
var i;
module.setup_taglist({io_provider: mockio});
@@ -59,7 +59,7 @@
response += '<li><span class="tag-count">'+i+'</span>' +
'<a href="+bugs?field.tag=crash">tag'+i+'</a></li>';
}
- response += '</ul></div></div>';
+ response += '</ul></div>';
mockio.success({
responseText: response,
responseHeaders: {'Content-type': 'text/html'}});
@@ -76,7 +76,7 @@
test_more_than_twenty_tags: function() {
var mockio = new Y.lp.testing.mockio.MockIo();
- var response = '<div class="portletBody"><div class="section">' +
+ var response = '<div class="portletBody">' +
'<h2>Tags</h2><ul class="tag-list">';
var i;
module.setup_taglist({io_provider: mockio});
@@ -84,7 +84,7 @@
response += '<li><span class="tag-count">' + i + '</span>' +
'<a href="+bugs?field.tag=crash">tag'+ i + '</a></li>';
}
- response += '</ul></div></div>';
+ response += '</ul></div>';
mockio.success({
responseText: response,
responseHeaders: {'Content-type': 'text/html'}});
=== modified file 'lib/lp/bugs/templates/buglisting-default.pt'
--- lib/lp/bugs/templates/buglisting-default.pt 2012-06-15 16:23:50 +0000
+++ lib/lp/bugs/templates/buglisting-default.pt 2012-07-05 01:50:24 +0000
@@ -128,7 +128,7 @@
<div id="bug-portlets" tal:condition="view/should_show_bug_information">
<div id="involvement" class="portlet">
<ul class="involvement">
- <li style="border: 0">
+ <li class="first">
<a href="+filebug" class="menu-link-filebug sprite bugs">
Report a bug
</a>
=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2012-05-18 05:31:54 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2012-07-05 01:50:24 +0000
@@ -6,136 +6,107 @@
template can be rendered by a view that does not have count
information available.
</tal:comment>
-<table class="bug-links">
-<tbody>
- <tr tal:define="count view/new_bugs_count|nothing;
+<ul class="data-list">
+ <li tal:define="count view/new_bugs_count|nothing;
plural string: New bugs;
singular string: New bug;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href string:${view/new_bugs_url}">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
- <tr tal:define="count view/open_bugs_count|nothing;
+ </li>
+ <li tal:define="count view/open_bugs_count|nothing;
plural string: Open bugs;
singular string: Open bug;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href string:${view/open_bugs_url}">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
- <tr tal:define="count view/inprogress_bugs_count|nothing;
+ </li>
+ <li tal:define="count view/inprogress_bugs_count|nothing;
plural string: In-progress bugs;
singular string: In-progress bug;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href view/inprogress_bugs_url">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
- <tr tal:define="count view/critical_bugs_count|nothing;
+ </li>
+ <li tal:define="count view/critical_bugs_count|nothing;
plural string: Critical bugs;
singular string: Critical bug;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href string:${view/critical_bugs_url}">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
- <tr tal:define="count view/high_bugs_count|nothing;
+ </li>
+ <li tal:define="count view/high_bugs_count|nothing;
plural string: High importance bugs;
singular string: High importance bug;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href view/high_bugs_url">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
- <tr tal:condition="view/expirable_bugs_url"
+ </li>
+ <li tal:condition="view/expirable_bugs_url"
tal:define="count view/expirable_bugs_count|nothing;
plural string: Incomplete bugs;
singular string: Incomplete bug;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href string:${view/expirable_bugs_url}">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
(can expire)
- </td>
- </tr>
- <tal:comment condition="nothing">
- This empty table row is used to create space between filter groups.
- </tal:comment>
- <tr><td colspan="2"><br /></td></tr>
- <tr tal:condition="view/user"
+ </li>
+ <li class="breaker"></li>
+ <li tal:condition="view/user"
tal:define="count view/my_bugs_count|nothing;
plural string: Bugs assigned to me;
singular string: Bug assigned to me;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href string:${view/my_bugs_url}">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
- <tr tal:condition="view/user"
+ </li>
+ <li tal:condition="view/user"
tal:define="count view/my_reported_bugs_count|nothing;
plural string: Bugs reported by me;
singular string: Bug reported by me;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href string:${view/my_reported_bugs_url}">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
- <tr tal:condition="view/user">
+ </li>
+ <li tal:condition="view/user">
<tal:comment condition="nothing">
No count here, because generating it is expensive.
</tal:comment>
- <td class="bugs-count" />
- <td class="bugs-link">
+ <span class="count"></span>
<a tal:attributes="href string:${view/my_affecting_bugs_url}">
Bugs affecting me
</a>
- </td>
- </tr>
-
- <tr><td colspan="2"><br /></td></tr>
-
- <tr>
+ </li>
+ <li class="breaker"></li>
+ <li>
<tal:comment condition="nothing">
No count here, because generating it is expensive.
</tal:comment>
- <td class="bugs-count" />
- <td class="bugs-link">
+ <span class="count"></span>
<a tal:attributes="href string:${view/bugs_fixed_elsewhere_url}">
Bugs fixed elsewhere
</a>
- </td>
- </tr>
- <tr tal:define="count view/bugs_with_patches_count|nothing;
+ </li>
+ <li tal:define="count view/bugs_with_patches_count|nothing;
plural string: Bugs with patches;
singular string: Bug with a patch;">
- <td class="bugs-count" tal:content="count"/>
- <td class="bugs-link">
+ <span class="count" tal:content="count"/>
<a tal:attributes="href string:${context/fmt:url}/+patches">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
- <tr tal:define="count view/open_cve_bugs_count|nothing;
+ </li>
+ <li tal:define="count view/open_cve_bugs_count|nothing;
plural string: Open CVE bugs;
singular string: Open CVE bug;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href string:${view/open_cve_bugs_url}">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
@@ -146,19 +117,15 @@
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
</span>
- </td>
- </tr>
- <tr tal:condition="view/pending_bugwatches_url"
+ </li>
+ <li tal:condition="view/pending_bugwatches_url"
tal:define="count view/pending_bugwatches_count|nothing;
plural string: Bugs need forwarding upstream;
singular string: Bug needs forwarding upstream;">
- <td class="bugs-count" tal:content="count" />
- <td class="bugs-link">
+ <span class="count" tal:content="count" />
<a tal:attributes="href string:${view/pending_bugwatches_url}">
<metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
</a>
- </td>
- </tr>
-</tbody>
-</table>
+ </li>
+</ul>
</tal:portlet-bug-filters-content>
=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt 2012-02-10 10:07:48 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-bugtags.pt 2012-07-05 01:50:24 +0000
@@ -17,12 +17,10 @@
</script>
<a href="" id="show-more-tags-link" class="js-action hidden">Show more tags…</a>
<a href="" id="show-fewer-tags-link" class="js-action hidden">Show fewer tags…</a>
- <ul class="edit-official-tags">
- <li tal:condition="view/show_manage_tags_link">
- <a class="sprite edit"
- tal:attributes="href context/fmt:url/+manage-official-tags">
- Edit official tags
- </a>
- </li>
- </ul>
+ <div class="breaker"></div>
+ <a class="sprite edit"
+ tal:condition="view/show_manage_tags_link"
+ tal:attributes="href context/fmt:url/+manage-official-tags">
+ Edit official tags
+ </a>
</div>
=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-tags-content.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-tags-content.pt 2011-11-17 03:09:28 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-tags-content.pt 2012-07-05 01:50:24 +0000
@@ -1,17 +1,16 @@
-<div xmlns:tal="http://xml.zope.org/namespaces/tal"
+<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
- class="portletBody">
- <div class="section" tal:define="tags_cloud_data view/tags_cloud_data">
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n">
+ <tal:block define="tags_cloud_data view/tags_cloud_data">
<h2>Tags</h2>
- <ul class="tag-list">
+ <ul class="data-list">
<li tal:repeat="tag_info tags_cloud_data">
<span tal:content="tag_info/count"
- class="tag-count" />
+ class="count" />
<a tal:content="tag_info/tag"
tal:attributes="href tag_info/url" />
</li>
</ul>
- </div>
-</div>
+ </tal:block>
+</tal:block>
=== modified file 'lib/lp/bugs/templates/bugtask-portlet-milestonebugs.pt'
--- lib/lp/bugs/templates/bugtask-portlet-milestonebugs.pt 2009-09-16 17:05:13 +0000
+++ lib/lp/bugs/templates/bugtask-portlet-milestonebugs.pt 2012-07-05 01:50:24 +0000
@@ -8,17 +8,14 @@
<h2>Milestone-targeted bugs</h2>
- <div class="portletBody">
- <table width="100%">
- <tr tal:repeat="milestone_openbugs milestone_buglistings">
- <td>
- <a href=""
- tal:content="milestone_openbugs/title"
- tal:attributes="href milestone_openbugs/url">sid</a>
- </td>
- <td><span tal:replace="milestone_openbugs/count">2</span></td>
- </tr>
- </table>
- </div>
+ <ul class="data-list">
+ <li tal:repeat="milestone_openbugs milestone_buglistings">
+ <span tal:content="milestone_openbugs/count"
+ class="count">2</span>
+ <a href=""
+ tal:content="milestone_openbugs/title"
+ tal:attributes="href milestone_openbugs/url">sid</a>
+ </li>
+ </ul>
</div>
=== modified file 'lib/lp/bugs/templates/bugtask-portlet-seriesbugs.pt'
--- lib/lp/bugs/templates/bugtask-portlet-seriesbugs.pt 2009-08-17 16:02:53 +0000
+++ lib/lp/bugs/templates/bugtask-portlet-seriesbugs.pt 2012-07-05 01:50:24 +0000
@@ -8,17 +8,14 @@
<h2>Series-targeted bugs</h2>
- <div class="portletBody">
- <table width="100%">
- <tr tal:repeat="series_openbugs series_buglistings">
- <td>
- <a href=""
- tal:content="series_openbugs/title"
- tal:attributes="href series_openbugs/url">sid</a>
- </td>
- <td><span tal:replace="series_openbugs/count">2</span></td>
- </tr>
- </table>
- </div>
+ <ul class="data-list">
+ <li tal:repeat="series_openbugs series_buglistings">
+ <span tal:content="series_openbugs/count"
+ class="count">2</span>
+ <a href=""
+ tal:content="series_openbugs/title"
+ tal:attributes="href series_openbugs/url">sid</a>
+ </li>
+ </ul>
</div>
=== modified file 'lib/lp/bugs/tests/bug.py'
--- lib/lp/bugs/tests/bug.py 2012-04-16 23:02:44 +0000
+++ lib/lp/bugs/tests/bug.py 2012-07-05 01:50:24 +0000
@@ -295,9 +295,8 @@
"""
browser.open(
'http://bugs.launchpad.dev/%s/+portlet-bugfilters' % target)
- table = BeautifulSoup(browser.contents).find('table', 'bug-links')
- [tbody_info] = table('tbody')
- print_table(tbody_info)
+ ul = BeautifulSoup(browser.contents).find('ul', 'data-list')
+ print_ul(ul)
def print_bugfilters_portlet_filled(browser, target):
@@ -316,8 +315,17 @@
browser.open(
'http://bugs.launchpad.dev'
'/%s/+bugtarget-portlet-bugfilters-stats' % target)
- table = BeautifulSoup('<table>%s</table>' % browser.contents)
- print_table(table)
+ ul = BeautifulSoup(browser.contents).find('ul', 'data-list')
+ print_ul(ul)
+
+
+def print_ul(ul):
+ """Print the data from a list."""
+ li_content = []
+ for li in ul.findAll('li'):
+ li_content.append(extract_text(li))
+ if len(li_content) > 0:
+ print '\n'.join(li_content)
def print_bug_tag_anchors(anchors):
Follow ups