From f67137166b022911a2750f326084e14225ac8d03 Mon Sep 17 00:00:00 2001 From: Olivier PEREZ Date: Mon, 2 Feb 2015 23:25:50 +0100 Subject: [PATCH] Display only one couple 'Month+Year' on every date of this Month+Year --- tpl/part/vote_table_date.tpl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index 0412a7a..6ae6bdb 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -28,8 +28,23 @@ {/if} + {$count_same = 0} + {$previous = 0} {foreach $slots as $id=>$slot} - {$slot->day|date_format:$date_format.txt_year_month|html} + {$display = $slot->day|date_format:$date_format.txt_year_month|html} + {if $previous !== 0 && $previous != $display} + {$previous} + {$count_same = 0} + {/if} + + {$count_same = $count_same + $slot->moments|count} + + {if $slot@last} + {$display} + {/if} + + {$previous = $display} + {for $foo=0 to ($slot->moments|count)-1} {append var='headersM' value=$id} {/for}