File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
templates/scanpipe/includes Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -1189,6 +1189,11 @@ def dependency_count(self):
1189
1189
"""Return the number of dependencies related to this project."""
1190
1190
return self .discovereddependencies .count ()
1191
1191
1192
+ @cached_property
1193
+ def license_detections_count (self ):
1194
+ """Return the number of license detections in this project."""
1195
+ return self .discoveredlicenses .count ()
1196
+
1192
1197
@cached_property
1193
1198
def message_count (self ):
1194
1199
"""Return the number of messages related to this project."""
@@ -3427,7 +3432,7 @@ def as_spdx(self):
3427
3432
class DiscoveredLicenseQuerySet (ProjectRelatedQuerySet ):
3428
3433
def order_by_count_and_expression (self ):
3429
3434
"""Order by detection count and license expression (identifer) fields."""
3430
- return self .order_by ("detection_count" , "identifier" )
3435
+ return self .order_by ("- detection_count" , "identifier" )
3431
3436
3432
3437
3433
3438
class AbstractLicenseDetection (models .Model ):
Original file line number Diff line number Diff line change 40
40
</ p >
41
41
</ div >
42
42
</ div >
43
+ < div class ="level-item has-text-centered ">
44
+ < div >
45
+ < p class ="heading "> License Detections</ p >
46
+ < p class ="{{ title_class }} is-flex is-align-items-center is-justify-content-center ">
47
+ {% if project.license_detections_count %}
48
+ < a href ="{% url 'project_licenses' project.slug %} ">
49
+ {{ project.license_detections_count|intcomma }}
50
+ </ a >
51
+ {% else %}
52
+ < span > 0</ span >
53
+ {% endif %}
54
+ </ p >
55
+ </ div >
56
+ </ div >
43
57
< div class ="level-item has-text-centered ">
44
58
< div >
45
59
< p class ="heading "> Resources</ p >
You can’t perform that action at this time.
0 commit comments