# HG changeset patch # User Chris Ridgway # Date 1320902312 21600 # Node ID 2598bc18b6fb57e88689ce04f3edd0c1859d5cb0 # Parent c32897e111dc2909ceaefdb275b2d23b2a97a19a Shamelessly stole Bob's anchor target method. Fixed CSS for reviews so that the top of the review is not clipped by the navbar. diff -r c32897e111dc -r 2598bc18b6fb bns_website/reviews/models.py --- a/bns_website/reviews/models.py Mon Nov 07 21:22:56 2011 -0600 +++ b/bns_website/reviews/models.py Wed Nov 09 23:18:32 2011 -0600 @@ -3,7 +3,8 @@ """ from django.db import models - +from datetime import timedelta, datetime +from django.core.urlresolvers import reverse class Review(models.Model): """ @@ -22,3 +23,11 @@ def __unicode__(self): return self.reviewer + + def is_new(self): + if datetime.now() - self.date <= timedelta(days=30): + return True + return False + + def get_absolute_url(self): + return reverse('reviews') + '#review%d' % self.id diff -r c32897e111dc -r 2598bc18b6fb bns_website/static/css/base.css --- a/bns_website/static/css/base.css Mon Nov 07 21:22:56 2011 -0600 +++ b/bns_website/static/css/base.css Wed Nov 09 23:18:32 2011 -0600 @@ -21,11 +21,17 @@ ul.review-list { list-style-type: none; } + li.review-list-item { - margin-bottom: 30px; + padding-top:60px; } +/* +----------------------------------------------- +New Styles +----------------------------------------------- +*/ article.news { - margin-bottom: 2em; - border-top: 2px solid DimGray; /* some other gray color might be better */ + margin-bottom: 2em; + border-top: 2px solid DimGray; /* some other gray color might be better */ } \ No newline at end of file diff -r c32897e111dc -r 2598bc18b6fb bns_website/templates/reviews/review_list.html --- a/bns_website/templates/reviews/review_list.html Mon Nov 07 21:22:56 2011 -0600 +++ b/bns_website/templates/reviews/review_list.html Wed Nov 09 23:18:32 2011 -0600 @@ -18,8 +18,8 @@ {% if object_list %}