Merge lp://staging/~cprov/launchpad/bug-416789-distribution-ppas-icons into lp://staging/launchpad

Proposed by Celso Providelo
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~cprov/launchpad/bug-416789-distribution-ppas-icons
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~cprov/launchpad/bug-416789-distribution-ppas-icons
Reviewer Review Type Date Requested Status
Gavin Panella (community) code Approve
Review via email: mp+11038@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

= Summary =

This branch fixes https://bugs.edge.launchpad.net/bugs/416789 by adjusting the style bits (specially icons) lost during the 3.0 redesign.

It also benefits of IPPA/fmt:link and removes the need of pagetitles.py for that page.

== Tests ==

./bin/test -vv -t xx-ubuntu-ppas.txt

== Demo and Q/A ==

https://launchpad.dev/ubuntu/+ppas

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/soyuz/templates/distribution-portlet-ppa-architectures.pt
  lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt
  lib/canonical/launchpad/pagetitles.py
  lib/lp/soyuz/templates/distribution-ppa-list.pt
  lib/lp/registry/browser/distribution.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqeB5EACgkQ7KBXuXyZSjB28wCgrcNAAF9ofH/XEZPcC8Cbz5XN
KwoAoKePThNUrCZC+aKVyVSZEgaq/GEK
=IjaM
-----END PGP SIGNATURE-----

Revision history for this message
Gavin Panella (allenap) wrote :

Line 107 has a small typo, s/arq/arch, but otherwise it looks good :)

BTW, I just tried using two-column-list in a portlet and it did not work properly; it rendered only one row on the same line, then the others were staggered. Have you seen that?

review: Approve (code)
Revision history for this message
Celso Providelo (cprov) wrote :

On Wed, Sep 2, 2009 at 7:42 AM, Gavin
Panella<email address hidden> wrote:
> Review: Approve code
> Line 107 has a small typo, s/arq/arch, but otherwise it looks good :)

This typo comes from the CSS sprites declaration, I wasn't aware that
my change was the only callsite.
Fixed both.

> BTW, I just tried using two-column-list in a portlet and it did not work properly; it rendered only one row on the same line, then the others were staggered. Have you seen that?

two-column-list only applies to multiples <dl>s, not multiple <dt>s
within the same <dl>:

