Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions lib/IgraalOSL/StatsTable/Resources/views/statsTable.html.twig
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
<table class="stats-table">
<thead>
<tr>
{% for key, name in headers %}
<th class="stats-table-{{ key }}">
{% if metaData[key].description is defined %}<abbr title="{{ metaData[key].description }}">{% endif %}
{{ name }}
{% if metaData[key].description is defined %}</abbr>{% endif %}
</th>
{% endfor %}
{% for key, name in headers %}
<th class="stats-table-{{ key }}">
{% if metaData[key].description is defined %}
<abbr title="{{ metaData[key].description }}">{{ name }}</abbr>
{% else %}
{{ name }}
{% endif %}
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for line in data %}
{% for line in data %}
<tr>
{% for key, value in line %}
<td class="stats-table-{{ key }}">{{ value }}</td>
{% endfor %}
{% for key, value in line %}
<td class="stats-table-{{ key }}">{{ value }}</td>
{% endfor %}
</tr>
{% endfor %}
{% endfor %}
</tbody>

<tfoot>
<tr>
{% for key, value in aggregations %}
<th class="stats-table-{{ key }}">{{ value }}</th>
{% endfor %}
{% for key, value in aggregations %}
<th class="stats-table-{{ key }}">{{ value }}</th>
{% endfor %}
</tr>
</tfoot>
</table>
22 changes: 11 additions & 11 deletions tests/Tests/Dumper/Fixtures/template/custom.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
<thead>
<tr><th colspan="{{ headers|length }}">{{ title }}</th></tr>
<tr>
{% for key, name in headers %}
<th class="stats-table-{{ key }}">{{ name }}</th>
{% endfor %}
{% for key, name in headers %}
<th class="stats-table-{{ key }}">{{ name }}</th>
{% endfor %}
</tr>
</thead>

<tbody>
{% for line in data %}
{% for line in data %}
<tr>
{% for key, value in line %}
<td class="stats-table-{{ key }}">{{ value }}</td>
{% endfor %}
{% for key, value in line %}
<td class="stats-table-{{ key }}">{{ value }}</td>
{% endfor %}
</tr>
{% endfor %}
{% endfor %}
</tbody>

<tfoot>
<tr>
{% for key, value in aggregations %}
<th class="stats-table-{{ key }}">{{ value }}</th>
{% endfor %}
{% for key, value in aggregations %}
<th class="stats-table-{{ key }}">{{ value }}</th>
{% endfor %}
</tr>
</tfoot>
</table>
54 changes: 27 additions & 27 deletions tests/Tests/Dumper/Fixtures/test-custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
<thead>
<tr><th colspan="5">My title test</th></tr>
<tr>
<th class="stats-table-date">Date</th>
<th class="stats-table-hits">Nb de visites</th>
<th class="stats-table-subscribers">Nb inscrits</th>
<th class="stats-table-ratio">Taux de transfo</th>
<th class="stats-table-revenues">Revenus g&#xE9;n&#xE9;r&#xE9;s</th>
</tr>
<th class="stats-table-date">Date</th>
<th class="stats-table-hits">Nb de visites</th>
<th class="stats-table-subscribers">Nb inscrits</th>
<th class="stats-table-ratio">Taux de transfo</th>
<th class="stats-table-revenues">Revenus g&#xE9;n&#xE9;r&#xE9;s</th>
</tr>
</thead>

