Commits

Anonymous committed 12ace51

[project @ 359]
Changed rendering of photo tags to use thumbnail image.

  • Participants
  • Parent commits b9cb3af

Comments (0)

Files changed (1)

cciw/cciwmain/models/__init__.py

 from forums import Forum, NewsItem, Topic, Gallery, Photo, Post
 from polls import Poll, PollOption, VoteInfo
 from sitecontent import MenuLink, HtmlChunk
+from django.conf import settings
 
 # TODO - work out where to put this:
 from lukeplant_me_uk.django.tagging.fields import add_tagging_fields
         (topic.get_absolute_url(), escape(cciw.cciwmain.utils.get_extract(topic.subject, 30)))
 
 def render_photo(photo):
-    return '<a href="%s">Photo: %s</a>' % \
-        (photo.get_absolute_url(), photo.id)
+     return '<a href="%s"><img src="%s/photos/thumbnails/%s" alt="Photo %s" /></a><br/>' % \
+         (photo.get_absolute_url(), settings.MEDIA_URL, photo.filename, photo.id)
+
 
 register_renderer(Member, Member.get_link)
 register_renderer(Post, render_post)