Mercurial > hg > agora-dellsystem
changeset 47:139e4b8ffb17
Fix display of js code and copy-pastability of displayed code
author | Jordi Gutiérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Sat, 31 Jul 2010 23:16:23 -0500 |
parents | b7c1c22fdfe8 |
children | 329a9d17be88 |
files | static/snippet_details.js templates/base.djhtml templates/snippet/snippet_details.djhtml templates/snippet/snippet_details.js |
diffstat | 3 files changed, 10 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/templates/base.djhtml +++ b/templates/base.djhtml @@ -75,6 +75,8 @@ <a href="http://www.gnu.org/software/octave/acknowledgments.html"> John W. Eaton and others</a> unless otherwise noted. </p> + {% block script_footer %} + {% endblock %} </div> <!-- END #footer --> </body>
--- a/templates/snippet/snippet_details.djhtml +++ b/templates/snippet/snippet_details.djhtml @@ -82,18 +82,14 @@ <table> <tr> <th> - <pre class="code"> - {% for l in lines %} - <a href="#l{{ forloop.counter }}" - id="l{{ forloop.counter }}"> - {{ forloop.counter }} - </a> - {% endfor %} - </pre> + {# this has to look like this due to the pre tags #} + <pre class="code">{% for l in lines %}<a href="#l{{ forloop.counter }}" id="l{{ forloop.counter }}">{{ forloop.counter }}</a> +{% endfor %}</pre> </th> <td> {# this has to look like this due to the pre tags #} - <pre class="code">{% for line in snippet.content_splitted %}<div class="line" id="l{{ forloop.counter }}">{% if line %} {{ line|safe }} {% else %} {% endif %}</div>{% endfor %}</pre> + <pre class="code">{% for line in snippet.content_splitted %}<span class="line" id="l{{ forloop.counter }}">{% if line %}{{ line|safe }}{% else %} {% endif %}</span> +{% endfor %}</pre> </td> </tr> </table> @@ -101,7 +97,7 @@ </div> <h2>{% trans "Write an answer" %} →</h2> - <div class="container" style="display: none;"> + <div class="accordion" style="display: none;"> {% include "snippet/snippet_form.djhtml" %} </div> </div> @@ -169,6 +165,6 @@ <script src="/static/jquery.min.js"></script> <script src="/static/jquery-ui.min.js"></script> <script type="text/javascript"> - {% include "snippet/snippet_details.js" %} +{%include "snippet/snippet_details.js" %} </script> {% endblock script_footer %}