Fix medal decoration choice.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Wed, 22 Aug 2012 13:04:30 +0000 (15:04 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Wed, 22 Aug 2012 13:04:30 +0000 (15:04 +0200)
The javascript expects a continuous set of indices starting from 0.

Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
core
templates/profile/grades.js.tpl

diff --git a/core b/core
index df1ec68..d3e8ac4 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit df1ec683f930734d7532bd3dc3b10c46da947748
+Subproject commit d3e8ac41247fb278285704bd8bf819a5275e5aca
index bc4c193..22b92db 100644 (file)
@@ -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'}