Skip to content

Commit e47ffda

Browse files
author
davydov
committed
fix reports js
1 parent 0feb661 commit e47ffda

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

js/ct-settings.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,23 @@ jQuery(document).ready(function(){
131131

132132
}
133133
}
134-
if (ct_connection_reports_negative>0 && ct_connection_reports_negative_report)
134+
if (ct_connection_reports_negative > 0 && ct_connection_reports_negative_report)
135135
{
136136
var html='<center><table id = "connection_reports_table" class="table table-bordered table-hover table-striped" cellspacing=0 cellpadding=3><thead><tr><th>'+ct_connection_reports_table_date+'</th><th>'+ct_connection_reports_table_pageurl+'</th><th>'+ct_connection_reports_table_libreport+'</th></tr></thead><tbody>';
137137
var negative_report = JSON.parse(ct_connection_reports_negative_report);
138-
negative_report.forEach(function(item,i,arr){
139-
html+='<tr>';
140-
html+='<td>'+negative_report[i].date+'</td>';
141-
html+='<td>'+negative_report[i].page_url+'</td>';
142-
html+='<td>'+negative_report[i].lib_report+'</td>';
143-
html+='</tr>';
144-
});
145-
html+='</tbody></table></center>';
146-
html+="<button id='send_connection_report' class='btn btn-success' type='button'>"+ct_connection_reports_send_report+"</button>";
147-
jQuery('#connection_reports').append(html);
138+
if (negative_report) {
139+
negative_report.forEach(function(item,i,arr){
140+
html+='<tr>';
141+
html+='<td>'+negative_report[i].date+'</td>';
142+
html+='<td>'+negative_report[i].page_url+'</td>';
143+
html+='<td>'+negative_report[i].lib_report+'</td>';
144+
html+='</tr>';
145+
});
146+
html+='</tbody></table></center>';
147+
html+="<button id='send_connection_report' class='btn btn-success' type='button'>"+ct_connection_reports_send_report+"</button>";
148+
jQuery('#connection_reports').append(html);
149+
}
150+
148151
}
149152
else
150153
jQuery("#connection_reports").append("<center><h2>"+ct_connection_reports_no_reports+"</h2></center>")

0 commit comments

Comments
 (0)