1- {% if resources %}
2- < table class ="table is-bordered is-hoverable is-fullwidth ">
3- < thead class ="is-sticky ">
4- < tr >
5- < th style ="min-width:200px; "> Name</ th >
6- < th > Status</ th >
7- < th > Language</ th >
8- < th > License</ th >
9- < th > Alert</ th >
10- </ tr >
11- </ thead >
12- < tbody >
13- {% if parent_path %}
14- < tr
15- class ="expand-in-tree is-clickable "
16- data-path ="{{ parent_path }} "
17- hx-get ="{% url 'project_resource_tree_right_pane' project.slug parent_path %} "
18- hx-target ="#right-pane "
19- hx-push-url ="{% url 'project_resource_tree' project.slug parent_path %} ">
20- < td colspan ="5 ">
21- < div class ="is-flex is-align-items-center ">
22- < span class ="icon is-small mr-2 ">
23- < i class ="fas fa-folder "> </ i >
24- </ span >
25- < span class ="has-text-weight-semibold "> ..</ span >
26- </ div >
27- </ td >
28- </ tr >
29- {% endif %}
30- {% for resource in resources %}
31- < tr >
32- < td class ="break-all " style ="min-width: 100px; ">
33- < div class ="is-flex is-align-items-center ">
34- < span class ="icon is-small mr-2 ">
35- {% if resource.is_dir %}
36- < i class ="fas fa-folder "> </ i >
37- {% else %}
38- < i class ="far fa-file "> </ i >
39- {% endif %}
40- </ span >
41- {% if resource.is_dir %}
42- < a
43- class ="expand-in-tree "
44- href ="{% url 'project_resource_tree' project.slug resource.path %} "
45- data-path ="{{ resource.path }} "
46- hx-get ="{% url 'project_resource_tree_right_pane' project.slug resource.path %} "
47- hx-target ="#right-pane "
48- hx-push-url ="{% url 'project_resource_tree' project.slug resource.path %} ">
49- {{ resource.name }}
50- </ a >
51- {% else %}
52- < a
53- href ="{% url 'resource_detail' project.slug resource.path %} "
54- hx-get ="{% url 'resource_detail' project.slug resource.path %} "
55- hx-target ="#right-pane "
56- hx-push-url ="{% url 'project_resource_tree' project.slug resource.path %} ">
57- {{ resource.name }}
58- </ a >
59- {% endif %}
60- {% if resource.tag %}
61- < span class ="tag is-rounded ml-2 "> {{ resource.tag }}</ span >
62- {% endif %}
63- </ div >
64- </ td >
65- < td >
66- {{ resource.status }}
67- </ td >
68- < td class ="break-all ">
69- {{ resource.programming_language }}
70- </ td >
71- < td >
72- {{ resource.detected_license_expression }}
73- </ td >
74- < td >
75- {{ resource.compliance_alert }}
76- </ td >
77- </ tr >
78- {% endfor %}
79- </ tbody >
80- </ table >
81-
82- {% if is_paginated %}
83- < nav class ="pagination is-centered mt-4 " role ="navigation ">
84- {% if page_obj.has_previous %}
85- < a
86- class ="pagination-previous "
87- hx-get ="{% url 'project_resource_tree_right_pane' project.slug path %}?page={{ page_obj.previous_page_number }} "
88- hx-target ="#right-pane "
89- hx-push-url ="{% url 'project_resource_tree' project.slug path %}?page={{ page_obj.previous_page_number }} ">
90- Previous
91- </ a >
92- {% endif %}
93- {% if page_obj.has_next %}
94- < a
95- class ="pagination-next "
96- hx-get ="{% url 'project_resource_tree_right_pane' project.slug path%}?page={{ page_obj.next_page_number }} "
1+ < table class ="table is-bordered is-hoverable is-fullwidth ">
2+ < thead class ="is-sticky ">
3+ < tr >
4+ < th style ="min-width:200px; "> Name</ th >
5+ < th > Status</ th >
6+ < th > Language</ th >
7+ < th > License</ th >
8+ < th > Alert</ th >
9+ </ tr >
10+ </ thead >
11+ < tbody >
12+ {% if parent_path %}
13+ < tr
14+ class ="expand-in-tree is-clickable "
15+ data-path ="{{ parent_path }} "
16+ hx-get ="{% url 'project_resource_tree_right_pane' project.slug parent_path %} "
9717 hx-target ="#right-pane "
98- hx-push-url ="{% url 'project_resource_tree' project.slug path %}?page={{ page_obj.next_page_number }} ">
99- Next page
100- </ a >
101- {% endif %}
102- < ul class ="pagination-list ">
103- < li >
104- < span class ="pagination-ellipsis ">
105- Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
106- </ span >
107- </ li >
108- </ ul >
109- </ nav >
110- {% endif %}
111- {% else %}
112- < div class ="has-text-centered p-6 ">
113- < div class ="icon is-large has-text-grey-light mb-3 ">
114- < i class ="fas fa-folder-open fa-3x "> </ i >
115- </ div >
116- < p class ="has-text-grey ">
117- {% if path %}
118- No resources found in this directory.
119- {% else %}
120- Select a file or folder from the tree to view its contents.
18+ hx-push-url ="{% url 'project_resource_tree' project.slug parent_path %} ">
19+ < td colspan ="5 ">
20+ < div class ="is-flex is-align-items-center ">
21+ < span class ="icon is-small mr-2 ">
22+ < i class ="fas fa-folder "> </ i >
23+ </ span >
24+ < span class ="has-text-weight-semibold "> ..</ span >
25+ </ div >
26+ </ td >
27+ </ tr >
12128 {% endif %}
122- </ p >
123- </ div >
29+ {% for resource in resources %}
30+ {% include 'scanpipe/tree/resource_table_resource_row.html' %}
31+ {% endfor %}
32+ </ tbody >
33+ </ table >
34+
35+ {% if is_paginated %}
36+ < nav class ="pagination is-centered mt-4 " role ="navigation ">
37+ {% if page_obj.has_previous %}
38+ < a
39+ class ="pagination-previous "
40+ hx-get ="{% url 'project_resource_tree_right_pane' project.slug path %}?page={{ page_obj.previous_page_number }} "
41+ hx-target ="#right-pane "
42+ hx-push-url ="{% url 'project_resource_tree' project.slug path %}?page={{ page_obj.previous_page_number }} ">
43+ Previous
44+ </ a >
45+ {% endif %}
46+ {% if page_obj.has_next %}
47+ < a
48+ class ="pagination-next "
49+ hx-get ="{% url 'project_resource_tree_right_pane' project.slug path%}?page={{ page_obj.next_page_number }} "
50+ hx-target ="#right-pane "
51+ hx-push-url ="{% url 'project_resource_tree' project.slug path %}?page={{ page_obj.next_page_number }} ">
52+ Next page
53+ </ a >
54+ {% endif %}
55+ < ul class ="pagination-list ">
56+ < li >
57+ < span class ="pagination-ellipsis ">
58+ Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
59+ </ span >
60+ </ li >
61+ </ ul >
62+ </ nav >
12463{% endif %}
0 commit comments