-
Notifications
You must be signed in to change notification settings - Fork 935
/
detail.html
437 lines (397 loc) · 20.7 KB
/
detail.html
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
{#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#}
{% extends "base.html" %}
{% macro url_icon(name, url) -%}
{% set parsed = url|urlparse %}
{% if name|lower == "download" %}
{% set icon = "fas fa-cloud-download-alt" %}
{% elif name|lower in ["home", "homepage", "home page"] %}
{% set icon = "fas fa-home" %}
{% elif name|lower in ["changelog", "change log", "changes", "release notes", "news", "what's new", "history"] %}
{% set icon = "fas fa-scroll" %}
{% elif name.lower().startswith(("docs", "documentation")) or parsed.netloc in ["readthedocs.io", "readthedocs.org", "rtfd.io", "rtfd.org"] or parsed.netloc.endswith((".readthedocs.io", ".readthedocs.org", ".rtfd.io", ".rtfd.org")) or parsed.netloc.startswith(("docs.", "documentation.")) %}
{% set icon = "fas fa-book" %}
{% elif name.lower().startswith(("bug", "issue", "tracker", "report")) %}
{% set icon = "fas fa-bug" %}
{% elif name.lower().startswith(("funding", "donate", "donation", "sponsor")) %}
{% set icon = "fas fa-donate" %}
{% elif parsed.netloc in ["github.com", "github.io"] or parsed.netloc.endswith((".github.com", ".github.io")) %}
{% set icon = "fab fa-github" %}
{% elif parsed.netloc == "gitlab.com" or parsed.netloc.endswith(".gitlab.com") %}
{% set icon = "fab fa-gitlab" %}
{% elif parsed.netloc == "gitter.im" or parsed.netloc.endswith(".gitter.im") %}
{% set icon = "fab fa-gitter" %}
{% elif parsed.netloc in ["discord.com", "discordapp.com", "discord.gg"] or parsed.netloc.endswith(("discord.com", "discordapp.com", "discord.gg")) %}
{% set icon = "fab fa-discord" %}
{% elif parsed.netloc == "google.com" or parsed.netloc.endswith(".google.com") %}
{% set icon = "fab fa-google" %}
{% elif parsed.netloc == "bitbucket.org" or parsed.netloc.endswith(".bitbucket.org") %}
{% set icon = "fab fa-bitbucket" %}
{% elif parsed.netloc == "reddit.com" or parsed.netloc.endswith(".reddit.com") %}
{% set icon = "fab fa-reddit-alien" %}
{% elif name.lower().startswith("slack") or parsed.netloc == "slack.com" or parsed.netloc.endswith(".slack.com") %}
{% set icon = "fab fa-slack" %}
{% elif parsed.netloc == "twitter.com" or parsed.netloc.endswith(".twitter.com") %}
{% set icon = "fab fa-twitter" %}
{% elif parsed.netloc in ["ci.appveyor.com", "circleci.com", "codecov.io", "coveralls.io", "shippable.com", "travis-ci.com", "travis-ci.org"] or parsed.netloc.endswith((".appveyor.com", ".circleci.com", ".codecov.io", ".coveralls.io", ".shippable.com", ".travis-ci.org", ".travis-ci.com")) %}
{% set icon = "fas fa-tasks" %}
{% elif parsed.netloc in ["cheeseshop.python.org", "pypi.io", "pypi.org", "pypi.python.org"] %}
{% set icon = "fas fa-cube" %}
{% elif parsed.netloc == "python.org" or parsed.netloc.endswith(".python.org") %}
{% set icon = "fab fa-python" %}
{% elif parsed.netloc in ["youtube.com", "youtu.be"] or parsed.netloc.endswith((".youtube.com", ".youtu.be")) %}
{% set icon = "fab fa-youtube" %}
{% elif name|lower == "mastodon" %}
{% set icon = "fab fa-mastodon" %}
{% else %}
{% set icon = "fas fa-external-link-square-alt" %}
{% endif %}
<i class="{{ icon }}" aria-hidden="true"></i>
{%- endmacro %}
{% macro project_snippet(release) -%}
<a class="package-snippet" href="{{ request.route_path('packaging.project', name=release.project.normalized_name) }}">
<h3 class="package-snippet__title">
<span class="package-snippet__name">{{ release.project.name }}</span>
<span class="package-snippet__version">{{ release.version }}</span>
</h3>
<p class="package-snippet__description">{{ release.summary }}</p>
</a>
{%- endmacro %}
{%- macro pip_command(release, request_route, test_environment) -%}
{%- if test_environment -%}
{% set index_url = " -i https://test.pypi.org/simple/" %}
{%- endif -%}
{%- if request_route == "packaging.release" -%}
{% set project_version = "==" + release.version %}
{%- endif -%}
{%- if release.version.epoch -%}
pip install{{ index_url }} '{{ release.project.name }}{{ project_version }}'
{%- else -%}
pip install{{ index_url }} {{ release.project.name }}{{ project_version }}
{%- endif -%}
{%- endmacro -%}
{%- macro file_table(files) -%}
{% for file in files %}
<div class="file">
<div class="file__graphic">
<i class="far fa-file" aria-hidden="true"></i>
</div>
<div class="card file__card">
<a href="{{ request.route_url('packaging.file', path=file.path) }}">
{{ file.filename }}
</a>
({{ file.size|filesizeformat() if file.size else 0|filesizeformat() }}
<a href="#copy-hash-modal-{{ file.id }}">{%- trans -%}view hashes{%- endtrans -%}</a>)
<p class="file__meta">
Uploaded {{ humanize(file.upload_time) }}
{% for tag in file.pretty_wheel_tags %}
<code>{{ tag }}</code>
{% endfor %}
</p>
</div>
</div>
{% endfor %}
{%- endmacro -%}
{% block title %}{{ release.project.name }}{% endblock %}
{% block description %}{{ release.summary }}{% endblock %}
{% block additional_rss -%}
<link rel="alternate" type="application/rss+xml" title="{% trans project_name=release.project.name %}RSS: latest releases for {{ project_name }}{% endtrans %}" href="{{ request.route_path('rss.project.releases', name=release.project.normalized_name) }}">
{%- endblock %}
{% block canonical_url %}{{ request.route_url('packaging.project', name=release.project.name) }}{% endblock %}
{% block extra_meta %}
{% if release.project.created|is_recent %}
<meta name="googlebot" content="noindex">
{% endif %}
{% endblock %}
{% block content %}
{% if release.github_repo_info_url and release.github_open_issue_info_url %}
<div class="hidden"
data-controller="github-repo-stats"
data-github-repo-stats-github-repo-info-outlet=".github-repo-info"
data-github-repo-stats-url-value="{{release.github_repo_info_url}}"
data-github-repo-stats-issue-url-value="{{release.github_open_issue_info_url}}">
</div>
{% endif %}
<div class="banner">
<div class="package-header">
<div class="package-header__left">
<h1 class="package-header__name">
{{ release.project.name }} {{ release.version }}
</h1>
{% if files %}
<div data-controller="clipboard">
<p class="package-header__pip-instructions">
<span id="pip-command" data-clipboard-target="source">{{ pip_command(release, request.matched_route.name, testPyPI) }}</span>
<button type="button" class="copy-tooltip copy-tooltip-s" data-action="clipboard#copy" data-clipboard-target="tooltip" data-clipboard-tooltip-value="{% trans %}Copy to clipboard{% endtrans %}">
<i class="fa fa-copy" aria-hidden="true"></i>
<span class="sr-only">{% trans %}Copy PIP instructions{% endtrans %}</span>
</button>
</p>
</div>
{% endif %}
</div>
<div class="package-header__right">
{% if release.yanked %}
<a class="status-badge status-badge--bad" href="{{ request.route_path('packaging.project', name=release.project.name) }}">
<span>
{% trans %}This release has been yanked{% endtrans %}<br>
</span>
</a>
{% else %}
{% if release.version|parse_version > latest_version.version|parse_version %}
<a class="status-badge status-badge--warn" href="{{ request.route_path('packaging.project', name=release.project.name) }}">
<span>{% trans version=latest_version.version %}Stable version available ({{ version }}){% endtrans %}</span>
</a>
{% elif release.version|parse_version != latest_version.version|parse_version %}
<a class="status-badge status-badge--bad" href="{{ request.route_path('packaging.project', name=release.project.name) }}">
<span>{% trans version=latest_version.version %}Newer version available ({{ version }}){% endtrans %}</span>
</a>
{% else %}
<a class="status-badge status-badge--good" href="{{ request.route_path('packaging.project', name=release.project.name) }}">
<span>{% trans %}Latest version{% endtrans %}</span>
</a>
{% endif %}
{% endif %}
<p class="package-header__date">
{% trans release_date=humanize(release.created) %}Released: {{ release_date }}{% endtrans %}
</p>
</div>
</div>
</div>
<div class="horizontal-section horizontal-section--grey horizontal-section--thin">
<div class="site-container">
{% csi request.route_path("includes.administer-project-include", project_name=project.normalized_name) %}
{% endcsi %}
<div class="split-layout split-layout--middle package-description">
{% if release.summary %}
<p class="package-description__summary">{{ release.summary }}</p>
{% else %}
<p class="package-description__summary">{% trans %}No project description provided{% endtrans %}</p>
{% endif %}
{% csi request.route_path("includes.edit-project-button", project_name=project.normalized_name) %}
{% endcsi %}
</div>
</div>
</div>
<div data-controller="project-tabs">
<div class="tabs-container">
<div class="vertical-tabs">
<div class="vertical-tabs__tabs">
<div class="sidebar-section">
<h3 class="sidebar-section__title">{% trans %}Navigation{% endtrans %}</h3>
<nav aria-label="{% trans project=release.project.name %}Navigation for {{ project }}{% endtrans %}">
<ul class="vertical-tabs__list" role="tablist">
<li role="tab">
<a id="description-tab" href="#description" data-project-tabs-target="tab" data-action="project-tabs#onTabClick" class="vertical-tabs__tab vertical-tabs__tab--with-icon vertical-tabs__tab--is-active" aria-selected="true" aria-label="{% trans %}Project description. Focus will be moved to the description.{% endtrans %}">
<i class="fa fa-align-left" aria-hidden="true"></i>
{% trans %}Project description{% endtrans %}
</a>
</li>
<li role="tab">
<a id="history-tab" href="#history" data-project-tabs-target="tab" data-action="project-tabs#onTabClick" class="vertical-tabs__tab vertical-tabs__tab--with-icon" aria-label="{% trans %}Release history. Focus will be moved to the history panel.{% endtrans %}">
<i class="fa fa-history" aria-hidden="true"></i>
{% trans %}Release history{% endtrans %}
</a>
</li>
{% if files %}
<li role="tab">
<a id="files-tab" href="#files" data-project-tabs-target="tab" data-action="project-tabs#onTabClick" class="vertical-tabs__tab vertical-tabs__tab--with-icon" aria-label="{% trans %}Download files. Focus will be moved to the project files.{% endtrans %}">
<i class="fa fa-download" aria-hidden="true"></i>
{% trans %}Download files{% endtrans %}
</a>
</li>
{% endif %}
</ul>
</nav>
</div>
{% include "warehouse:templates/includes/packaging/project-data.html" %}
{% set include_sponsor_logos = project.organization.orgtype != OrganizationType.Company %}
{% include "warehouse:templates/includes/sidebar-sponsor-logo.html" %}
{% csi request.route_url("includes.submit_malware_report", project_name=project.name) %}
{% endcsi %}
</div>
<div class="vertical-tabs__panel">
<!-- mobile menu -->
<nav aria-label="{% trans project=release.project.name %}Navigation for {{ project }}{% endtrans %}">
<ul class="vertical-tabs__list" role="tablist">
<li role="tab">
<a id="mobile-description-tab" href="#description" data-project-tabs-target="mobileTab" data-action="project-tabs#onTabClick" class="vertical-tabs__tab vertical-tabs__tab--with-icon vertical-tabs__tab--mobile vertical-tabs__tab--no-top-border vertical-tabs__tab--is-active" aria-selected="true" aria-label="{% trans %}Project description. Focus will be moved to the description.{% endtrans %}">
<i class="fa fa-align-left" aria-hidden="true"></i>
{% trans %}Project description{% endtrans %}
</a>
</li>
<li role="tab">
<a id="mobile-data-tab" href="#data" data-project-tabs-target="mobileTab" data-action="project-tabs#onTabClick" class="vertical-tabs__tab vertical-tabs__tab--with-icon vertical-tabs__tab--mobile" aria-label="{% trans %}Project details. Focus will be moved to the project details.{% endtrans %}">
<i class="fa fa-info-circle" aria-hidden="true"></i>
{% trans %}Project details{% endtrans %}
</a>
</li>
<li role="tab">
<a id="mobile-history-tab" href="#history" data-project-tabs-target="mobileTab" data-action="project-tabs#onTabClick" class="vertical-tabs__tab vertical-tabs__tab--with-icon vertical-tabs__tab--mobile" aria-label="{% trans %}Release history. Focus will be moved to the history panel.{% endtrans %}">
<i class="fa fa-history" aria-hidden="true"></i>
{% trans %}Release history{% endtrans %}
</a>
</li>
{% if files %}
<li role="tab">
<a id="mobile-files-tab" href="#files" data-project-tabs-target="mobileTab" data-action="project-tabs#onTabClick" class="vertical-tabs__tab vertical-tabs__tab--with-icon vertical-tabs__tab--mobile" aria-label="{% trans %}Download files. Focus will be moved to the project files.{% endtrans %}">
<i class="fa fa-download" aria-hidden="true"></i>
{% trans %}Download files{% endtrans %}
</a>
</li>
{% endif %}
</ul>
</nav>
{# Tab: Project description #}
<div id="description" data-project-tabs-target="content" class="vertical-tabs__content" role="tabpanel" aria-labelledby="description-tab mobile-description-tab" tabindex="-1">
{% if release.yanked and release.yanked_reason %}
<div class="callout-block callout-block--danger">
<p>{% trans %}Reason this release was yanked:{% endtrans %}</p>
<p>{{ release.yanked_reason }}</p>
</div>
{% endif %}
<h2 class="page-title">{% trans %}Project description{% endtrans %}</h2>
{% if description %}
<div class="project-description">
{{ description|camoify|safe }}
</div>
{% else %}
<div class="callout-block">
<p>{% trans %}The author of this package has not provided a project description{% endtrans %}</p>
</div>
{% endif %}
</div>
{# Tab: project details #}
<div id="data" data-project-tabs-target="content" class="vertical-tabs__content" role="tabpanel" aria-labelledby="mobile-data-tab" tabindex="-1">
<h2 class="page-title">{% trans %}Project details{% endtrans %}</h2>
{% include "warehouse:templates/includes/packaging/project-data.html" %}
<br>
</div>
{# Tab: Release history #}
<div id="history" data-project-tabs-target="content" class="vertical-tabs__content" role="tabpanel" aria-labelledby="history-tab mobile-history-tab" tabindex="-1">
<h2 class="page-title split-layout">
<span>{% trans %}Release history{% endtrans %}</span>
<span class="reset-text margin-top">
<a href="{{ request.route_path('help')}}#project-release-notifications">{% trans %}Release notifications{% endtrans %}</a> |
<a href="{{ request.route_path('rss.project.releases', name=release.project.normalized_name) }}">{% trans %}RSS feed{% endtrans %} <i class="fa fa-rss" aria-hidden="true"></i></a>
</span>
</h2>
<div class="release-timeline">
{% set blue_cube = request.static_url('warehouse:static/dist/images/blue-cube.svg') %}
{% set white_cube = request.static_url('warehouse:static/dist/images/white-cube.svg') %}
{% for hversion in all_versions %}
{% set is_current = (hversion.version == release.version) %}
<div class="release{{ ' release--latest' if loop.first else ' release--oldest' if loop.last }}{{ ' release--current' if is_current }}">
<div class="release__meta">
{% if is_current %}
<span class="badge">{% trans %}This version{% endtrans %}</span>
{% endif %}
</div>
<div class="release__graphic">
{% if loop.length > 1 %}
<div class="release__line"></div>
{% endif %}
{% if is_current %}
<img class="release__node" alt="" src="{{ blue_cube }}">
{% else %}
<img class="release__node" alt="" src="{{ white_cube }}">
{% endif %}
</div>
<a class="card release__card" href="{{ request.route_path('packaging.release', name=release.project.name, version=hversion.version) }}">
<p class="release__version">
{{ hversion.version }}
{% if hversion.is_prerelease %}
<span class="badge badge--warning">
{% trans %}pre-release{% endtrans %}
</span>
{% endif %}
{% if hversion.yanked %}
<span class="badge badge--danger">
{% trans %}yanked{% endtrans %}
</span>
{% endif %}
</p>
<p class="release__version-date">
{{ humanize(hversion.created) }}
</p>
{% if hversion.yanked and hversion.yanked_reason %}
<div class="callout-block callout-block--danger release__yanked-reason">
<p>{% trans %}Reason this release was yanked:{% endtrans %}</p>
<p>{{ hversion.yanked_reason }}</p>
</div>
{% endif %}
</a>
</div>
{% endfor %}
</div>
</div>
{% if files %}
{# Tab: Downloads #}
<div id="files" data-project-tabs-target="content" class="vertical-tabs__content" role="tabpanel" aria-labelledby="files-tab mobile-files-tab" tabindex="-1">
<h2 class="page-title">{% trans %}Download files{% endtrans %}</h2>
<p>{% trans href='https://packaging.python.org/tutorials/installing-packages/', title=gettext('External link') %}Download the file for your platform. If you're not sure which to choose, learn more about <a href="{{ href }}" title="{{ title }}" target="_blank" rel="noopener">installing packages</a>.{% endtrans %}</p>
<h3>
{% trans count=sdists|length %}
Source Distribution
{% pluralize %}
Source Distributions
{% endtrans %}
</h3>
{% if sdists %}
{{ file_table(sdists) }}
{% else %}
<div class="file">
<div class="file__graphic">
<i class="fas fa-exclamation-circle" aria-hidden="true"></i>
</div>
<div class="card">
{% trans %}No source distribution files available for this release.{% endtrans %}
{% trans href='https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives', title=gettext('External link') %}See tutorial on <a href="{{ href }}" title="{{ title }}" target="_blank" rel="noopener">generating distribution archives</a>.{% endtrans %}
</div>
</div>
{% endif %}
{% if bdists %}
<h3>
{% trans count=bdists|length %}
Built Distribution
{% pluralize %}
Built Distributions
{% endtrans %}
</h3>
{{ file_table(bdists) }}
{% endif %}
</div>
{% for file in files %}
{% include "warehouse:templates/includes/hash-modal.html" %}
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script>
MathJax = {
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']]
},
};
</script>
<script async
src="https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-svg.js"
integrity="sha256-1CldwzdEg2k1wTmf7s5RWVd7NMXI/7nxxjJM2C4DqII="
crossorigin="anonymous"
></script>
{% endblock %}