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 @@ -1229,6 +1229,11 @@ def dependency_count(self):
1229
1229
"""Return the number of dependencies related to this project."""
1230
1230
return self .discovereddependencies .count ()
1231
1231
1232
+ @cached_property
1233
+ def license_detections_count (self ):
1234
+ """Return the number of license detections in this project."""
1235
+ return self .discoveredlicenses .count ()
1236
+
1232
1237
@cached_property
1233
1238
def message_count (self ):
1234
1239
"""Return the number of messages related to this project."""
@@ -3477,7 +3482,7 @@ def as_spdx(self):
3477
3482
class DiscoveredLicenseQuerySet (ProjectRelatedQuerySet ):
3478
3483
def order_by_count_and_expression (self ):
3479
3484
"""Order by detection count and license expression (identifer) fields."""
3480
- return self .order_by ("detection_count" , "identifier" )
3485
+ return self .order_by ("- detection_count" , "identifier" )
3481
3486
3482
3487
3483
3488
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