Skip to content

Commit ebbb3a9

Browse files
committed
Add more links in the UI to the Resource tree view #1682
Signed-off-by: tdruez <[email protected]>
1 parent a54ae68 commit ebbb3a9

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

scanpipe/templates/scanpipe/includes/project_summary_level.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@
6969
<a href="{{ project_resources_url }}">
7070
{{ project.resource_count|intcomma }}
7171
</a>
72+
{% if project.resource_count > 1 %}
73+
<a href="{% url 'codebase_resource_tree' project.slug %}" class="ml-2">
74+
<span class="icon">
75+
<i class="fa-solid fa-folder-tree is-size-6"></i>
76+
</span>
77+
</a>
78+
{% endif %}
7279
{% if project.resource_compliance_alert_count %}
7380
<a href="{% url 'project_resources' project.slug %}?compliance_alert=error" class="has-text-danger is-size-5 ml-2">
7481
{{ project.resource_compliance_alert_count|intcomma }}

scanpipe/templates/scanpipe/project_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</div>
5151

5252
{% if object_list %}
53-
{% include 'scanpipe/includes/project_list_table.html' with projects=object_list %}
53+
{% include 'scanpipe/tables/project_list_table.html' with projects=object_list %}
5454
{% else %}
5555
<article class="box has-text-centered border-dashed">
5656
{% if filter.is_active %}

scanpipe/templates/scanpipe/resource_list.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
</div>
1818

1919
<div id="resource-list" class="container is-fluid mb-3">
20+
<a href="{% url 'codebase_resource_tree' project.slug %}" class="is-pulled-right">
21+
<span class="icon">
22+
<i class="fa-solid fa-folder-tree"></i>
23+
</span>
24+
<span>View the resource tree</span>
25+
</a>
2026
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
2127
{% include 'scanpipe/includes/list_view_thead.html' %}
2228
<tbody>

scanpipe/templates/scanpipe/resource_tree.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "scanpipe/base.html" %}
22
{% load static humanize %}
3-
{% block title %}ScanCode.io: {{ project.name }} - Resources (tree view){% endblock %}
3+
{% block title %}ScanCode.io: {{ project.name }} - Resources tree{% endblock %}
44

55
{% block extrahead %}
66
<style>
@@ -85,7 +85,7 @@
8585
{% include 'scanpipe/includes/navbar_header.html' %}
8686
<section class="mx-5">
8787
<div class="is-flex is-justify-content-space-between">
88-
{% include 'scanpipe/includes/breadcrumb.html' with linked_project=True current="Resources (tree view)" %}
88+
{% include 'scanpipe/includes/breadcrumb.html' with linked_project=True current="Resources tree" %}
8989
</div>
9090
</section>
9191
</div>

scanpipe/templates/scanpipe/includes/project_list_table.html renamed to scanpipe/templates/scanpipe/tables/project_list_table.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@
5353
<a href="{% url 'project_resources' project.slug %}">
5454
{{ project.codebaseresources_count|intcomma }}
5555
</a>
56+
{% if project.codebaseresources_count > 1 %}
57+
<a href="{% url 'codebase_resource_tree' project.slug %}">
58+
<span class="icon">
59+
<i class="fa-solid fa-folder-tree fa-sm"></i>
60+
</span>
61+
</a>
62+
{% endif %}
5663
{% else %}
5764
<span>0</span>
5865
{% endif %}

0 commit comments

Comments
 (0)