Skip to content

Commit f47bcca

Browse files
committed
added package info to html-app
1 parent 6a81f45 commit f47bcca

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

src/scancode/templates/html-app/template.html

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -157,29 +157,50 @@
157157
licenseData = [];
158158
if('licenses' in x) {
159159
licenseData = $.map(x.licenses, function(y){
160-
return [$.extend(y, {
161-
"path" : x.location,
162-
"what": "License",
163-
"start_line": y.start_line,
164-
"end_line": y.end_line,
165-
"info": y.short_name
166-
})];
160+
return [$.extend(y, {
161+
"path" : x.location,
162+
"what": "License",
163+
"start_line": y.start_line,
164+
"end_line": y.end_line,
165+
"info": y.short_name,
166+
"pkg_type": "",
167+
"pkg_packaging": "",
168+
"pkg_primary_language": ""
169+
})];
167170
})};
168171
// Add all copyright columns here
169172
copyrightData = [];
170173
if('copyrights' in x) {
171174
copyrightData = $.map(x.copyrights, function(y){
172-
return [$.extend(y, {
173-
"path" : x.location,
174-
"what": "Copyright",
175-
"start_line": y.start_line,
176-
"end_line": y.end_line,
177-
"info": y.statements.join("</br>")
178-
})];
175+
return [$.extend(y, {
176+
"path" : x.location,
177+
"what": "Copyright",
178+
"start_line": y.start_line,
179+
"end_line": y.end_line,
180+
"info": y.statements.join("</br>"),
181+
"pkg_type": "",
182+
"pkg_packaging": "",
183+
"pkg_primary_language": ""
184+
})];
179185
})};
180186

187+
// Add all package columns here
188+
packageData = [];
189+
if('packages' in x) {
190+
packageData = $.map(x.packages, function(y){
191+
return [$.extend(y, {
192+
"path" : x.location,
193+
"what": "Package",
194+
"start_line": "",
195+
"end_line": "",
196+
"info": "",
197+
"pkg_type": y.type,
198+
"pkg_packaging": y.packaging,
199+
"pkg_primary_language": y.primary_language
200+
})];
201+
})};
181202
// Return the concatenation of the two data sets
182-
return licenseData.concat(copyrightData);
203+
return licenseData.concat(copyrightData).concat(packageData);
183204
})
184205
};
185206

@@ -272,7 +293,10 @@
272293
{ "title": "Start Line", "data": "start_line", "width": "50px"},
273294
{ "title": "End Line", "data": "end_line", "width": "50px"},
274295
{ "orderable": false, "data": null, 'defaultContent': '', "width":"1px"},
275-
{ "title": "Info", "data": "info", "width": "30%"}
296+
{ "title": "Info", "data": "info", "width": "30%"},
297+
{ "title": "Package Type", "data": "pkg_type", "width": "60px"},
298+
{ "title": "Packaging", "data": "pkg_packaging", "width": "60px"},
299+
{ "title": "Primary Language", "data": "pkg_primary_language", "width": "60px"}
276300
],
277301
// This is called just before the row is rendered
278302
"rowCallback": function( row, data, index ) {

0 commit comments

Comments
 (0)