summaryrefslogtreecommitdiff
path: root/templates/display.pt
blob: 46f48229dea84f6deed3a210e8d2acf6bee60959 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      metal:use-macro="standard_template/macros/page">

<metal:fill fill-slot="head">
 <meta tal:condition="data/release/keywords | nothing"
       name="keywords"
       tal:attributes="content data/release/keywords" />
 <meta tal:condition="data/release/summary | nothing"
       name="description"
       tal:attributes="content data/release/summary" />
 <link rel="meta" title="DOAP" type="application/rdf+xml"
       tal:attributes="href string:${app/url_path}?:action=doap&amp;name=${data/name}&amp;version=${data/version}" />
 <style type="text/css">
  table.form th {white-space: pre;}
 </style>
</metal:fill>

<metal:fill fill-slot="body">
<div id="download-button" tal:condition="data/files">
 <tal:element condition="python:len(data['files']) == 1">
  <a tal:define="file python:data['files'][0]"
     tal:attributes="href python:app.store.gen_file_url(
        file['python_version'], data['name'], file['filename'])"
     class="button green" style="float:right;">Download<br />
    <span style="font-size: 75%" tal:content="file/filename">download</span>
  </a>
 </tal:element>
 <a tal:condition="python:len(data['files']) > 1" class="button green"
    style="float:right;" href="#downloads">Downloads &darr;</a>
</div>

<p style="font-style: italic" tal:content="data/release/summary | nothing" />

<p tal:condition="data/docs | nothing">
   <a tal:attributes="href data/docs">Package Documentation</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" />
</a>
</p>


<p tal:replace="structure app/release_nav" />

<tal:element replace="structure data/release/description_html" />

<a name="downloads">&nbsp;</a>
<table tal:condition="data/files" class="list" style="margin-bottom: 10px;">
<tr>
  <th>File</th>
  <th>Type</th>
  <th>Py Version</th>
  <th>Uploaded on</th>
  <th style="text-align: right;">Size</th>
</tr>

<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']);
      comments   file/comment_text;
      pkg_type   python:app.dist_file_types_d[file['packagetype']];
      py_version file/python_version;
      uploaded   python:file['upload_time'] and file['upload_time'].strftime('%Y-%m-%d');
      size       python:app.pretty_size(file['size']);
      downloads  file/downloads;
      md5_url    string:${app/url_path}?:action=show_md5&amp;digest=${file/md5_digest};
      pgp_url    python:file['has_sig'] and app.store.gen_file_url(
                   file['python_version'], data['name'], file['filename'])+'.asc';
      ">
    <td>
    <span style="white-space: nowrap;">
      <a tal:attributes="href string:$url#md5=${file/md5_digest}"
         tal:content="name" />
      (<a tal:attributes="href md5_url" title="MD5 Digest">md5</a><tal:block tal:condition="pgp_url">,
       <a tal:attributes="href pgp_url" title="PGP Signature">pgp</a></tal:block>)
    </span>
    <tal:block tal:condition="comments">
      <br />
      <span tal:replace="comments" />
    </tal:block>
        </td>
  <td style="white-space: nowrap;">
    <span tal:replace="pkg_type" />
  </td>
  <td>
    <span tal:replace="py_version" tal:condition="python:py_version != 'source'" />
  </td>
  <td tal:content="uploaded" />
  <td tal:content="size" style="text-align: right;" />
</tal:block>
</tr>

<tr><td id="last" colspan="6"></td></tr>
  </table>

<ul class="nodot" tal:condition="data/download_counts | nothing">
  <li><strong>Downloads (All Versions):</strong></li>
  <li>
    <span tal:content="data/download_counts/day" /> downloads in the last day
  </li>
  <li>
    <span tal:content="data/download_counts/week" /> downloads in the last week
  </li>
  <!-- will be displayed when we have enough data -->
  <li style="display: none;">
    <span tal:content="data/download_counts/month" /> downloads in the last month
  </li>
</ul>

<ul class="nodot">
 <li tal:condition="data/release/author | nothing">
  <strong>Author:</strong>
  <span tal:content="data/release/author" />
 </li>

 <li tal:condition="data/release/maintainer | nothing">
  <strong>Maintainer:</strong>
  <span tal:content="data/release/maintainer" />
 </li>

 <li tal:condition="data/docs | nothing">
  <strong>Documentation:</strong>
  <a tal:attributes="href data/docs" tal:content="string:${data/name} package documentation" />
 </li>

