Skip to content

Commit

Permalink
Add links to resources view from relations list #858
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Druez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Aug 14, 2023
1 parent dd7769f commit b5e22ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,17 @@
{% load humanize %}

{% block paginator_count %}
{{ paginator.count|intcomma }} to/ resources ({{ relation_count|intcomma }} relations)
{{ paginator.count|intcomma }} relations
<a href="{% url 'project_resources' project.slug %}?tag=to&relation_map_type=none&status=_EMPTY_" target="_blank" class="button is-small is-info is-outlined">
<span>Un-mapped <strong>to/</strong> resources</span>
<span class="icon">
<i class="fa-solid fa-external-link-alt"></i>
</span>
</a>
<a href="{% url 'project_resources' project.slug %}?tag=from&relation_map_type=none&status=_EMPTY_" target="_blank" class="button is-small is-info is-outlined">
<span>Un-mapped <strong>from/</strong> resources</span>
<span class="icon">
<i class="fa-solid fa-external-link-alt"></i>
</span>
</a>
{% endblock %}
1 change: 1 addition & 0 deletions scanpipe/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,7 @@ def get_queryset(self):
.get_queryset()
.files()
.to_codebase()
.has_relation()
.prefetch_related("related_from__from_resource__project")
)

Expand Down

0 comments on commit b5e22ff

Please # to comment.