Merge lp:~wgrant/launchpad/code-hide-languages into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17964
Proposed branch: lp:~wgrant/launchpad/code-hide-languages
Merge into: lp:launchpad
Diff against target: 51 lines (+13/-5)
2 files modified
lib/lp/registry/stories/product/xx-product-index.txt (+2/-0)
lib/lp/registry/templates/product-index.pt (+11/-5)
To merge this branch: bzr merge lp:~wgrant/launchpad/code-hide-languages
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+290016@code.launchpad.net

Commit message

Hide the Product Code portlet if it would show nothing or just languages.

Description of the change

Hide the Product Code portlet if it would show nothing or just languages.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/registry/stories/product/xx-product-index.txt'
2--- lib/lp/registry/stories/product/xx-product-index.txt 2016-03-23 12:16:54 +0000
3+++ lib/lp/registry/stories/product/xx-product-index.txt 2016-03-24 09:54:48 +0000
4@@ -27,11 +27,13 @@
5
6 >>> import transaction
7 >>> from lp.services.database.sqlbase import flush_database_updates
8+ >>> from lp.registry.enums import VCSType
9 >>> from lp.registry.model.product import Product
10 >>> from lp.testing import ANONYMOUS, login, logout
11 >>> login(ANONYMOUS)
12
13 >>> tomcat = Product.selectOneBy(name="tomcat")
14+ >>> tomcat.vcs = VCSType.GIT
15 >>> tomcat.homepageurl = "http://home.page/"
16 >>> tomcat.sourceforgeproject = "sf-tomcat"
17 >>> tomcat.wikiurl = "http://wiki.url/"
18
19=== modified file 'lib/lp/registry/templates/product-index.pt'
20--- lib/lp/registry/templates/product-index.pt 2016-03-24 02:58:05 +0000
21+++ lib/lp/registry/templates/product-index.pt 2016-03-24 09:54:48 +0000
22@@ -187,7 +187,16 @@
23 </div>
24
25 <div class="yui-g">
26- <div class="yui-u first">
27+ <tal:comment replace="nothing">
28+ The Code section could show something if the project had
29+ programming languages set or settable, but that field on its
30+ own is so boring that it's not sufficient to reveal the
31+ section.
32+ </tal:comment>
33+ <div class="yui-u first"
34+ tal:define="trunk context/development_focus/branch;
35+ trunk_visible trunk/required:launchpad.View|nothing"
36+ tal:condition="python: trunk_visible or context.inferred_vcs">
37 <div id="code-info" class="portlet">
38 <h2>
39 <span class="see-all"><a
40@@ -196,10 +205,7 @@
41 Code
42 </h2>
43
44- <dl id="dev-focus"
45- tal:define="trunk context/development_focus/branch;
46- trunk_visible trunk/required:launchpad.View|nothing"
47- tal:condition="trunk_visible">
48+ <dl id="dev-focus" tal:condition="trunk_visible">
49 <dt>Development focus:</dt>
50 <dd>
51 <p>