Add simple row status breakdown when viewing batch

This commit is contained in:
Lance Edgar 2018-09-20 15:58:45 -05:00
parent 3b0292029d
commit 0b9fe2dfe7
2 changed files with 55 additions and 0 deletions

View file

@ -40,6 +40,18 @@
display: inline;
}
.batch-helper {
border: 1px solid black;
float: right;
margin-top: 1em;
padding: 1em;
width: 20em;
}
.batch-helper-content {
margin-top: 1em;
}
</style>
</%def>
@ -79,6 +91,28 @@
${self.context_menu_items()}
</ul>
% if status_breakdown is not Undefined:
<div class="batch-helper">
<h3>Row Status Breakdown</h3>
<div class="batch-helper-content">
% if status_breakdown:
<div class="grid full">
<table>
% for i, (status, count) in enumerate(status_breakdown):
<tr class="${'even' if i % 2 == 0 else 'odd'}">
<td>${status}</td>
<td>${count}</td>
</tr>
% endfor
</table>
</div>
% else:
<p>Nothing to report yet.</p>
% endif
</div>
</div>
% endif
<div class="form-wrapper">
${form.render(form_id='batch-form', buttons=capture(buttons))|n}
</div><!-- form-wrapper -->