Merge lp:~salgado/launchpad/downloads-three-o into lp:launchpad

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: not available
Proposed branch: lp:~salgado/launchpad/downloads-three-o
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~salgado/launchpad/downloads-three-o
Reviewer Review Type Date Requested Status
Celso Providelo (community) code Approve
Paul Hummer (community) ui Approve
Review via email: mp+10801@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

= Summary =

Convert IProduct's +download page to 3.0, together with a bunch of small
improvements.

== Proposed fix ==

Convert the page and fix https://bugs.edge.launchpad.net/bugs/275677
https://bugs.edge.launchpad.net/bugs/419742
https://bugs.edge.launchpad.net/launchpad-registry/+bug/156919 and
https://bugs.edge.launchpad.net/launchpad-registry/+bug/390183

== Pre-implementation notes ==

== Implementation details ==

== Tests ==

== Demo and Q/A ==

https://staging.launchpad.net/bzr/+download
https://staging.launchpad.net/plone/+download

Note that the extra space before the comma in the <h2>s have been
removed already, but staging doesn't have that fix.

= 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/registry/templates/product-files.pt
  lib/lp/registry/browser/product.py

Revision history for this message
Paul Hummer (rockstar) wrote :

The ui for this is good. When the tests are updated, I'll do a code review as well.

review: Approve (ui)
Revision history for this message
Celso Providelo (cprov) :
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/browser/product.py'
2--- lib/lp/registry/browser/product.py 2009-08-24 20:28:33 +0000
3+++ lib/lp/registry/browser/product.py 2009-08-27 16:04:34 +0000
4@@ -703,6 +703,14 @@
5 def addFile(self, file):
6 self.files.append(file)
7
8+ @property
9+ def name_with_codename(self):
10+ milestone = self.release.milestone
11+ if milestone.code_name:
12+ return "%s (%s)" % (milestone.name, milestone.code_name)
13+ else:
14+ return milestone.name
15+
16 @cachedproperty
17 def total_downloads(self):
18 """Total downloads of files associated with this release."""
19@@ -800,12 +808,6 @@
20 "%d files have been deleted." %
21 del_count)
22
23- def seriesHasDownloadFiles(self, series):
24- """Determine whether a series has any download files."""
25- for release in series.releases:
26- if len(release.files) > 0:
27- return True
28-
29 @cachedproperty
30 def latest_release_with_download_files(self):
31 """Return the latest release with download files."""
32@@ -1022,7 +1024,7 @@
33 def has_download_files(self):
34 """Across series and releases do any download files exist?"""
35 for series in self.product.serieses:
36- if self.seriesHasDownloadFiles(series):
37+ if series.has_release_files:
38 return True
39 return False
40
41
42=== modified file 'lib/lp/registry/templates/product-files.pt'
43--- lib/lp/registry/templates/product-files.pt 2009-07-17 17:59:07 +0000
44+++ lib/lp/registry/templates/product-files.pt 2009-08-27 16:08:28 +0000
45@@ -3,20 +3,32 @@
46 xmlns:tal="http://xml.zope.org/namespaces/tal"
47 xmlns:metal="http://xml.zope.org/namespaces/metal"
48 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
49- xml:lang="en"
50- lang="en"
51- dir="ltr"
52- metal:use-macro="view/macro:page/onecolumn"
53+ metal:use-macro="view/macro:page/main_only"
54 i18n:domain="launchpad"
55 >
56
57+<h1 metal:fill-slot="heading">
58+ Download project files
59+</h1>
60+
61 <body>
62
63 <div metal:fill-slot="main"
64 tal:define="has_edit context/required:launchpad.Edit">
65- <h1>Download project files</h1>
66-
67- <p tal:condition="view/has_download_files">
68+
69+ <div tal:condition="not: view/has_download_files">
70+ <p>No download files exist for this project.</p>
71+ <p>You might want to check
72+ <a tal:attributes="href context/fmt:url:code">this project's Bazzar
73+ branches</a>
74+ <span tal:condition="context/homepageurl">or its
75+ <a tal:attributes="href context/homepageurl">home page</a>
76+ </span>.
77+ </p>
78+ </div>
79+
80+ <div tal:condition="view/has_download_files">
81+ <div>
82 After you've downloaded a file, you can verify its authenticity using
83 <tal:hasdownloadfiles condition="view/any_download_files_with_signatures">
84 either </tal:hasdownloadfiles>its MD5 sum
85@@ -24,35 +36,46 @@
86 or signature</tal:hasdownloadfiles>. (<a
87 href="/+help/verify-downloads.html" target="help">How do I verify a
88 download?</a>)
89- </p>
90-
91- <form id="project-downloads" method="POST"
92- tal:attributes="action request/URL">
93-
94- <p tal:condition="not: view/has_download_files">
95- No download files exist for this project.
96- </p>
97+ </div>
98+ <br />
99+
100+ <form id="project-downloads" method="POST"
101+ tal:attributes="action request/URL">
102
103 <div
104 tal:repeat="series view/sorted_series_list"
105 tal:attributes="id string:series_${series/name}">
106
107- <h2 tal:condition="python: has_edit or series.has_release_files">
108- &#8220;<tal:name replace="series/name">main</tal:name>&#8221; series
109- </h2>
110-
111 <tal:seriesfilesexist condition="series/has_release_files">
112- <div
113- tal:condition="series/summary"
114- tal:content="series/summary/fmt:shorten/80" />
115-
116 <tal:releases repeat="release series/releases">
117 <div tal:condition="release/files">
118- <h3 style="font-size: 1.2em">
119+ <h2 style="font-size: 1.2em">
120 <a tal:attributes="href release/fmt:url">
121- <span tal:replace="release/version" /> release
122- </a>
123- </h3>
124+ <span tal:replace="release/name_with_codename" /> release</a>,
125+ from the
126+ <a tal:attributes="href series/fmt:url"
127+ tal:content="series/name">name</a> series.
128+ </h2>
129+
130+ <div id="release_notes">
131+ <h3>Release notes:</h3>
132+ <tal:notes condition="release/release_notes"
133+ define="notes release/release_notes/fmt:shorten/800">
134+ <div tal:content="structure notes/fmt:text-to-html">
135+ Release notes
136+ </div>
137+ </tal:notes>
138+ <div tal:condition="not: release/release_notes">
139+ <em>This release does not have release notes.</em>
140+ </div>
141+ <div>
142+ <strong>Released:</strong>
143+ <span
144+ tal:attributes="title release/datereleased/fmt:datetime"
145+ tal:content="release/datereleased/fmt:approximatedate" />
146+ </div>
147+ </div>
148+
149 <table class="listing">
150 <thead>
151 <tr>
152@@ -100,12 +123,11 @@
153 </p>
154
155 </div>
156- <input tal:condition="python: has_edit and view.has_download_files"
157- type="submit"
158- name="delete_files"
159- value="Delete Files" />
160+ <input tal:condition="has_edit" type="submit" name="delete_files"
161+ value="Delete Files" />
162
163- </form>
164+ </form>
165+ </div>
166 </div>
167 </body>
168 </html>
169