From: Raphaël Barrois Date: Wed, 22 Aug 2012 13:04:30 +0000 (+0200) Subject: Fix medal decoration choice. X-Git-Tag: xorg/1.1.6~1^2~2 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=54e152b29a21c9434ffeecbebd00ea4aabc74373;p=platal.git Fix medal decoration choice. The javascript expects a continuous set of indices starting from 0. Signed-off-by: Raphaël Barrois --- diff --git a/core b/core index df1ec68..d3e8ac4 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit df1ec683f930734d7532bd3dc3b10c46da947748 +Subproject commit d3e8ac41247fb278285704bd8bf819a5275e5aca diff --git a/templates/profile/grades.js.tpl b/templates/profile/grades.js.tpl index bc4c193..22b92db 100644 --- a/templates/profile/grades.js.tpl +++ b/templates/profile/grades.js.tpl @@ -28,8 +28,8 @@ multiple = new Array(); names[{$m.id}] = "{$m.text|regex_replace:"/\r?\n/":"\\n"}"; {if t($grades[$m.id]) && $grades[$m.id]|@count} subgrades[{$m.id}] = new Array({$grades[$m.id]|@count}); - {foreach from=$grades[$m.id] item=g} - subgrades[{$m.id}][{$g.gid-1}] = [{$g.gid},"{$g.text|regex_replace:"/\r?\n/":"\\n"}"]; + {foreach from=$grades[$m.id] item=g name=subgrade} + subgrades[{$m.id}][{$smarty.foreach.subgrade.index}] = [{$g.gid},"{$g.text|regex_replace:"/\r?\n/":"\\n"}"]; {/foreach} {/if} {if $m.type != 'ordre'}