|
1 | 1 | {% load humanize %} |
2 | 2 |
|
3 | 3 | {% if resources %} |
4 | | - <table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth"> |
| 4 | + <table class="table is-bordered is-striped is-narrow is-fullwidth"> |
5 | 5 | <thead class="is-sticky"> |
6 | 6 | <tr> |
7 | | - <th>Path</th> |
8 | | - <th>Status</th> |
9 | | - <th>Type</th> |
10 | | - <th>Size</th> |
11 | 7 | <th>Name</th> |
12 | | - <th>Extension</th> |
| 8 | + <th>Status</th> |
13 | 9 | <th>Language</th> |
14 | | - <th>MIME Type</th> |
15 | | - <th>Tag</th> |
16 | 10 | <th>License</th> |
17 | 11 | <th>Alert</th> |
18 | | - <th>Packages</th> |
19 | 12 | </tr> |
20 | 13 | </thead> |
21 | 14 | <tbody> |
22 | 15 | {% for resource in resources %} |
23 | 16 | <tr> |
24 | | - <td class="break-all" style="min-width: 200px;"> |
25 | | - {% if resource.is_dir %} |
26 | | - <a href="#" class="expand-in-tree" data-path="{{ resource.path }}" hx-get="{% url 'codebase_resource_table' project.slug %}?path={{ resource.path }}" hx-target="#right-pane">{{ resource.path }}</a> |
27 | | - {% else %} |
28 | | - <a href="{% url 'resource_detail' project.slug resource.path %}">{{ resource.path }}</a> |
29 | | - {% endif %} |
| 17 | + <td class="is-flex is-align-items-center break-all" style="min-width: 100px;"> |
| 18 | + <span class="icon is-small mr-2"> |
| 19 | + {% if resource.is_dir %} |
| 20 | + <i class="fas fa-folder"></i> |
| 21 | + {% else %} |
| 22 | + <i class="far fa-file"></i> |
| 23 | + {% endif %} |
| 24 | + </span> |
| 25 | + {% if resource.is_dir %} |
| 26 | + <a href="#" class="expand-in-tree" data-path="{{ resource.path }}" hx-get="{% url 'codebase_resource_table' project.slug %}?path={{ resource.path }}" hx-target="#right-pane">{{ resource.name }}</a> |
| 27 | + {% else %} |
| 28 | + <a href="{% url 'resource_detail' project.slug resource.path %}">{{ resource.name }}</a> |
| 29 | + {% endif %} |
| 30 | + {% if resource.tag %} |
| 31 | + <span class="tag is-rounded ml-2">{{ resource.tag }}</span> |
| 32 | + {% endif %} |
30 | 33 | </td> |
31 | 34 | <td> |
32 | 35 | {{ resource.status }} |
33 | 36 | </td> |
34 | | - <td> |
35 | | - {{ resource.type }} |
36 | | - </td> |
37 | | - <td> |
38 | | - {% if resource.is_file %} |
39 | | - {{ resource.size|filesizeformat|default_if_none:"" }} |
40 | | - {% endif %} |
41 | | - </td> |
42 | | - <td class="break-all" style="min-width: 100px;"> |
43 | | - {{ resource.name }} |
44 | | - </td> |
45 | | - <td> |
46 | | - {{ resource.extension }} |
47 | | - </td> |
48 | 37 | <td class="break-all"> |
49 | 38 | {{ resource.programming_language }} |
50 | 39 | </td> |
51 | | - <td class="break-all"> |
52 | | - {{ resource.mime_type }} |
53 | | - </td> |
54 | | - <td> |
55 | | - {{ resource.tag }} |
56 | | - </td> |
57 | 40 | <td> |
58 | 41 | {{ resource.detected_license_expression }} |
59 | 42 | </td> |
60 | 43 | <td> |
61 | 44 | {{ resource.compliance_alert }} |
62 | 45 | </td> |
63 | | - <td> |
64 | | - {% if resource.discovered_packages.all %} |
65 | | - {% for package in resource.discovered_packages.all|slice:":3" %} |
66 | | - <a href="{% url 'project_packages' project.slug %}?purl={{ package.package_url }}">{{ package }}</a>{% if not forloop.last %}, {% endif %} |
67 | | - {% endfor %} |
68 | | - {% if resource.discovered_packages.all|length > 3 %} |
69 | | - +{{ resource.discovered_packages.all|length|add:"-3" }} more |
70 | | - {% endif %} |
71 | | - {% endif %} |
72 | | - </td> |
73 | 46 | </tr> |
74 | 47 | {% endfor %} |
75 | 48 | </tbody> |
|
84 | 57 | <a class="pagination-next" hx-get="{% url 'codebase_resource_table' project.slug %}?path={{ path }}&page={{ page_obj.next_page_number }}" hx-target="#right-pane">Next page</a> |
85 | 58 | {% endif %} |
86 | 59 | <ul class="pagination-list"> |
87 | | - <li><span class="pagination-ellipsis">Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}</span></li> |
| 60 | + <li> |
| 61 | + <span class="pagination-ellipsis"> |
| 62 | + Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} |
| 63 | + </span> |
| 64 | + </li> |
88 | 65 | </ul> |
89 | 66 | </nav> |
90 | 67 | {% endif %} |
|
0 commit comments