Merge commit 'origin/core-1.0.0' into core
[platal.git] / templates / bug.tpl
index 49c1049..2af4c42 100644 (file)
@@ -1,28 +1,80 @@
-<div style="width:800px;height:600px">\r
-{if $bug_sent}\r
-<script type="text/javascript">window.close();</script>\r
-{/if}\r
-<form action="send_bug" method="post">\r
-       <h1>Signaler un bug ou demander une amélioration</h1>\r
-       <div style="margin-left:10%;margin-right:10%">\r
-          <select name="task_type">\r
-           <option value="bug">Bug</option>\r
-            <option value="wish">Wish</option>\r
-          </select>\r
-          &nbsp;&nbsp;Sujet : <input type="text" name="item_summary" id="flyspray_title" value="sur la page {$smarty.server.HTTP_REFERER}" size="50" maxlength="100"/>\r
-          <textarea name="detailed_desc" id="flyspray_detail" cols="70" rows="10" style="width:100%;margin-top:10px;margin-bottom:10px;height:400px;display:block;">\r
+{**************************************************************************}\r
+{*                                                                        *}\r
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}\r
+{*  http://opensource.polytechnique.org/                                  *}\r
+{*                                                                        *}\r
+{*  This program is free software; you can redistribute it and/or modify  *}\r
+{*  it under the terms of the GNU General Public License as published by  *}\r
+{*  the Free Software Foundation; either version 2 of the License, or     *}\r
+{*  (at your option) any later version.                                   *}\r
+{*                                                                        *}\r
+{*  This program is distributed in the hope that it will be useful,       *}\r
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}\r
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}\r
+{*  GNU General Public License for more details.                          *}\r
+{*                                                                        *}\r
+{*  You should have received a copy of the GNU General Public License     *}\r
+{*  along with this program; if not, write to the Free Software           *}\r
+{*  Foundation, Inc.,                                                     *}\r
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}\r
+{*                                                                        *}\r
+{**************************************************************************}\r
+\r
+<script type="text/javascript">//<![CDATA[\r
+{literal}\r
+var edited=false;\r
+\r
+function cleanContent()\r
+{\r
+  if (edited == false) {\r
+    var field = document.getElementById('flyspray_detail');\r
+    field.value = '';\r
+    field.style.color = "black";\r
+    field.style.textAlign = "left";\r
+  }\r
+}\r
 \r
-** Explique ici le problème ou l'amélioration proposée **\r
-               \r
-Page : {$smarty.server.HTTP_REFERER}\r
+function fillContent()\r
+{\r
+  var field = document.getElementById('flyspray_detail');\r
+  if (field.value == '' || (field.value.toUpperCase() == field.value && field.value.toLowerCase() == field.value)) {\r
+    field.value = "** Explique ici le problème ou l'amélioration proposée **";\r
+    field.style.color = "gray";\r
+    field.style.textAlign = "center";\r
+    edited = false;\r
+  } else {\r
+    edited = true;\r
+  }\r
+}\r
+{/literal}\r
+//]]></script>\r
 \r
-Navigateur : {$smarty.server.HTTP_USER_AGENT}\r
-Skin : {$smarty.session.skin} \r
-Signalé par {$smarty.session.forlife}</textarea>\r
-          <div style="text-align:center">\r
-              <input type="button" value="Fermer" onclick="window.close()"/>\r
-              <input type="submit" name="send" value="Signaler le bug"/>\r
-          </div>\r
+<div style="width:800px;height:600px">\r
+{if $bug_sent}\r
+<div><input type="submit" onclick="window.close()" name="close" value="Fermer" /></div>\r
+{else}\r
+<form action="send_bug" method="post" onsubmit="cleanContent()">\r
+  {xsrf_token_field}\r
+  <h1>Signaler un bug ou demander une amélioration</h1>\r
+  <div style="margin-left:10%;margin-right:10%">\r
+    <select name="task_type">\r
+      <option value="bug">Erreur</option>\r
+      <option value="wish">Souhait</option>\r
+      <option value="help">Aide/Dépannage</option>\r
+    </select>\r
+    &nbsp;&nbsp;Sujet&nbsp;: <input type="text" name="item_summary" id="flyspray_title" value="sur la page { $location }" size="50" maxlength="100"/>\r
+    <textarea name="detailed_desc" id="flyspray_detail" cols="70" rows="10" style="width:100%;margin-top:10px;margin-bottom:10px;height:400px;display:block;" onFocus="cleanContent()" onBlur="fillContent()"></textarea>\r
+    <input type="hidden" name="page" value="{$smarty.server.HTTP_REFERER|default:$smarty.request.page}" />\r
+    <div class="center">\r
+      <input type="button" value="Abandonner" onclick="window.close()"/>\r
+      <input type="submit" name="send" value="Envoyer"/>\r
     </div>\r
+  </div>\r
 </form>\r
+<script type="text/javascript">\r
+  fillContent();\r
+</script>\r
 </div>\r
+{/if}\r
+\r
+{* vim:set et sws=2 sts=2 sw=2 enc=utf-8: *}\r