Skip to content
Snippets Groups Projects
Commit 3d18c208 authored by Olivier PEREZ's avatar Olivier PEREZ
Browse files

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

parent 14727bd9
No related branches found
No related tags found
No related merge requests found
{if !is_array($best_moments) || empty($best_moments)}
{$best_moments = [0]}
{/if}
<h3>{_('Votes of the poll')}</h3>
<div id="tableContainer" class="tableContainer">
......@@ -142,18 +146,20 @@
{* Line displaying best moments *}
{$count_bests = 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}
<td><span class="glyphicon glyphicon-star text-warning"></span><span>{$max}</span></td>
{else}
<td></td>
{/if}
{/foreach}
</tr>
{$max = max($best_moments)}
{if $max > 0}
<tr id="addition">
<td>{_("Addition")}</td>
{foreach $best_moments as $best_moment}
{if $max == $best_moment}
{$count_bests = $count_bests +1}
<td><span class="glyphicon glyphicon-star text-warning"></span><span>{$max}</span></td>
{else}
<td></td>
{/if}
{/foreach}
</tr>
{/if}
</tbody>
</table>
</form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment