Mercurial > agora-palash
annotate templates/snippet/snippet_details.djhtml @ 55:d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
author | Jordi Gutiérrez Hermoso <jordigh@gmail.com> |
---|---|
date | Mon, 07 Feb 2011 11:59:52 -0600 |
parents | 349162d0ce19 |
children | f872c643b056 |
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 </h3> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
62 |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
63 <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
|
64 |
48
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
65 <div class="snippet-options"> |
55
d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
52
diff
changeset
|
66 <abbr title="{% trans "Time to live" %}" |
48
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
67 >TTL: |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
68 </abbr> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
69 {{ 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
|
70 — |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
71 {% 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
|
72 <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
|
73 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
|
74 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
|
75 </a> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
76 — |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
77 {% endif %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
78 <a id="toggleWordwrap" href="#">{% trans "Wordwrap" %}</a> |
52
349162d0ce19
Fundamental fixes in snippet templates
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
48
diff
changeset
|
79 <div> |
55
d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
52
diff
changeset
|
80 Author: |
d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
52
diff
changeset
|
81 {% if snippet.author %} |
52
349162d0ce19
Fundamental fixes in snippet templates
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
48
diff
changeset
|
82 <a href="{% url agora.apps.profile.views.showprofile snippet.author %}"> |
349162d0ce19
Fundamental fixes in snippet templates
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
48
diff
changeset
|
83 {{ snippet.author }} |
349162d0ce19
Fundamental fixes in snippet templates
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
48
diff
changeset
|
84 </a> |
55
d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
52
diff
changeset
|
85 {% else %} |
d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
52
diff
changeset
|
86 anonymous |
d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
52
diff
changeset
|
87 {% endif %} |
d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
52
diff
changeset
|
88 — |
d48e8676b18f
Show snippets by user in their profile, and show 10 latest snippets on the add snippet page
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
52
diff
changeset
|
89 Language: {{language}} |
52
349162d0ce19
Fundamental fixes in snippet templates
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
48
diff
changeset
|
90 </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
|
91 </div> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
92 |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
93 <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
|
94 |
48
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
95 <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
|
96 <table> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
97 <tr> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
98 <th> |
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 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
|
101 {% 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
|
102 </th> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
103 <td> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
104 {# 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
|
105 <pre class="code">{% for line in snippet.content_splitted %}<span class="line" id="l{{ forloop.counter }}">{% if line %}{{ line|safe }}{% else %} {% 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
|
106 {% 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
|
107 </td> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
108 </tr> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
109 </table> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
110 </div> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
111 |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
112 </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
|
113 |
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> {# info #} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
115 |
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 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
|
117 <h3>{% trans "Write an answer" %} →</h3> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
118 <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
|
119 <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
|
120 {% 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
|
121 </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
|
122 </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
|
123 </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
|
124 </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
|
125 {% 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
|
126 |
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
|
127 |
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
|
128 |
48
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
129 {% 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
|
130 <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
|
131 |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
132 <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
|
133 |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
134 <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
|
135 |
48
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
136 <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
|
137 <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
|
138 {% 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
|
139 {% 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
|
140 <ul> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
141 <li> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
142 {% else %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
143 </li> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
144 <li> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
145 {% endif %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
146 <div> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
147 <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
|
148 <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
|
149 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
|
150 {% 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
|
151 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
|
152 {% endifequal %}/> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
153 <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
|
154 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
|
155 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
|
156 {% 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
|
157 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
|
158 {% endifequal %}/> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
159 </span> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
160 {% 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
|
161 <strong> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
162 {% 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
|
163 {{ 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
|
164 {% else %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
165 {% 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
|
166 {% endif %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
167 </strong> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
168 {% else %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
169 <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
|
170 {% 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
|
171 {{ 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
|
172 {% else %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
173 {% 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
|
174 {% endif %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
175 </a> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
176 {% endifequal %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
177 </div> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
178 {% 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
|
179 </li> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
180 </ul> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
181 {% endfor %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
182 {% endfor %} |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
183 <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
|
184 <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
|
185 </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
|
186 </div> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
187 </form> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
188 |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
189 </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
|
190 |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
191 </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
|
192 |
48
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
193 <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
|
194 <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
|
195 <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
|
196 <p> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
197 <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
|
198 {% 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
|
199 </a> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
200 </p> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
201 </div> |
329a9d17be88
Implement/fix js for snippets and make whiteboxes all same width
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
47
diff
changeset
|
202 {% 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
|
203 |
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 {% 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
|
205 <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
|
206 <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
|
207 <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
|
208 {%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
|
209 </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
|
210 {% endblock script_footer %} |