[% META title = 'Admin » Dashboard View' -%]
<!-- BEGIN [% template.name %] -->
[% addcss = [ 'dashboard.css' ] %]
[% # INCLUDE dumper.tt dump = data %]
[% # INCLUDE dumper.tt dump = data.incomplete_section_tests %]
<script src="/js/highcharts.js"></script>
<h3 class="header">Request status:</h3>
<!-- Buttons -->
<ul class="nav nav-pills">
<!-- Comment button with number of latest comments count -->
<li class="indent">
<a href="[% app_url %]/worklist/request_status?status_query=urgent">
<i class="fa fa-taxi"></i> Urgent
<span class="label label-important">[% data.urgent || 0 %]</span>
</a>
</li>
<li>
<a href="[% app_url %]/worklist/request_status?status_query=unscreened">
<i class="fa fa-th-list"></i> Unscreened
<span class="label label-success">[% data.unscreened || 0 %]</span>
</a>
</li>
<li>
<a href="[% app_url %]/worklist/request_status?status_query=unreported">
<i class="fa fa-plug"></i>
Unreported >[% c.cfg('settings').unreported_duration %]d
<span class="label label-warning">[% data.unreported || 0 %]</span>
</a>
</li>
<li>
<a href="[% app_url %]/worklist/request_status?status_query=tests_completed">
<i class="fa fa-plug"></i> Tests complete
<span class="label label-warning">[% data.tests_completed || 0 %]</span>
</a>
</li>
<li>
<a href="[% app_url %]/worklist/request_status?status_query=unauthorised">
<i class="fa fa-tags"></i> Unauthorised
<span class="label label-info">[% data.unauthorised || 0 %]</span>
</a>
</li>
<li>
<a href="[% app_url %]/worklist/request_status?status_query=incomplete">
<i class="fa fa-fax"></i> Incomplete
<span class="label label-default">[% data.incomplete || 0 %]</span>
</a>
</li>
</ul>
<h3 class="header">Incomplete lab-tests:</h3>
<!-- highcharts secton -->
<div>
[% FOREACH section IN data.incomplete_section_tests;
div_id = section.key.replace(' ','-').lower; # INCLUDE dumper.tt dump = div_id;
div_width = section.value.size * 10; # approx width, between min & max
total = 0;
FOREACH test IN section.value;
total = total + test.value;
END;
%]
<div id="[% div_id %]" style="min-width: 30%; max-width: 90%; height: 300px;
width: [% div_width %]%; margin-left: 30px">
</div>
<script type="text/javascript">
$(function () {
$('#[% div_id %]').highcharts({
chart: {
type: 'column'
},
title: {
style: {
fontSize: '14px',
},
text: '[% section.key %] [[% total %]]',
align: 'left',
},
xAxis: {
type: 'category',
labels: {
rotation: -45,
style: {
fontSize: '11px',
fontFamily: 'Verdana, sans-serif'
}
}
},
yAxis: {
min: 0,
title: {
text: 'No. of tests'
}
},
legend: {
enabled: false
},
tooltip: {
pointFormat: 'n = <b>{point.y}</b>'
},
series: [{
name: '[% div_id %]',
data: [
[% FOREACH test IN section.value %]
[ '[% test.key %]', [% test.value %] ],
[% END %]
],
dataLabels: {
enabled: false,
}
}]
});
});
</script>
[% END %]
</div>
<!-- END [% template.name %] -->