Now properly escaping JS and converting new lines into br for Tooltips.
authorMario Ferraro <fadinlight@gmail.com>
Mon, 06 Jul 2009 16:21:51 +0200
changeset 2561 2751a2462bb3
parent 2560 a944c0169ad8
child 2562 9f9261d32efc
Now properly escaping JS and converting new lines into br for Tooltips. Patch by: Mario Ferraro, Lennard de Rijk
app/soc/templates/soc/templatetags/_as_table_row.html
--- a/app/soc/templates/soc/templatetags/_as_table_row.html	Mon Jul 06 16:13:27 2009 +0200
+++ b/app/soc/templates/soc/templatetags/_as_table_row.html	Mon Jul 06 16:21:51 2009 +0200
@@ -54,7 +54,7 @@
   {% if help_text %}
   <script type="text/javascript">
   $(document).ready( function() {
-    var tooltip = "<div class='tooltip'><div class='tooltip-body'><img src='/soc/content/images/purrInfo.png' alt='' /><h3>Info</h3><p>{{ help_text }}</p></div><div class='tooltip-bottom'></div></div>";
+    var tooltip = "<div class='tooltip'><div class='tooltip-body'><img src='/soc/content/images/purrInfo.png' alt='' /><h3>Info</h3><p>{% autoescape off %}{{ help_text|linebreaksbr|escapejs }}{% endautoescape %}</p></div><div class='tooltip-bottom'></div></div>";
     var tooltip_object=null;
     var documented = $("#{{ field_id }}");
     var not_fieldset = documented.attr('tagName') !== 'FIELDSET';