Rewrite form generation.
[platal.git] / templates / survey / vote.tpl
index 6ba0d81..5b91735 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2010 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2011 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 
 <p>{$survey->description|miniwiki}</p>
 
+<form action="survey/vote/{$survey->shortname}" method="post">
+  <div id="questions">
+  </div>
+
+  <div class="center">
+    {xsrf_token_field}
+    <input type="submit" name="vote" value="Enregister mon vote" />
+  </div>
+</form>
+
+{include file="survey/questions.tpl"}
+
+<script type="text/javascript">
+  //<![CDATA[
+  var questions = {$survey->exportQuestionsToJSON()|smarty:nodefaults};
+
+  {literal}
+  $(function() {
+    $("#question_base").tmpl(questions).appendTo("#questions");
+  });
+  {/literal}
+  //]]>
+</script>
+
 {* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}