diff --git a/src/scancode/format.py b/src/scancode/format.py
index 0c3a42ff37c..c5d0fba8d1d 100644
--- a/src/scancode/format.py
+++ b/src/scancode/format.py
@@ -132,6 +132,8 @@ def as_html(detected_data):
template = get_html_template('html')
converted = OrderedDict()
+ converted_infos = OrderedDict()
+ converted_packages = OrderedDict()
licenses = {}
# Create a dict keyed by location
@@ -158,11 +160,22 @@ def as_html(detected_data):
if entry['key'] not in licenses:
licenses[entry['key']] = entry
-
if results:
converted[location] = sorted(results, key=itemgetter('start'))
+ if 'infos' in scan_result:
+ converted_infos[location] = scan_result['infos']
+
+ if 'packages' in scan_result:
+ converted_packages[location] = scan_result['packages']
+
licenses = OrderedDict(sorted(licenses.items()))
- return template.render(results=converted, licenses=licenses)
+ results = {
+ "license_copyright": converted,
+ "infos": converted_infos,
+ "packages": converted_packages
+ }
+
+ return template.render(results=results, licenses=licenses)
diff --git a/src/scancode/templates/html/template.html b/src/scancode/templates/html/template.html
index 9f89f162cd8..e49e33a3c37 100644
--- a/src/scancode/templates/html/template.html
+++ b/src/scancode/templates/html/template.html
@@ -64,6 +64,7 @@
+ {% if results.license_copyright %}
@@ -75,7 +76,7 @@
- {% for location, data in results.items() %}
+ {% for location, data in results.license_copyright.items() %}
{% for row in data %}
{{ location }} |
@@ -92,6 +93,87 @@
{% endfor %}
+ {% endif %}
+
+ {% if results.infos %}
+
+ File Information
+
+
+ location |
+ type |
+ name |
+ extension |
+ date |
+ size |
+ sha1 |
+ md5 |
+ files_count |
+ mime_type |
+ file_type |
+ programming_language |
+ is_binary |
+ is_text |
+ is_archive |
+ is_media |
+ is_source |
+ is_script |
+
+
+
+ {% for location, data in results.infos.items() %}
+ {% for row in data %}
+
+ {{ location }} |
+ {{ row.type }} |
+ {{ row.name }} |
+ {{ row.extension }} |
+ {{ row.date }} |
+ {{ row.size }} |
+ {{ row.sha1 }} |
+ {{ row.md5 }} |
+ {{ row.file_count }} |
+ {{ row.mime_type }} |
+ {{ row.file_type }} |
+ {{ row.programming_language }} |
+ {{ row.is_binary }} |
+ {{ row.is_text }} |
+ {{ row.is_archive }} |
+ {{ row.is_media }} |
+ {{ row.is_source }} |
+ {{ row.is_script }} |
+
+ {% endfor %}
+ {% endfor %}
+
+
+ {% endif %}
+
+ {% if results.packages %}
+
+ Package Information
+
+
+ location |
+ type |
+ packaging |
+ primary_language |
+
+
+
+ {% for location, data in results.packages.items() %}
+ {% for row in data %}
+
+ {{ location }} |
+ {{ row.type }} |
+ {{ row.packaging }} |
+ {{ row.primary_language }} |
+
+ {% endfor %}
+ {% endfor %}
+
+
+ {% endif %}
{% if licenses %}