Check the number and the max of votes before displaying the best moments.

This commit is contained in:
Olivier PEREZ 2014-12-19 00:28:20 +01:00
parent 14727bd94c
commit 3d18c208ca

View File

@ -1,3 +1,7 @@
{if !is_array($best_moments) || empty($best_moments)}
{$best_moments = [0]}
{/if}
<h3>{_('Votes of the poll')}</h3>
<div id="tableContainer" class="tableContainer">
@ -142,9 +146,10 @@
{* Line displaying best moments *}
{$count_bests = 0}
{$max = max($best_moments)}
{if $max > 0}
<tr id="addition">
<td>{_("Addition")}</td>
{$max = max($best_moments)}
{foreach $best_moments as $best_moment}
{if $max == $best_moment}
{$count_bests = $count_bests +1}
@ -154,6 +159,7 @@
{/if}
{/foreach}
</tr>
{/if}
</tbody>
</table>
</form>