annotate templates/snippet/snippet_details.djhtml @ 48:329a9d17be88

Implement/fix js for snippets and make whiteboxes all same width
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Mon, 02 Aug 2010 23:44:23 -0500
parents 139e4b8ffb17
children 349162d0ce19
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
44
f697817182d1 Rename .html snippets to .djhtml
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 42
diff changeset
1 {% extends "snippet/base.djhtml" %}
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
2 {% load mptt_tags %}
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
3 {% load i18n %}
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
4
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
5 {% block extrahead %}
46
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
6 {% if request.session.userprefs %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
7 <style type="text/css" media="all">
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
8 .code{
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
9 {# FIXME: Thats stupid #}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
10 {% ifnotequal request.session.userprefs.font_family "None" %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
11 font-family: {{ request.session.userprefs.font_family }} !important;
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
12 {% endifnotequal %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
13 {% ifnotequal request.session.userprefs.font_size "None" %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
14 font-size: {{ request.session.userprefs.font_size }}px !important;
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
15 {% endifnotequal %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
16 {% ifnotequal request.session.userprefs.line_height "None" %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
17 line-height: {{ request.session.userprefs.line_height }}px !important;
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
18 {% endifnotequal %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
19 }
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
20 </style>
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
21 {% endif %}
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
22 {% endblock %}
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
23
46
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
24 {% block title %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
25 {% trans "Snippet" %} #{{ snippet.pk }}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
26 {% endblock title %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
27
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
28 {% block headline %}
46
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
29 <h1>
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
30 {% trans "Snippet" %} #{{ snippet.pk }}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
31 {% if snippet.parent_id %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
32 {% blocktrans with snippet.parent.get_absolute_url as parent_url and snippet.parent.id as parent_id %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
33 (Copy of <a href="{{ parent_url }}">snippet #{{ parent_id }}</a>)
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
34 {% endblocktrans %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
35 {% endif %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
36 <span class="date">
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
37 {{ snippet.published|date:_("DATETIME_FORMAT") }} ({% trans "UTC" %})
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
38 </span>
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
39 </h1>
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
40 {% endblock headline %}
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
41
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
42 {% load snippet_tags %}
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
43
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
44 {% block content %}
48
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
45
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
46 <h2>Snippet view</h2>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
47
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
48 <div class="accordion">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
49 <div class="info">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
50
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
51 <div id="diff" style="display:none;">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
52 diff
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
53 </div>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
54
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
55 <h3>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
56 {% if snippet.title %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
57 {{ snippet.title }}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
58 {% else %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
59 {% trans "Snippet" %} #{{ snippet.id}}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
60 {% endif %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
61 <span>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
62 {% if snippet.author %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
63 {% blocktrans with snippet.author as author %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
64 by {{ author }}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
65 {% endblocktrans %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
66 {% endif %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
67 </span>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
68 </h3>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
69
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
70 <div class="whitebox">
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
71
48
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
72 <div class="snippet-options">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
73 <abbr title="{% trans "Time to life" %}"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
74 >TTL:
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
75 </abbr>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
76 {{ snippet.expires|timeuntil }}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
77 &mdash;
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
78 {% if snippet.pk|in_list:request.session.snippet_list %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
79 <a onclick="return confirm('{% trans "Really delete this snippet?" %}')"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
80 href="{% url snippet_delete snippet.secret_id %}">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
81 Delete now!
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
82 </a>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
83 &mdash;
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
84 {% endif %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
85 <a id="toggleWordwrap" href="#">{% trans "Wordwrap" %}</a>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
86 </div>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
87
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
88 <br />
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
89
48
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
90 <div class="snippet">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
91 <table>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
92 <tr>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
93 <th>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
94 {# this has to look like this due to the pre tags #}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
95 <pre class="code">{% for l in lines %}<a href="#l{{ forloop.counter }}" id="l{{ forloop.counter }}">{{ forloop.counter }}</a>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
96 {% endfor %}</pre>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
97 </th>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
98 <td>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
99 {# this has to look like this due to the pre tags #}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
100 <pre class="code">{% for line in snippet.content_splitted %}<span class="line" id="l{{ forloop.counter }}">{% if line %}{{ line|safe }}{% else %}&nbsp;{% endif %}</span>
47
139e4b8ffb17 Fix display of js code and copy-pastability of displayed code
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 46
diff changeset
101 {% endfor %}</pre>
48
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
102 </td>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
103 </tr>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
104 </table>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
105 </div>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
106
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
107 </div> {#whitebox#}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
108
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
109 </div> {# info #}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
110
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
111 <div class="info">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
112 <h3>{% trans "Write an answer" %} &rarr;</h3>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
113 <div class="accordion" style="display: none;">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
114 <div class="whitebox">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
115 {% include "snippet/snippet_form.djhtml" %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
116 </div>
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
117 </div>
46
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
118 </div>
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
119 </div>
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
120 {% endblock %}
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
121
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
122
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
123
48
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
124 {% block content-related %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
125 <div class="info">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
126
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
127 <h3>{% trans "History" %}</h3>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
128
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
129 <div class="whitebox">
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
130
48
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
131 <form method="get" id="diffform" action="{% url snippet_diff %}">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
132 <div class="tree">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
133 {% for tree_item,structure in tree|tree_info %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
134 {% if structure.new_level %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
135 <ul>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
136 <li>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
137 {% else %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
138 </li>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
139 <li>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
140 {% endif %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
141 <div>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
142 <span class="diff">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
143 <input type="radio" name="a"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
144 value="{{ tree_item.id }}"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
145 {% ifequal tree_item.id snippet.parent_id %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
146 checked="checked"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
147 {% endifequal %}/>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
148 <input type="radio"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
149 name="b"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
150 value="{{ tree_item.id }}"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
151 {% ifequal snippet tree_item %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
152 checked="checked"
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
153 {% endifequal %}/>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
154 </span>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
155 {% ifequal snippet tree_item %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
156 <strong>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
157 {% if tree_item.title %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
158 {{ tree_item.title }}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
159 {% else %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
160 {% trans "Snippet" %} #{{ tree_item.id }}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
161 {% endif %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
162 </strong>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
163 {% else %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
164 <a href="{{ tree_item.get_absolute_url }}">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
165 {% if tree_item.title %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
166 {{ tree_item.title }}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
167 {% else %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
168 {% trans "Snippet" %} #{{ tree_item.id }}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
169 {% endif %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
170 </a>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
171 {% endifequal %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
172 </div>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
173 {% for level in structure.closed_levels %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
174 </li>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
175 </ul>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
176 {% endfor %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
177 {% endfor %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
178 <div class="submit">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
179 <input type="submit" value="{% trans "Compare" %}"/>
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
180 </div>
48
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
181 </div>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
182 </form>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
183
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
184 </div> {# whitebox #}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
185
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
186 </div> {# info #}
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
187
48
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
188 <div class="info">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
189 <h3>{% trans "Options" %}</h3>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
190 <div class="whitebox">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
191 <p>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
192 <a href="{% url snippet_details_raw snippet.secret_id %}">
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
193 {% trans "View raw" %}
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
194 </a>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
195 </p>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
196 </div>
329a9d17be88 Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 47
diff changeset
197 {% endblock content-related %}
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
198
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
199 {% block script_footer %}
46
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
200 <script src="/static/jquery.min.js"></script>
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
201 <script src="/static/jquery-ui.min.js"></script>
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
202 <script type="text/javascript">
47
139e4b8ffb17 Fix display of js code and copy-pastability of displayed code
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 46
diff changeset
203 {%include "snippet/snippet_details.js" %}
42
ab608f27ecd5 Copy preliminary django-paste code for snippets along with mptt. Works clunkily. Still need to adapt it for Agora.
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
diff changeset
204 </script>
46
b7c1c22fdfe8 Format code for 80 columns, add some js to static/ dir
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 44
diff changeset
205 {% endblock script_footer %}