Skip to content

Commit 5382bbb

Browse files
committed
Adjust the resource tree view table rendering #1840
Signed-off-by: tdruez <tdruez@nexb.com>
1 parent 62a8f1e commit 5382bbb

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

scanpipe/templates/scanpipe/panels/codebase_tree_panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% for node in children %}
33
<li>
44
{% if node.is_dir %}
5-
<div class="tree-node is-flex is-align-items-center has-text-weight-semibold px-1" data-folder data-path="{{ node.path }}"{% if node.has_children %} data-target="{{ node.path|slugify }}" data-url="{% url 'codebase_resource_tree' slug=project.slug %}?path={{ node.path }}"{% endif %}>
5+
<div class="tree-node is-flex is-align-items-center px-1" data-folder data-path="{{ node.path }}"{% if node.has_children %} data-target="{{ node.path|slugify }}" data-url="{% url 'codebase_resource_tree' slug=project.slug %}?path={{ node.path }}"{% endif %}>
66
<span class="icon is-small chevron mr-1{% if not node.has_children %} is-invisible{% endif %} is-clickable is-flex is-align-items-center" data-chevron>
77
<i class="fas fa-chevron-right"></i>
88
</span>

scanpipe/templates/scanpipe/panels/resource_table_panel.html

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<div class="table-scroll-area">
2525
{% if resources %}
26-
<table class="table is-bordered is-striped is-narrow is-fullwidth">
26+
<table class="table is-bordered is-hoverable is-fullwidth">
2727
<thead class="is-sticky">
2828
<tr>
2929
<th>Name</th>
@@ -39,18 +39,22 @@
3939
data-path="{{ parent_path }}"
4040
hx-get="{% url 'codebase_resource_table' project.slug %}{% if parent_path %}?path={{ parent_path }}{% endif %}"
4141
hx-target="#right-pane"
42-
hx-push-url="{% url 'codebase_resource_tree' project.slug %}{% if parent_path %}?path={{ parent_path }}{% endif %}">
43-
<td class="is-align-items-center break-all" colspan="5" style="min-width: 100px;">
44-
<span class="icon is-small mr-2">
45-
<i class="fas fa-folder"></i>
46-
</span>
47-
<span class="has-text-weight-medium">..</span>
42+
hx-push-url="{% url 'codebase_resource_tree' project.slug %}{% if parent_path %}?path={{ parent_path }}{% endif %}"
43+
>
44+
<td colspan="5">
45+
<div class="is-flex is-align-items-center">
46+
<span class="icon is-small mr-2">
47+
<i class="fas fa-folder"></i>
48+
</span>
49+
<span class="has-text-weight-semibold">..</span>
50+
</div>
4851
</td>
4952
</tr>
5053
{% endif %}
5154
{% for resource in resources %}
5255
<tr>
53-
<td class="is-flex is-align-items-center break-all" style="min-width: 100px;">
56+
<td class="break-all" style="min-width: 100px;">
57+
<div class="is-flex is-align-items-center">
5458
<span class="icon is-small mr-2">
5559
{% if resource.is_dir %}
5660
<i class="fas fa-folder"></i>
@@ -66,6 +70,7 @@
6670
{% if resource.tag %}
6771
<span class="tag is-rounded ml-2">{{ resource.tag }}</span>
6872
{% endif %}
73+
</div>
6974
</td>
7075
<td>
7176
{{ resource.status }}

0 commit comments

Comments
 (0)