From 99dea00d410f8acca861fdf0d8e220e97d437819 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 9 Oct 2011 02:47:14 +0530 Subject: [PATCH] noteworthy with thumbnail resize + title as link --- urbstudio/templates/noteworthy.html | 16 +++++++++++----- urbstudio/urb/models.py | 3 +++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/urbstudio/templates/noteworthy.html b/urbstudio/templates/noteworthy.html index be2abaa..4de35af 100755 --- a/urbstudio/templates/noteworthy.html +++ b/urbstudio/templates/noteworthy.html @@ -1,4 +1,5 @@ {% extends 'inner.html' %} +{% load thumbnail %} {% block title %} | Noteworthy {% endblock %} @@ -32,12 +33,17 @@ height:150px; {% block inner_content %} -
-


-
- {% for n in noteworthy %} -
+
+ {% thumbnail n.image "200x150" crop='center' as im %} + + {% endthumbnail %} +

{{ n.title }}

+
+ +

{{ n.description }}

+


+
{% endfor %} diff --git a/urbstudio/urb/models.py b/urbstudio/urb/models.py index 7b0bb03..480cc15 100755 --- a/urbstudio/urb/models.py +++ b/urbstudio/urb/models.py @@ -17,6 +17,9 @@ class Project(models.Model): # end_date = models.DateField(blank=True) # location = models.CharField(max_length=255, blank=True) + class Meta: + ordering = ['-id'] + def get_info(self): return { 'id': self.id,