1+ {% if resources %}
2+ < table class ="table is-bordered is-hoverable is-fullwidth ">
3+ < thead class ="is-sticky ">
4+ < tr >
5+ < th > 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_table' project.slug %}{% if parent_path %}?path={{ parent_path }}{% endif %} "
18+ hx-target ="#right-pane "
19+ hx-push-url ="{% url 'project_resource_tree' project.slug %}{% if parent_path %}?path={{ parent_path }}{% endif %} ">
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 %}?path={{ resource.path }} "
45+ data-path ="{{ resource.path }} "
46+ hx-get ="{% url 'project_resource_tree_table' project.slug %}?path={{ resource.path }} "
47+ hx-target ="#right-pane "
48+ hx-push-url ="{% url 'project_resource_tree' project.slug %}?path={{ 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-content "
56+ hx-push-url ="{% url 'project_resource_tree' project.slug %}?path={{ 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_table' project.slug %}?path={{ path }}&page={{ page_obj.previous_page_number }} "
88+ hx-target ="#right-pane "
89+ hx-push-url ="{% url 'project_resource_tree' project.slug %}?path={{ 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_table' project.slug %}?path={{ path }}&page={{ page_obj.next_page_number }} "
97+ hx-target ="#right-pane "
98+ hx-push-url ="{% url 'project_resource_tree' project.slug %}?path={{ 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.
121+ {% endif %}
122+ </ p >
123+ </ div >
124+ {% endif %}
0 commit comments