<tbody>
<tr>
<td class="stats-table-date">2014-01-01</td>
<td class="stats-table-hits">10</td>
<td class="stats-table-subscribers">2</td>
<td class="stats-table-ratio">20%</td>
<td class="stats-table-revenues">45,32&#x20AC;</td>
</tr>
<tr>
<td class="stats-table-date">2014-01-01</td>
<td class="stats-table-hits">20</td>
<td class="stats-table-subscribers">7</td>
<td class="stats-table-ratio">35%</td>
<td class="stats-table-revenues">80,75&#x20AC;</td>
</tr>
</tbody>
<tr>
<td class="stats-table-date">2014-01-01</td>
<td class="stats-table-hits">10</td>
<td class="stats-table-subscribers">2</td>
<td class="stats-table-ratio">20%</td>
<td class="stats-table-revenues">45,32&#x20AC;</td>
</tr>
<tr>
<td class="stats-table-date">2014-01-01</td>
<td class="stats-table-hits">20</td>
<td class="stats-table-subscribers">7</td>
<td class="stats-table-ratio">35%</td>
<td class="stats-table-revenues">80,75&#x20AC;</td>
</tr>
</tbody>

<tfoot>
<tr>
<th class="stats-table-date">Total</th>
<th class="stats-table-hits">30</th>
<th class="stats-table-subscribers">9</th>
<th class="stats-table-ratio">30%</th>
<th class="stats-table-revenues">126,08&#x20AC;</th>
</tr>
<th class="stats-table-date">Total</th>
<th class="stats-table-hits">30</th>
<th class="stats-table-subscribers">9</th>
<th class="stats-table-ratio">30%</th>
<th class="stats-table-revenues">126,08&#x20AC;</th>
</tr>
</tfoot>
</table>
75 changes: 37 additions & 38 deletions tests/Tests/Dumper/Fixtures/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,46 @@
<table class="stats-table">
<thead>
<tr>
<th class="stats-table-date">
<abbr title="Date of the stats"> Date
</abbr> </th>
<th class="stats-table-hits">
<abbr title="Number of hits"> Nb de visites
</abbr> </th>
<th class="stats-table-subscribers">
Nb inscrits
</th>
<th class="stats-table-ratio">
Taux de transfo
</th>
<th class="stats-table-revenues">
Revenus g&#xE9;n&#xE9;r&#xE9;s
</th>
</tr>
<th class="stats-table-date">
<abbr title="Date of the stats">Date</abbr>
</th>
<th class="stats-table-hits">
<abbr title="Number of hits">Nb de visites</abbr>
</th>
<th class="stats-table-subscribers">
Nb inscrits
</th>
<th class="stats-table-ratio">
Taux de transfo
</th>
<th class="stats-table-revenues">
Revenus g&#xE9;n&#xE9;r&#xE9;s
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="stats-table-date">2014-01-01</td>
<td class="stats-table-hits">10</td>
<td class="stats-table-subscribers">2</td>
<td class="stats-table-ratio">20%</td>
<td class="stats-table-revenues">45,32&#x20AC;</td>
</tr>
<tr>
<td class="stats-table-date">2014-01-01</td>
<td class="stats-table-hits">20</td>
<td class="stats-table-subscribers">7</td>
<td class="stats-table-ratio">35%</td>
<td class="stats-table-revenues">80,75&#x20AC;</td>
</tr>
</tbody>

<tr>
<td class="stats-table-date">2014-01-01</td>
<td class="stats-table-hits">10</td>
<td class="stats-table-subscribers">2</td>
<td class="stats-table-ratio">20%</td>
<td class="stats-table-revenues">45,32&#x20AC;</td>
</tr>
<tr>
<td class="stats-table-date">2014-01-01</td>
<td class="stats-table-hits">20</td>
<td class="stats-table-subscribers">7</td>
<td class="stats-table-ratio">35%</td>
<td class="stats-table-revenues">80,75&#x20AC;</td>
</tr>
</tbody>
<tfoot>
<tr>
<th class="stats-table-date">Total</th>
<th class="stats-table-hits">30</th>
<th class="stats-table-subscribers">9</th>
<th class="stats-table-ratio">30%</th>
<th class="stats-table-revenues">126,08&#x20AC;</th>
</tr>
<th class="stats-table-date">Total</th>
<th class="stats-table-hits">30</th>
<th class="stats-table-subscribers">9</th>
<th class="stats-table-ratio">30%</th>
<th class="stats-table-revenues">126,08&#x20AC;</th>
</tr>
</tfoot>
</table>