view templates/snippet/snippet_form.djhtml @ 207:d534881629ff

Updated snippet's template and views files to fix rating code collision which prevented posting new snippets. Updated snippet's models file so that now secret id of each snippet will be unique. It also means that the no two or more than two snippets will have same secret id.
author Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
date Mon, 19 Aug 2013 20:30:19 +0500
parents a4f88ac85837
children
line wrap: on
line source

{% load i18n %}

{% if show %}
<form method="post" action="" class="snippetform"
    enctype="multipart/form-data">
    {% if snippet_form.non_field_errors %}
        <div class="errors">
            {{ snippet_form.non_field_errors }}
        </div>
    {% endif %}

    {% csrf_token %}

    {% with field=snippet_form.title %}
    {% include "simple_field.djhtml" %}
    {% endwith %}

    {% with field=snippet_form.content %}
    {% include "simple_field.djhtml" %}
    {% endwith %}

    {% with field=snippet_form.file %}
    {% include "simple_field.djhtml" %}
    <br />
    {% endwith %}

    {% with field=snippet_form.lexer %}
    {% include "simple_field.djhtml" %}
    {% if request.session.userprefs.display_all_lexer %}
    <input type="button"
           value="{% trans "Guess lexer" %}"
           id="guess_lexer_btn"/>
    {% endif %}
    {% endwith %}

    {% with field=snippet_form.expire_options %}
    {% include "simple_field.djhtml" %}
    {% endwith %}

    <br />
    <div class="center-align">
        <button type="submit" class="button large">{% trans "Paste it" %}</button>
    </div>
</form>
{% endif %}