list/importrun: render stats

This commit is contained in:
Thomas Gelf 2015-07-27 22:45:51 +02:00
parent 1b13d15070
commit f300bdca89
3 changed files with 62 additions and 1 deletions

View File

@ -48,10 +48,10 @@ class Director_ListController extends ActionController
{ {
$this->setImportTabs()->activate('importrun'); $this->setImportTabs()->activate('importrun');
$this->view->title = $this->translate('Import runs'); $this->view->title = $this->translate('Import runs');
$this->view->stats = $this->db()->fetchImportStatistics();
$this->view->table = $this->applyPaginationLimits( $this->view->table = $this->applyPaginationLimits(
$this->loadTable('importrun')->setConnection($this->db()) $this->loadTable('importrun')->setConnection($this->db())
); );
$this->render('table');
} }
public function syncruleAction() public function syncruleAction()

View File

@ -0,0 +1,38 @@
<div class="controls">
<?= $this->tabs ?>
<?php
$loc = localeconv();
$pt = $loc['thousands_sep'];
?><h1><?= $this->escape($this->title) ?></h1>
<table class="tinystats">
<thead>
<tr>
<th></th>
<th>Rows</th>
<th>Props</th>
</tr>
</thead>
<tbody>
<tr>
<th>Imported</th>
<td><?= number_format($this->stats['imported_rows'], 0, null, $pt) ?></td>
<td><?= number_format($this->stats['imported_properties'], 0, null, $pt) ?></td>
</tr>
<tr>
<th>Unique</th>
<td><?= number_format($this->stats['unique_rows'], 0, null, $pt) ?></td>
<td><?= number_format($this->stats['unique_properties'], 0, null, $pt) ?></td>
</tr>
</tbody>
</table>
<span data-base-target="_next">
<?= $this->addLink ?>
</span><br />
<?= $this->table->getPaginator() ?>
</div>
<div class="content" data-base-target="_next">
<?= $this->table->render() ?>
</div>

View File

@ -85,6 +85,29 @@ p.error {
} }
} }
table.tinystats {
font-size: 0.7em;
float: right;
width: 16em;
thead {
th {
width: 7em;
text-align: right;
}
th:first-child {
width: auto;
}
}
tbody {
th, td {
text-align: right;
}
}
}
/* Simple table, test */ /* Simple table, test */
table.simple { table.simple {