annotate templates/snippet/snippet_form.djhtml @ 190:a4f88ac85837

Changes: Now guest users cannot see revision history and they also cannot see snippets posted by registered users. To see snippets posted by registered users, one has to login.
author ahsanalishahid <ahsan.ali.shahid@gmail.com>
date Thu, 20 Jun 2013 17:17:16 +0500
parents ba51d3b7740b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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
1 {% load i18n %}
190
a4f88ac85837 Changes: Now guest users cannot see revision history and they also cannot see snippets posted by registered users. To see snippets posted by registered users, one has to login.
ahsanalishahid <ahsan.ali.shahid@gmail.com>
parents: 133
diff changeset
2
a4f88ac85837 Changes: Now guest users cannot see revision history and they also cannot see snippets posted by registered users. To see snippets posted by registered users, one has to login.
ahsanalishahid <ahsan.ali.shahid@gmail.com>
parents: 133
diff changeset
3 {% if show %}
133
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
4 <form method="post" action="" class="snippetform"
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
5 enctype="multipart/form-data">
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
6 {% if snippet_form.non_field_errors %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
7 <div class="errors">
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
8 {{ snippet_form.non_field_errors }}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
9 </div>
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
10 {% endif %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
11
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
12 {% csrf_token %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
13
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
14 {% with field=snippet_form.title %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
15 {% include "simple_field.djhtml" %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
16 {% endwith %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
17
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
18 {% with field=snippet_form.content %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
19 {% include "simple_field.djhtml" %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
20 {% endwith %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
21
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
22 {% with field=snippet_form.file %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
23 {% include "simple_field.djhtml" %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
24 <br />
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
25 {% endwith %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
26
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
27 {% with field=snippet_form.lexer %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
28 {% include "simple_field.djhtml" %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
29 {% if request.session.userprefs.display_all_lexer %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
30 <input type="button"
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
31 value="{% trans "Guess lexer" %}"
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
32 id="guess_lexer_btn"/>
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
33 {% endif %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
34 {% endwith %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
35
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
36 {% with field=snippet_form.expire_options %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
37 {% include "simple_field.djhtml" %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
38 {% endwith %}
ba51d3b7740b Add ability to upload a file to create a snippet
dellsystem <ilostwaldo@gmail.com>
parents: 94
diff changeset
39
87
e0348cfbdf48 Update styling of snippets page
dellsystem <ilostwaldo@gmail.com>
parents: 46
diff changeset
40 <br />
e0348cfbdf48 Update styling of snippets page
dellsystem <ilostwaldo@gmail.com>
parents: 46
diff changeset
41 <div class="center-align">
e0348cfbdf48 Update styling of snippets page
dellsystem <ilostwaldo@gmail.com>
parents: 46
diff changeset
42 <button type="submit" class="button large">{% trans "Paste it" %}</button>
e0348cfbdf48 Update styling of snippets page
dellsystem <ilostwaldo@gmail.com>
parents: 46
diff changeset
43 </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
44 </form>
190
a4f88ac85837 Changes: Now guest users cannot see revision history and they also cannot see snippets posted by registered users. To see snippets posted by registered users, one has to login.
ahsanalishahid <ahsan.ali.shahid@gmail.com>
parents: 133
diff changeset
45 {% endif %}