{{{
<div class="two-columns">
  <dl><dt>C1</dt><dd>one</dd></dl>
  <dl><dt>C2</dt><dd>two</dd></dl>
  <dl><dt>C1</dt><dd>three</dd><dt>C1</dt><dd>three</dd></dl>
</div>
}}}
--
Celso Providelo <email address hidden>
IRC: cprov, Jabber: <email address hidden>, Skype: cprovidelo
1024D/681B6469 C858 2652 1A6E F6A6 037B B3F7 9FF2 583E 681B 6469

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/pagetitles.py'
2--- lib/canonical/launchpad/pagetitles.py 2009-09-02 03:54:47 +0000
3+++ lib/canonical/launchpad/pagetitles.py 2009-09-02 05:37:54 +0000
4@@ -405,8 +405,6 @@
5
6 distribution_builds = ContextTitle('%s builds')
7
8-distribution_ppa_list = ContextTitle('%s Personal Package Archives')
9-
10 distributionsourcepackage_bugs = ContextTitle('Bugs in %s')
11
12 distributionsourcepackage_index = ContextTitle('%s')
13
14=== modified file 'lib/lp/registry/browser/distribution.py'
15--- lib/lp/registry/browser/distribution.py 2009-09-01 10:37:35 +0000
16+++ lib/lp/registry/browser/distribution.py 2009-09-02 05:37:54 +0000
17@@ -653,6 +653,7 @@
18 self.context, purposes=[ArchivePurpose.COPY], user=self.user)
19 return results.order_by('date_created DESC')
20
21+
22 class DistributionPPASearchView(LaunchpadView):
23 """Search PPAs belonging to the Distribution in question."""
24
25@@ -661,6 +662,10 @@
26 self.show_inactive = self.request.get('show_inactive')
27
28 @property
29+ def page_title(self):
30+ return '%s Personal Package Archives' % self.context.title
31+
32+ @property
33 def search_results(self):
34 """Process search form request."""
35 if self.name_filter is None:
36
37=== modified file 'lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt'
38--- lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2009-08-23 05:28:49 +0000
39+++ lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.txt 2009-09-02 05:37:54 +0000
40@@ -37,11 +37,14 @@
41 >>> print extract_text(
42 ... find_tag_by_id(anon_browser.contents, 'ppa_statistics'))
43 Statistics
44- 3 registered PPAs
45- 2 active PPAs
46- 4 published sources
47- 4 published binaries
48-
49+ Registered PPAs:
50+ 3
51+ Active PPAs:
52+ 2
53+ Published sources:
54+ 4
55+ Published binaries:
56+ 4
57
58 Up to 5 latest source publications are also presented in the 'Latest
59 sources' section.
60@@ -919,15 +922,15 @@
61 ... find_tag_by_id(anon_browser.contents, 'ppa_most_active'))
62 Most active
63 PPAs with the highest number of uploads in the last 7 days.
64- Celso Providelo 4 uploads
65- Mark Shuttleworth 2 uploads
66- Ubuntu Team 2 uploads
67- No Privileges Person 1 uploads
68+ PPA for Celso Providelo 4 uploads
69+ PPA for Mark Shuttleworth 2 uploads
70+ PPA for Ubuntu team 2 uploads
71+ PPA for No Privileges Person 1 uploads
72
73 The user can also in any PPA title listed in that section to visit the
74 PPA itself.
75
76- >>> anon_browser.getLink('Celso Providelo').click()
77+ >>> anon_browser.getLink('PPA for Celso Providelo').click()
78 >>> print anon_browser.title
79 PPA for Celso Providelo
80
81
82=== modified file 'lib/lp/soyuz/templates/distribution-portlet-ppa-architectures.pt'
83--- lib/lp/soyuz/templates/distribution-portlet-ppa-architectures.pt 2009-07-17 17:59:07 +0000
84+++ lib/lp/soyuz/templates/distribution-portlet-ppa-architectures.pt 2009-09-02 05:37:54 +0000
85@@ -7,19 +7,21 @@
86 tal:condition="serieses">
87
88 <h2>PPA supported series</h2>
89- <div class="portletBody portletContent">
90- <ul style="padding: 0 0 0 2em;" class="distroseries">
91+ <div>
92+ <ul>
93 <tal:per_series repeat="series serieses">
94- <li tal:condition="series/active">
95+ <li class="sprite distribution"
96+ tal:condition="series/active">
97 <a tal:attributes="href series/fmt:url">
98 <tal:version replace="series/version" />
99 "<tal:codename replace="series/displayname" />"
100 </a>
101 - <tal:status replace="series/status/name/fmt:lower" />
102
103- <ul class="architecture" tal:define="archs series/virtualized_architectures"
104+ <ul tal:define="archs series/virtualized_architectures"
105 tal:condition="archs">
106- <li tal:repeat="arch archs">
107+ <li class="sprite arquitecture"
108+ tal:repeat="arch archs">
109 <a tal:attributes="href arch/fmt:url">
110 <tal:title replace="arch/architecturetag" />
111 <tal:official condition="arch/official">
112
113=== modified file 'lib/lp/soyuz/templates/distribution-ppa-list.pt'
114--- lib/lp/soyuz/templates/distribution-ppa-list.pt 2009-08-14 18:51:49 +0000
115+++ lib/lp/soyuz/templates/distribution-ppa-list.pt 2009-09-02 05:37:54 +0000
116@@ -16,8 +16,7 @@
117
118 <div id="ppa_search" class="top-portlet">
119
120- <h1 tal:content="CONTEXTS/fmt:pagetitle">Ubuntu Linux Personal
121- Package Archives</h1>
122+ <h2>Personal Package Archives</h2>
123
124 <p>Personal Package Archives (PPA) allow you to upload
125 Ubuntu source packages to be built and published as an
126@@ -30,7 +29,7 @@
127 tal:condition="registered_ppas">
128 <p>Search user-contributed software packages published in any
129 <tal:distribution replace="context/title"
130- >Ubuntu</tal:distribution>PPA.</p>
131+ >Ubuntu</tal:distribution> PPA.</p>
132 <table>
133 <tbody>
134 <tr>
135@@ -60,38 +59,40 @@
136
137 <div id="ppa_statistics" class="portlet">
138 <h2>Statistics</h2>
139- <tal:has_ppas condition="registered_ppas">
140- <ul>
141- <li><tal:ppa_registered
142- replace="registered_ppas"
143- >10</tal:ppa_registered> registered PPAs</li>
144- <li><tal:ppa_active
145- replace="view/number_of_active_ppas"
146- >4</tal:ppa_active> active PPAs</li>
147- <li><tal:ppa_sources
148- replace="view/number_of_ppa_sources"
149- >20</tal:ppa_sources> published sources</li>
150- <li><tal:ppa_binaries
151- replace="view/number_of_ppa_binaries"
152- >20</tal:ppa_binaries> published binaries</li>
153- </ul>
154- </tal:has_ppas>
155- <tal:has_no_ppas condition="not: registered_ppas">
156- <p><tal:distribution replace="context/displayname" />
157- does not have any registered PPA.</p>
158- </tal:has_no_ppas>
159+ <div class="two-column-list" tal:condition="registered_ppas">
160+ <dl>
161+ <dt> Registered PPAs:</dt>
162+ <dd tal:content="registered_ppas">10</dd>
163+ </dl>
164+ <dl>
165+ <dt>Active PPAs:</dt>
166+ <dd tal:content="view/number_of_active_ppas">4</dd>
167+ </dl>
168+ <dl>
169+ <dt>Published sources:</dt>
170+ <dd tal:content="view/number_of_ppa_sources">20</dd>
171+ </dl>
172+ <dl>
173+ <dt>Published binaries:</dt>
174+ <dd tal:content="view/number_of_ppa_binaries">20</dd>
175+ </dl>
176+ </div>
177+ <p tal:condition="not: registered_ppas">
178+ <span tal:replace="context/displayname">Ubuntu Linux</span>
179+ does not have any registered PPA.
180+ </p>
181 </div> <!-- ppa_statistics -->
182
183 <div id="ppa_latest_uploads" class="portlet"
184 tal:condition="registered_ppas">
185 <h2>Latest uploads</h2>
186 <ul class="source package">
187- <li tal:repeat="pub view/latest_ppa_source_publications">
188+ <li class="sprite package-source"
189+ tal:repeat="pub view/latest_ppa_source_publications">
190 <tal:source_title replace="pub/displayname">
191 mozilla-firefox - 1.0 in warty
192 </tal:source_title> in
193- <a tal:attributes="href pub/archive/fmt:url"
194- tal:content="pub/archive/displayname"
195+ <a tal:replace="structure pub/archive/fmt:link"
196 >PPA for Celso Providelo </a>
197 <tal:datepublished replace="pub/age/fmt:approximateduration">
198 3 minutes</tal:datepublished> ago
199@@ -107,10 +108,8 @@
200 <table>
201 <tr tal:repeat="most_active view/most_active_ppas">
202 <td>
203- <a tal:attributes="href most_active/archive/fmt:url"
204- tal:content="most_active/archive/owner/fmt:displayname">
205- Celso Providelo
206- </a>
207+ <a tal:replace="structure most_active/archive/fmt:link"
208+ >PPA for Celso Providelo</a>
209 </td>
210 <td align="right">
211 <tal:sources replace="most_active/uploads" /> uploads