<!-- The <th> elements below are a terrible terrible hack for setuptools -->
 <li tal:condition="data/release/home_page | nothing">
  <strong>Home Page:</strong>
  <!-- <th>Home Page -->
  <a tal:attributes="href data/release/home_page"
         tal:content="data/release/home_page" />
 </li>


 <li tal:condition="data/bugtrack_url | nothing">
  <strong>Bug Tracker:</strong>
  <a tal:attributes="href python:data['bugtrack_url']"
	  tal:content="structure
	  python:data['bugtrack_url'].replace('\n', ', ')"/>
 </li>

 <li tal:condition="data/release/download_url | nothing">
  <strong>Download URL:</strong>
  <!-- <th>Download URL -->
  <a tal:attributes="href data/release/download_url"
         tal:content="data/release/download_url" />
 </li>


 <li tal:condition="data/release/keywords | nothing">
  <strong>Keywords:</strong>
  <span tal:content="data/release/keywords" />
 </li>

 <li tal:condition="data/release/license | nothing">
  <strong>License:</strong>
  <tal:block define="hasnl python:'\n' in data['release']['license']">
  <pre tal:condition="hasnl" tal:content="data/release/license" />
  <span tal:condition="not:hasnl" tal:content="data/release/license" />
  </tal:block>
 </li>

 <li tal:condition="data/release/platform | nothing">
  <strong>Platform:</strong>
  <span tal:content="python:data['release']['platform'].replace('\n', ', ')" />
 </li>

<!-- TODO: add link to products in follow dependencies... -->
 <li tal:condition="data/requires | nothing">
  <strong>Requires</strong>
  <tal:element replace="python:', '.join(data['requires'])" />
 </li>
 <li tal:condition="data/provides | nothing">
  <strong>Provides</strong>
  <tal:element replace="python:', '.join(data['provides'])" />
 </li>
 <li tal:condition="data/obsoletes | nothing">
  <strong>Obsoletes</strong>
  <tal:element replace="python:', '.join(data['obsoletes'])" />
 </li>

 <li tal:condition="data/categories | nothing">
  <strong>Categories</strong>
  <ul class="nodot">
   <li tal:repeat="category data/categories">
    <a tal:attributes="href category/url"
       tal:content="structure category/pathstr"/>
   </li>
  </ul>
 </li>



 <li tal:condition="data/requires_dist | nothing">
   <strong>Requires Distributions</strong>
   <ul class="nodot">
     <li tal:repeat="require data/requires_dist">
       <a tal:condition="require/href" tal:attributes="href require/href"
           tal:content="require/name"/>
        <tal:block tal:condition="not:require/href"
                   tal:replace="require/name">
        </tal:block>
     </li>
   </ul>
 </li>

 <li tal:condition="data/provides_dist | nothing">
   <strong>Provides Distributions</strong>
   <ul class="nodot">
     <li tal:repeat="provide data/provides_dist">
       <a tal:condition="provide/href" tal:attributes="href provide/href"
           tal:content="provide/name"/>
       <tal:block tal:condition="not:provide/href"
                   tal:replace="provide/name">
        </tal:block>

     </li>
   </ul>
 </li>

 <li tal:condition="data/obsoletes_dist | nothing">
   <strong>Obsoletes Distributions</strong>
   <ul class="nodot">
     <li tal:repeat="obsolete data/obsoletes_dist">
       <a tal:condition="obsolete/href" tal:attributes="href obsolete/href"
           tal:content="obsolete/name"/>
        <tal:block tal:condition="not:obsolete/href"
                   tal:replace="obsolete/name">
        </tal:block>

     </li>
   </ul>
 </li>

 <li tal:condition="data/requires_external | nothing">
   <strong>Requires Externals</strong>
   <ul class="nodot">
     <li tal:repeat="require data/requires_external">
        <tal:block tal:replace="require">
        </tal:block>
     </li>
   </ul>
 </li>

 <li tal:condition="data/requires_python | nothing">
    <strong>Requires Python</strong>: <tal:block tal:replace="data/requires_python"></tal:block>
 </li>


 <li tal:condition="data/roles/Owner | nothing">
  <strong>Package Index Owner:</strong>
  <span tal:content="python:', '.join(data['roles']['Owner'])" />
 </li>

 <li tal:condition="data/roles/Maintainer | nothing">
  <strong>Package Index Maintainer:</strong>
  <span tal:content="python:', '.join(data['roles']['Maintainer'])" />
 </li>

 <li>
  <strong><a href="http://usefulinc.com/doap">DOAP</a> record:</strong>
  <a tal:content="string:${data/name}-${data/version}.xml"
  tal:attributes="href string:${app/url_path}?:action=doap&amp;name=${data/name}&amp;version=${data/version}" />
 </li>

</ul>

<table tal:condition="python:app.loggedin and (app.store.has_role('Admin') or
  app.store.has_role('Maintainer', data['name']) or app.store.has_role('Owner', data['name']))" class="history">
 <tr><th colspan="4" class="header">Journal</th></tr>
 <tr><th>Action</th><th>Date</th><th>User</th><th>Address</th></tr>
 <tr tal:repeat="
         entry python:app.store.get_journal(data['name'], data['version'])"
     tal:attributes="class repeat/entry/parity">
  <td nowrap="" tal:content="entry/action" />
  <td nowrap="" tal:content="python:str(entry['submitted_date'])[:-3]" />
  <td nowrap="" tal:content="entry/submitted_by" />
  <td nowrap="" tal:content="entry/submitted_from" />
 </tr>
</table>

</metal:fill>
</html>