Skip to content

Commit eeb119f

Browse files
authored
feat(admin): create more links for malware reports (pypi#16125)
To make navigating between the reports and the project simpler Signed-off-by: Mike Fiedler <[email protected]>
1 parent 81d0ca1 commit eeb119f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

warehouse/admin/templates/admin/malware_reports/detail.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
<div class="card">
3232
<div class="card-header">
3333
<h3 class="card-title">
34-
Project: <code>{{ report.related.name }}</code>
34+
Project:
35+
<a href="{{ request.route_path('admin.project.detail', project_name=report.related.name) }}">
36+
<code>{{ report.related.name }}</code>
37+
</a>
3538
</h3>
3639
</div>
3740
<div class="card-body">

warehouse/admin/templates/admin/malware_reports/project_list.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414

1515
{% extends "admin/base.html" %}
1616

17-
{% block title %}Malware Reports for {{ project.name }}{% endblock %}
17+
{% block title %}
18+
Malware Reports for
19+
<a href="{{ request.route_path('admin.project.detail', project_name=project.name) }}">{{ project.name }}</a>
20+
{% endblock %}
1821

1922
{% block breadcrumb %}
2023
<li class="breadcrumb-item">

warehouse/admin/templates/admin/projects/detail.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ <h3 class="card-title">Project Observations</h3>
270270
<table class="table table-hover table-striped">
271271
<thead>
272272
<tr>
273+
<th></th>
273274
<th>Created</th>
274275
<th>Kind</th>
275276
<th>Reporter</th>
@@ -279,6 +280,11 @@ <h3 class="card-title">Project Observations</h3>
279280
<tbody>
280281
{% for observation in observations %}
281282
<tr>
283+
<td>
284+
<a href="{{ request.route_path('admin.malware_reports.detail', observation_id=observation.id) }}">
285+
<i class="fa-regular fa-eye"></i>
286+
</a>
287+
</td>
282288
<td>{{ observation.created }}</td>
283289
{# TODO: There's no exact relationship back to the ObservationKind to get the human-string. Not exactly sure how to get that yet. #}
284290
<td>{{ observation.kind }}</td>

0 commit comments

Comments
 (0)