[Pypi-checkins] r811 - in trunk/pypi: . templates tools
richard
python-checkins at python.org
Sat Jul 24 17:45:33 CEST 2010
Author: richard
Date: Sat Jul 24 17:45:32 2010
New Revision: 811
Modified:
trunk/pypi/templates/display.pt
trunk/pypi/tools/demodata.py
trunk/pypi/webui.py
Log:
add link to downloads for loooong package description pages
Modified: trunk/pypi/templates/display.pt
==============================================================================
--- trunk/pypi/templates/display.pt (original)
+++ trunk/pypi/templates/display.pt Sat Jul 24 17:45:32 2010
@@ -21,6 +21,10 @@
<metal:fill fill-slot="body">
<p style="font-style: italic" tal:content="data/release/summary | nothing" />
+<p tal:condition="python:len(data['release']['description'])>500 and data['files']">
+ <a href="#downloads">Downloads ↓</a>
+</p>
+
<p tal:condition="not:data/usinglatest">
<strong>Latest Version: </strong><a tal:attributes="href data/latestversionurl" title="Latest Version URL">
<span tal:content="data/latestversion" />
@@ -32,8 +36,8 @@
<tal:element replace="structure data/release/description_html" />
-<table tal:define="files python:app.store.list_files(data['name'], data['version'])"
- tal:condition="files" class="list" style="margin-bottom: 10px;">
+<a name="downloads"> </a>
+<table tal:condition="data/files" class="list" style="margin-bottom: 10px;">
<tr>
<th>File</th>
<th>Type</th>
@@ -43,8 +47,7 @@
<th style="text-align: right;"># downloads</th>
</tr>
-<tr tal:repeat="file python:app.store.list_files(data['name'], data['version'])"
- tal:attributes="class repeat/file/parity">
+<tr tal:repeat="file data/files" tal:attributes="class repeat/file/parity">
<tal:block tal:define="
name file/filename;
url python:app.store.gen_file_url(file['python_version'], data['name'], file['filename']);
Modified: trunk/pypi/tools/demodata.py
==============================================================================
--- trunk/pypi/tools/demodata.py (original)
+++ trunk/pypi/tools/demodata.py Sat Jul 24 17:45:32 2010
@@ -31,7 +31,7 @@
'homepage':'http://spam.python.test/',
'license':'GPL',
'summary':'The spam package',
- 'description':'Does anybody want to provide real data here?',
+ 'description': 'spam '*500,
'classifiers':["Development Status :: 6 - Mature",
"Programming Language :: Python :: 2"],
'_pypi_hidden':False
Modified: trunk/pypi/webui.py
==============================================================================
--- trunk/pypi/webui.py (original)
+++ trunk/pypi/webui.py Sat Jul 24 17:45:32 2010
@@ -1362,6 +1362,8 @@
if os.path.exists(os.path.join(*path)):
docs = '/'.join(['http://packages.python.org', name] + sub)
+ files = self.store.list_files(name, version)
+
self.write_template('display.pt',
name=name, version=version, release=release,
description=release.get('summary') or name,
@@ -1372,6 +1374,7 @@
obsoletes=values('obsoletes'),
has_rated=has_rated,
latest_rating=latest_rating,
+ files=files,
docs=docs,
sum_ratings=total,
nr_ratings=len(ratings),
More information about the Pypi-checkins
mailing list