view gpp/templates/news/story_summary.html @ 265:1ba2c6bf6eb7

Closing #98. Animated GIFs were losing their transparency and animated properties when saved as avatars. Reworked the avatar save process to only run the avatar through PIL if it is too big. This preserves the original uploaded file if it is within the desired size settings. This may still mangle big animated gifs. If this becomes a problem, then maybe look into calling the PIL Image.resize() method directly. Moved the PIL image specific functions from bio.forms to a new module: core.image for better reusability in the future.
author Brian Neal <bgneal@gmail.com>
date Fri, 24 Sep 2010 02:12:09 +0000
parents 1246a4f1ab4f
children daa2916f5b34
line wrap: on
line source
{% load tagging_tags %}
{% load comment_tags %}
{% get_comment_count for story as comment_count %}
<div class="news-story-container">
{% if on_home %}
<h3><a href="{{ story.get_absolute_url }}">{{ story.title }}</a></h3>
{% else %}
<h4><a href="{{ story.get_absolute_url }}">{{ story.title }}</a></h4>
{% endif %}
<div class="news-details">
   Submitted by {{ story.submitter.username }} on {{ story.date_submitted|date:"F d, Y" }}.
</div>
<a href="{% url news-category slug=story.category.slug %}">
<img src="{{ story.category.icon.url }}" alt="{{ story.category.title }}" title="{{ story.category.title }}" 
   class="news-icon" /></a>
<div class="news-content">
   {{ story.short_text|safe }}
</div>
{% if story.long_text %}
<p>
<img src="{{ MEDIA_URL }}icons/bullet_go.png" alt="Read More" />
<a href="{{ story.get_absolute_url }}">There is more to this story, continue reading ...</a>
</p>
{% endif %}
<hr />
<p>
Category: <a href="{% url news-category slug=story.category.slug %}">{{ story.category.title }}</a>
<img src="{{ MEDIA_URL }}icons/comments.png" alt="Comments" title="Comments" />
<a href="{{ story.get_absolute_url }}">{{ comment_count }} comment{{ comment_count|pluralize }}</a>
<a href="{{ story.get_absolute_url }}"><img src="{{ MEDIA_URL }}icons/link.png" alt="Permalink" title="Permalink" /></a>
{% if user.is_authenticated %}
<a href="{% url news.views.email_story story.id %}"><img src="{{ MEDIA_URL }}icons/email_go.png"
   alt="Send this story to a friend" title="Send this story to a friend" /></a>
{% endif %}
</p>
{% tags_for_object story as story_tags %}
{% if story_tags %}
<div class="news-tags">
   <img src="{{ MEDIA_URL }}icons/tag_blue.png" alt="Tags" title="Tags" /> Tags:
   <ul>
      {% for tag in story_tags %}
         <li><a href="{% url news-tag_page tag_name=tag %}">{{ tag }}</a></li>
      {% endfor %}
   </ul>
</div>
{% endif %}
</div>