view templates/snippet/snippet_list.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 b7c1c22fdfe8
children
line wrap: on
line source

{% extends "snippet/base.djhtml" %}
{% load i18n %}

{% block title %}{% trans "Snippet" %} #{{ snippet.pk }}{% endblock %}
{% block headline %}
<h1>
  {% blocktrans %}Your latest {{ snippets_max }} snippets{% endblocktrans %}
</h1>
{% endblock %}

{% block content %}
    {% if snippet_list %}
    {% for snippet in snippet_list %}
    <h2>
        <a href="{{ snippet.get_absolute_url }}">
          {% trans "Snippet" %} #{{ snippet.pk }}
        </a>
        ~ {{ snippet.published|date:_("DATETIME_FORMAT") }}
    </h2>
    <p style="color: #555; margin: 8px 0 20px 0;">
      {{ snippet.content|truncatewords:40 }}
    </p>
    {% endfor %}
    {% else %}
    <p>
      {% trans "No snippets available." %}
    </p>
    {% endif %}


    <div class="hint">
        {% trans "DATA_STORED_IN_A_COOKIE_HINT" %}
    </div>
{% endblock %}