Skip to content

Commit cbeee33

Browse files
authored
Link from release and package back to project page (#33)
1 parent e4d258f commit cbeee33

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

inspector/main.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,14 @@ def distributions(project_name, version):
6666
return render_template(
6767
"links.html",
6868
links=dist_urls,
69-
h2=f"{project_name}=={version}",
70-
h2_link=f"/project/{project_name}/{version}",
71-
h2_paren="View this release on PyPI",
72-
h2_paren_link=f"https://pypi.org/project/{project_name}/{version}",
69+
h2=f"{project_name}",
70+
h2_link=f"/project/{project_name}",
71+
h2_paren="View this project on PyPI",
72+
h2_paren_link=f"https://pypi.org/project/{project_name}",
73+
h3=f"{project_name}=={version}",
74+
h3_link=f"/project/{project_name}/{version}",
75+
h3_paren="View this release on PyPI",
76+
h3_paren_link=f"https://pypi.org/project/{project_name}/{version}",
7377
)
7478

7579

@@ -142,10 +146,12 @@ def distribution(project_name, version, first, second, rest, distname):
142146
return render_template(
143147
"links.html",
144148
links=file_urls,
145-
h2=f"{project_name}=={version}",
146-
h2_link=f"/project/{project_name}/{version}",
147-
h3=distname,
148-
h3_link=f"/project/{project_name}/{version}/packages/{first}/{second}/{rest}/{distname}/",
149+
h2=f"{project_name}",
150+
h2_link=f"/project/{project_name}",
151+
h3=f"{project_name}=={version}",
152+
h3_link=f"/project/{project_name}/{version}",
153+
h4=distname,
154+
h4_link=f"/project/{project_name}/{version}/packages/{first}/{second}/{rest}/{distname}/",
149155
)
150156
else:
151157
return "Distribution type not supported"

inspector/templates/base.html

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ <h3>
2222
{% else %}
2323
{{ h3 }}
2424
{% endif %}
25+
{% if h3_paren_link %}
26+
(<a href="{{ h3_paren_link }}">{{ h3_paren }}</a>)
27+
{% endif %}
2528
</h3>
2629
<h4>
2730
{% if h4_link %}

0 commit comments

Comments
 (0)