Survey module : basic templates
authorx2004laborde <x2004laborde@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 15 Mar 2007 19:26:26 +0000 (19:26 +0000)
committerx2004laborde <x2004laborde@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 15 Mar 2007 19:26:26 +0000 (19:26 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1576 839d8a87-29fc-0310-9880-83ba4fa771e5

23 files changed:
templates/survey/admin.tpl [new file with mode: 0644]
templates/survey/confirm.tpl [new file with mode: 0644]
templates/survey/edit_checkbox.tpl [new file with mode: 0644]
templates/survey/edit_new.tpl [new file with mode: 0644]
templates/survey/edit_num.tpl [new file with mode: 0644]
templates/survey/edit_personal.tpl [new file with mode: 0644]
templates/survey/edit_question.tpl [new file with mode: 0644]
templates/survey/edit_radio.tpl [new file with mode: 0644]
templates/survey/edit_root.tpl [new file with mode: 0644]
templates/survey/edit_survey.tpl [new file with mode: 0644]
templates/survey/edit_text.tpl [new file with mode: 0644]
templates/survey/edit_textarea.tpl [new file with mode: 0644]
templates/survey/error.tpl [new file with mode: 0644]
templates/survey/index.tpl [new file with mode: 0644]
templates/survey/show_checkbox.tpl [new file with mode: 0644]
templates/survey/show_num.tpl [new file with mode: 0644]
templates/survey/show_personal.tpl [new file with mode: 0644]
templates/survey/show_radio.tpl [new file with mode: 0644]
templates/survey/show_survey.tpl [new file with mode: 0644]
templates/survey/show_text.tpl [new file with mode: 0644]
templates/survey/show_textarea.tpl [new file with mode: 0644]
templates/survey/success.tpl [new file with mode: 0644]
templates/survey/test.tpl [new file with mode: 0644]

diff --git a/templates/survey/admin.tpl b/templates/survey/admin.tpl
new file mode 100644 (file)
index 0000000..2d5cfbe
--- /dev/null
@@ -0,0 +1,101 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<h1>Sondages</h1>
+
+<table class="bicol">
+  <tr>
+    <th>
+      Sondages en attente de validation
+    </th>
+  </tr>
+  {iterate item=s from=$survey_waiting}
+  <tr class="{cycle values="impair,pair"}">
+    <td class="half">
+      &bull;
+      <a href="survey/admin/edit/{$s.survey_id}">
+        {$s.title} ({$s.end|date_format:"%x"})
+      </a>
+    </td>
+  </tr>
+  {assign var="has_ws" value="true"}
+  {/iterate}
+  {if !$has_ws}
+  <tr>
+    <td class="half">Aucun sondage en attente de validation</td>
+  </tr>
+  {/if}
+</table>
+
+<br />
+
+<table class="bicol">
+  <tr>
+    <th>
+      Sondages en cours
+    </th>
+  </tr>
+  {iterate item=s from=$survey_current}
+  <tr class="{cycle values="impair,pair"}">
+    <td class="half">
+      &bull;
+      <a href="survey/admin/edit/{$s.survey_id}">
+        {$s.title} ({$s.end|date_format:"%x"})
+      </a>
+    </td>
+  </tr>
+  {assign var="has_cs" value="true"}
+  {/iterate}
+  {if !$has_cs}
+  <tr>
+    <td class="half">Aucun sondage en cours</td>
+  </tr>
+  {/if}
+</table>
+
+<br />
+
+<table class="bicol">
+  <tr>
+    <th>
+      Anciens sondages
+    </th>
+  </tr>
+  {iterate item=s from=$survey_old}
+  <tr class="{cycle values="impair,pair"}">
+    <td class="half">
+      &bull;
+      <a href="survey/admin/edit/{$s.survey_id}">
+        {$s.title} ({$s.end|date_format:"%x"})
+      </a>
+    </td>
+  </tr>
+  {assign var="has_os" value="true"}
+  {/iterate}
+  {if !$has_os}
+  <tr>
+    <td class="half">Aucun ancien sondage</td>
+  </tr>
+  {/if}
+</table>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/survey/confirm.tpl b/templates/survey/confirm.tpl
new file mode 100644 (file)
index 0000000..e90d8ec
--- /dev/null
@@ -0,0 +1,40 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+<h1>Sondage : confirmation</h1>
+
+<form action="{$survey_formaction}" method="post">
+  {if is_array($survey_formhidden)}
+    {foreach from=$survey_formhidden item=s_value key=s_key}
+  <input type="hidden" name="survey_{$s_key}" value="{$s_value}"/>
+    {/foreach}
+  {/if}
+  {if $survey_message neq ""}
+    {$survey_message}
+  {else}
+    Une confirmation est requise
+  {/if}
+  <br/>
+  <input type="submit" name="survey_submit" value="Confirmer"/>
+  <input type="submit" name="survey_cancel" value="Annuler"/>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/survey/edit_checkbox.tpl b/templates/survey/edit_checkbox.tpl
new file mode 100644 (file)
index 0000000..fc042ea
--- /dev/null
@@ -0,0 +1,26 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+{include file='survey/edit_radio.tpl'}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/edit_new.tpl b/templates/survey/edit_new.tpl
new file mode 100644 (file)
index 0000000..887d8b0
--- /dev/null
@@ -0,0 +1,39 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+    <tr>
+      <td class="titre">Type</td>
+      <td>
+        <select name="survey_type" id="survey_type" onchange="Ajax.update_html('survey_form', 'survey/ajax/' + document.getElementById('survey_type').value); return false">
+        {foreach from=$survey_types key='stype_v' item='stype_t'}
+          <option value="{$stype_v}"{if $survey_type eq $stype_v} selected="selected"{/if}>{$stype_t}</option>
+        {/foreach}
+        </select>
+      </td>
+    </tr>
+    {if $survey_type == "new"}
+      {include file='survey/edit_question.tpl'}
+    {else}
+      {include file="survey/edit_$survey_type.tpl"}
+    {/if}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/edit_num.tpl b/templates/survey/edit_num.tpl
new file mode 100644 (file)
index 0000000..7956f0f
--- /dev/null
@@ -0,0 +1,26 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+    {include file='survey/edit_question.tpl'}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/edit_personal.tpl b/templates/survey/edit_personal.tpl
new file mode 100644 (file)
index 0000000..ae8b869
--- /dev/null
@@ -0,0 +1,37 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+    {include file='survey/edit_question.tpl' disable_question=true}
+    <tr>
+      <td class="titre">Demande</td>
+      <td>
+        <input type="checkbox" name="survey_question[promo]" value="1" id="survey_question[promo]"{if $survey_current.promo} checked="checked"{/if}/><label for="survey_question[promo]">Demander la promotion</label><br/>
+        <input type="checkbox" name="survey_question[name]" value="1" id="survey_question[name]"{if $survey_current.name} checked="checked"{/if}/><label for="survey_question[name]">Demander le nom et le pr&#233;nom</label>
+    <tr>
+      <td colspan='2'>
+        Cette question d&#233;truit totalement ou en partie l'anonymat du sondage : un message sera affich&#233; pour pr&#233;venir les utilisateurs,
+        ils pourront accepter ou non de transmettre ces informations.
+      </td>
+    </tr>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/edit_question.tpl b/templates/survey/edit_question.tpl
new file mode 100644 (file)
index 0000000..bff8c4f
--- /dev/null
@@ -0,0 +1,32 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+    <tr>
+      <td class="titre">Question</td>
+      <td><input type="text" name="survey_question[question]" size="50" maxlength="200" value="{$survey_current.question}"{if $disable_question} disabled="disabled"{/if}/></td>
+    </tr>
+    <tr>
+      <td class="titre">Commentaire</td>
+      <td><textarea name="survey_question[comment]" rows="5" cols="60">{$survey_current.comment}</textarea></td>
+    </tr>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/survey/edit_radio.tpl b/templates/survey/edit_radio.tpl
new file mode 100644 (file)
index 0000000..4558c39
--- /dev/null
@@ -0,0 +1,30 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+    {include file='survey/edit_question.tpl'}
+    <tr>
+      <td class="titre">Choix</td>
+      <td><input type="text" name="survey_question[options]" size="50" maxlength="200" value="{$survey_current.options}"/></td>
+    </tr>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/edit_root.tpl b/templates/survey/edit_root.tpl
new file mode 100644 (file)
index 0000000..daa524c
--- /dev/null
@@ -0,0 +1,40 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+    <tr>
+      <td class="titre">Titre</td>
+      <td><input type="text" name="survey_question[question]" size="50" maxlength="200" value="{$survey_current.question}"/></td>
+    </tr>
+    <tr>
+      <td class="titre">Commentaire</td>
+      <td><textarea name="survey_question[comment]" rows="5" cols="60">{$survey_current.comment}</textarea></td>
+    </tr>
+    <tr>
+      <td class="titre">Date de fin</td>
+      <td><input type="text" name="survey_question[end]" size="50" maxlength="200" value="{if $survey_current.end eq '#'}#{else}{$survey_current.end|date_format:"%d/%m/%Y"}{/if}"/></td>
+    </tr>
+    <tr>
+      <td class="titre">Promotions</td>
+      <td><input type="text" name="survey_question[promos]" size="50" maxlength="200" value="{$survey_current.promos}"/></td>
+    </tr>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/survey/edit_survey.tpl b/templates/survey/edit_survey.tpl
new file mode 100644 (file)
index 0000000..b4dfb64
--- /dev/null
@@ -0,0 +1,35 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+<h1>Sondage : {if $survey_type == 'root'}nouveau sondage{else}nouvelle question{/if}</h1>
+
+<form action="{$survey_formaction}" method="post">
+  <input type="hidden" name="survey_action" value="{$survey_action}"/>
+  <input type="hidden" name="survey_qid" value="{$survey_qid}"/>
+  <table class="bicol" id="survey_form">
+    {include file="survey/edit_$survey_type.tpl"}
+  </table>
+  <input type="submit" name="survey_submit" value="Valider"/>
+  <input type="reset" name="survey_reset" value="R&#233;initialiser"/>
+  <input type="submit" name="survey_cancel" value="Annuler"/>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/survey/edit_text.tpl b/templates/survey/edit_text.tpl
new file mode 100644 (file)
index 0000000..7956f0f
--- /dev/null
@@ -0,0 +1,26 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+    {include file='survey/edit_question.tpl'}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/edit_textarea.tpl b/templates/survey/edit_textarea.tpl
new file mode 100644 (file)
index 0000000..7956f0f
--- /dev/null
@@ -0,0 +1,26 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+    {include file='survey/edit_question.tpl'}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/error.tpl b/templates/survey/error.tpl
new file mode 100644 (file)
index 0000000..714e7ad
--- /dev/null
@@ -0,0 +1,44 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+<h1>Sondage : erreur</h1>
+
+{if !is_null($survey_errors) && is_array($survey_errors)}
+<table class="bicol">
+  <tr>
+    <th colspan='2'>Une ou plusieurs erreurs sont survenues</th>
+  </tr>
+  {foreach from=$survey_errors item=survey_error}
+  <tr class="{cycle values="impair,pair"}">
+    <td>&bull; {$survey_error.error}</td>
+    <td><a href="survey/edit/question/{$survey_error.question}">corriger</a></td>
+  </tr>
+  {/foreach}
+</table>
+{elseif $survey_message neq ""}
+  {$survey_message}
+{else}
+Une erreur inconnue est survenue dans l'&#233;dition de ce sondage. N'hésite pas &#226; <a href='send_bug'>signaler ce bug</a> si il persiste.
+{/if}
+<br/>
+<a href="{$survey_link}">Retour</a>
+
+{* vim:set et sw=2 sts=2 ts=8: *}
diff --git a/templates/survey/index.tpl b/templates/survey/index.tpl
new file mode 100644 (file)
index 0000000..b838a67
--- /dev/null
@@ -0,0 +1,77 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<h1>Sondages</h1>
+
+<table class="bicol">
+  <tr>
+    <th>
+      Sondages en cours
+    </th>
+  </tr>
+  {iterate item=s from=$survey_current}
+  <tr class="{cycle values="impair,pair"}">
+    <td class="half">
+      &bull;
+      <a href="survey/show/{$s.survey_id}">
+        {$s.title} ({$s.end|date_format:"%x"})
+      </a>
+    </td>
+  </tr>
+  {assign var="has_cs" value="true"}
+  {/iterate}
+  {if !$has_cs}
+  <tr>
+    <td class="half">Aucun sondage en cours</td>
+  </tr>
+  {/if}
+</table>
+
+<br />
+
+<table class="bicol">
+  <tr>
+    <th>
+      Anciens sondages
+    </th>
+  </tr>
+  {iterate item=s from=$survey_old}
+  <tr class="{cycle values="impair,pair"}">
+    <td class="half">
+      &bull;
+      <a href="survey/show/{$s.survey_id}">
+        {$s.title} ({$s.end|date_format:"%x"})
+      </a>
+    </td>
+  </tr>
+  {assign var="has_os" value="true"}
+  {/iterate}
+  {if !$has_os}
+  <tr>
+    <td class="half">Aucun ancien sondage</td>
+  </tr>
+  {/if}
+</table>
+
+<a href="./survey/edit/new">Proposer un sondage</a>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/survey/show_checkbox.tpl b/templates/survey/show_checkbox.tpl
new file mode 100644 (file)
index 0000000..532787d
--- /dev/null
@@ -0,0 +1,28 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+{foreach from=$survey.choices item=choice}
+  <input type="checkbox" name="survey{$survey_id}_{$survey.id}_{$choices}" value="1" id="{$choice}" {if $survey_mode eq 'edit'}disabled="disabled"{/if}/><label for="{$choice}">{$choice}</label>
+{/foreach}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/show_num.tpl b/templates/survey/show_num.tpl
new file mode 100644 (file)
index 0000000..755375d
--- /dev/null
@@ -0,0 +1,26 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+{include file='survey/show_text.tpl'}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/show_personal.tpl b/templates/survey/show_personal.tpl
new file mode 100644 (file)
index 0000000..f298be9
--- /dev/null
@@ -0,0 +1,33 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+
+{if $survey.promo}
+  <input type="checkbox" name="survey{$survey_id}_{$survey.id}_promo" value="1" id="survey{$survey_id}_{$survey.id}_promo" {if $survey_mode eq 'edit'}disabled="disabled"{/if}/><label for="survey{$survey_id}_{$survey.id}_promo">Je veux indiquer ma promotion</label><br/>
+{/if}
+{if $survey.name}
+  <input type="checkbox" name="survey{$survey_id}_{$survey.id}_name" value="1" id="survey{$survey_id}_{$survey.id}_name" {if $survey_mode eq 'edit'}disabled="disabled"{/if}/><label for="survey{$survey_id}_{$survey.id}_name">Je veux indiquer mon nom et mon pr&#233;nom</label><br/>
+{/if}
+  <strong>Attention, cocher cette(ces) case(s) d&#233;truit totalement ou en partie l'anonymat de ta r&#233;ponse.</strong>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/show_radio.tpl b/templates/survey/show_radio.tpl
new file mode 100644 (file)
index 0000000..f614f9a
--- /dev/null
@@ -0,0 +1,28 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+{foreach from=$survey.choices item=choice}
+  <input type="radio" name="survey{$survey_id}_{$survey.id}" value="{$choice}" id="{$choice}" {if $survey_mode eq 'edit'}disabled="disabled"{/if}/><label for="{$choice}">{$choice}</label>
+{/foreach}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/show_survey.tpl b/templates/survey/show_survey.tpl
new file mode 100644 (file)
index 0000000..e062a13
--- /dev/null
@@ -0,0 +1,76 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+{if $survey.type == 'root'}
+<h1>Sondage : {$survey.question}</h1>
+  {if $survey.comment != ''}
+    {$survey.comment}
+  {/if}
+<br/>Fin du sondage :
+  {if $survey.end eq "#"}
+    erreur
+  {else}
+    {$survey.end|date_format:"%x"}
+  {/if}
+<br/>R&#233;serv&#233; aux promotions :
+  {if $survey.promos eq "#"}
+    erreur
+  {elseif $survey.promos eq ""}
+    aucune restriction
+  {else}
+    {$survey.promos}
+  {/if}
+<br/>
+<a href='./survey/edit/question/{$survey.id}'>Modifier la racine</a> |
+<a href='./survey/edit/nested/{$survey.id}'>Ajouter une question au début</a>
+  {if is_array($survey.children)}
+    {foreach from=$survey.children item=child}
+      {include file='survey/show_survey.tpl' survey=$child recursive=true}
+    {/foreach}
+  {/if}
+<br/><br/>
+<a href='./survey/edit/valid'>{if $survey_adminmode}Enregistrer les modifications{else}Proposer ce sondage{/if}</a> |
+<a href='./survey/edit/cancel'>Annuler {if $survey_adminmode}les modifications{else}totalement la cr&#233;ation de ce sondage{/if}</a>
+
+{else}
+<div>
+  <h2>{$survey.question}</h2>
+  {if $survey.comment != ''}
+    {$survey.comment}<br/>
+  {/if}
+  {assign var='survey_type' value=$survey.type}
+  {include file="survey/show_$survey_type.tpl"}
+  <br/>
+  <a href='./survey/edit/question/{$survey.id}'>Modifier cette question</a> |
+  <a href='./survey/edit/del/{$survey.id}'>Supprimer cette question</a> |
+  {if is_array($survey.children)}
+  <a href='./survey/edit/nested/{$survey.id}'>Ajouter une question imbriqu&#233;e</a>
+  <div style="padding-left:20px">
+    {foreach from=$survey.children item=child}
+      {include file='survey/show_survey.tpl' survey=$child recursive=true}
+    {/foreach}
+  </div>
+  {/if}
+  <a href='./survey/edit/after/{$survey.id}'>Ajouter une question apr&#232;s</a>
+</div>
+{/if}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
diff --git a/templates/survey/show_text.tpl b/templates/survey/show_text.tpl
new file mode 100644 (file)
index 0000000..5ef4ac9
--- /dev/null
@@ -0,0 +1,26 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+  <input type="text" name="survey{$survey_id}_{$survey.id}" value="" size="50" maxlength="200" {if $survey_mode eq 'edit'}disabled="disabled"{/if}/>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/show_textarea.tpl b/templates/survey/show_textarea.tpl
new file mode 100644 (file)
index 0000000..31a5225
--- /dev/null
@@ -0,0 +1,26 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+  <textarea name="survey{$survey_id}_{$survey.id}" rows="5" cols="60" {if $survey_mode eq 'edit'}disabled="disabled"{/if}></textarea>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
+
diff --git a/templates/survey/success.tpl b/templates/survey/success.tpl
new file mode 100644 (file)
index 0000000..baede07
--- /dev/null
@@ -0,0 +1,32 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+<h1>Sondage : succ&#232;s</h1>
+
+{if $survey_message neq ""}
+  {$survey_message}
+{else}
+  Op&#233;ration r&#233;ussie
+{/if}
+<br/>
+<a href="{$survey_link}">Retour</a>
+
+{* vim:set et sw=2 sts=2 ts=8: *}
diff --git a/templates/survey/test.tpl b/templates/survey/test.tpl
new file mode 100644 (file)
index 0000000..34d13f2
--- /dev/null
@@ -0,0 +1,57 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+{if $survey.type == 'racine'}
+<h1>Sondage : {$survey.question}</h1>
+  {if $survey.comment != ''}
+    {$survey.comment}
+  {/if}
+  {if is_array($survey.children)}
+    {foreach from=$survey.children item=child}
+      {include file='survey/test.tpl' survey=$child recursive=true}
+    {/foreach}
+  {/if}
+
+{else}
+<div>
+  <h2>{$survey.question}</h2>
+  {if $survey.comment != ''}
+    {$survey.comment}<br/>
+  {/if}
+  {if $survey.type == 'text' || $survey.type == 'num' }
+  <input type="text" name="survey{$survey_id}_{$survey.id}" value="" {if $survey_mode eq 'edit'}disabled="disabled"{/if}/>
+  {elseif $survey.type == 'radio'}
+    {foreach from=$survey.choices item=choice}
+  <input type="radio" name="survey{$survey_id}_{$survey.id}" value="{$choice}" id="{$choice}" {if $survey_mode eq 'edit'}disabled="disabled"{/if}/><label for="{$choice}">{$choice}</label>
+    {/foreach}
+  {/if}
+  {if is_array($survey.children)}
+  <div style="padding-left:20px">
+    {foreach from=$survey.children item=child}
+      {include file='survey/test.tpl' survey=$child recursive=true}
+    {/foreach}
+  </div>
+  {/if}
+</div>
+{/if}
+
+{* vim:set et sw=2 sts=2 sws=2: *}