11{% load humanize %}
22
33< div id ="right-pane ">
4- {% if resources %}
54 < table class ="table is-bordered is-striped is-narrow is-hoverable is-fullwidth ">
65 < thead class ="is-sticky ">
76 < tr >
3130 </ tr >
3231 </ thead >
3332 < tbody >
34- {% for resource in resources %}
33+ {% if resources %}
34+ {% for resource in resources %}
35+ < tr >
36+ < td class ="break-all " style ="min-width: 200px; ">
37+ {% if resource.type == "directory" %}
38+ {{ resource.path }}
39+ {% else %}
40+ < a href ="{% url 'resource_detail' project.slug resource.path %} "> {{ resource.path }}</ a >
41+ {% endif %}
42+ </ td >
43+ < td >
44+ {{ resource.status }}
45+ </ td >
46+ < td >
47+ {{ resource.type }}
48+ </ td >
49+ < td >
50+ {% if resource.type != "directory" %}
51+ {{ resource.size|filesizeformat|default_if_none:"" }}
52+ {% endif %}
53+ </ td >
54+ < td class ="break-all " style ="min-width: 100px; ">
55+ {{ resource.name }}
56+ </ td >
57+ < td >
58+ {{ resource.extension }}
59+ </ td >
60+ < td class ="break-all ">
61+ {{ resource.programming_language }}
62+ </ td >
63+ < td class ="break-all ">
64+ {{ resource.mime_type }}
65+ </ td >
66+ < td >
67+ {{ resource.tag }}
68+ </ td >
69+ < td >
70+ {{ resource.detected_license_expression }}
71+ </ td >
72+ < td >
73+ {{ resource.compliance_alert }}
74+ </ td >
75+ < td >
76+ {% if resource.discovered_packages.all %}
77+ {% for package in resource.discovered_packages.all|slice:"0:3" %}
78+ < a href ="{% url 'project_packages' project.slug %}?purl={{ package.package_url }} "> {{ package }}</ a > {% if not forloop.last %}, {% endif %}
79+ {% endfor %}
80+ {% if resource.discovered_packages.all|length > 3 %}
81+ +{{ resource.discovered_packages.all|length|add:"-3" }} more
82+ {% endif %}
83+ {% endif %}
84+ </ td >
85+ </ tr >
86+ {% endfor %}
87+ {% else %}
3588 < tr >
36- < td class ="break-all " style ="min-width: 200px; ">
37- {% if resource.type == "directory" %}
38- {{ resource.path }}
39- {% else %}
40- < a href ="{% url 'resource_detail' project.slug resource.path %} "> {{ resource.path }}</ a >
41- {% endif %}
42- </ td >
43- < td >
44- {{ resource.status }}
45- </ td >
46- < td >
47- {{ resource.type }}
48- </ td >
49- < td >
50- {% if resource.type != "directory" %}
51- {{ resource.size|filesizeformat|default_if_none:"" }}
52- {% endif %}
53- </ td >
54- < td class ="break-all " style ="min-width: 100px; ">
55- {{ resource.name }}
56- </ td >
57- < td >
58- {{ resource.extension }}
59- </ td >
60- < td class ="break-all ">
61- {{ resource.programming_language }}
62- </ td >
63- < td class ="break-all ">
64- {{ resource.mime_type }}
65- </ td >
66- < td >
67- {{ resource.tag }}
68- </ td >
69- < td >
70- {{ resource.detected_license_expression }}
71- </ td >
72- < td >
73- {{ resource.compliance_alert }}
74- </ td >
75- < td >
76- {% if resource.discovered_packages.all %}
77- {% for package in resource.discovered_packages.all|slice:"0:3" %}
78- < a href ="{% url 'project_packages' project.slug %}?purl={{ package.package_url }} "> {{ package }}</ a > {% if not forloop.last %}, {% endif %}
79- {% endfor %}
80- {% if resource.discovered_packages.all|length > 3 %}
81- +{{ resource.discovered_packages.all|length|add:"-3" }} more
89+ < td colspan ="100% " style ="background: none; border: none; padding: 2rem 0; " class ="has-text-centered ">
90+ < div class ="icon is-large has-text-grey-light mb-3 ">
91+ < i class ="fas fa-folder-open fa-3x "> </ i >
92+ </ div >
93+ < p class ="has-text-grey ">
94+ {% if path %}
95+ No resources found in this directory.
96+ {% else %}
97+ Select a file or folder from the tree to view its contents.
8298 {% endif %}
83- {% endif %}
99+ </ p >
84100 </ td >
85101 </ tr >
86- {% endfor %}
102+ {% endif %}
87103 </ tbody >
88104 </ table >
89105
104120 </ ul >
105121 </ nav >
106122 {% endif %}
107- {% else %}
108- < div class ="has-text-centered p-6 ">
109- < div class ="icon is-large has-text-grey-light mb-3 ">
110- < i class ="fas fa-folder-open fa-3x "> </ i >
111- </ div >
112- < p class ="has-text-grey ">
113- {% if path %}
114- No resources found in this directory.
115- {% else %}
116- Select a file or folder from the tree to view its contents.
117- {% endif %}
118- </ p >
119- </ div >
120- {% endif %}
121123</ div >
0 commit comments