Changeset 6472
- Timestamp:
- 10/10/07 17:50:46 (1 year ago)
- Files:
-
- djangoproject.com/django_website/apps/blog/models.py (modified) (2 diffs)
- djangoproject.com/django_website/settings.py (modified) (2 diffs)
- djangoproject.com/django_website/templates/blog/entry_archive.html (modified) (1 diff)
- djangoproject.com/django_website/templates/blog/entry_detail.html (modified) (2 diffs)
- djangoproject.com/django_website/templates/flatfiles/homepage.html (modified) (1 diff)
- djangoproject.com/django_website/urls.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
djangoproject.com/django_website/apps/blog/models.py
r6063 r6472 1 import datetime 1 2 from django.db import models 3 from comment_utils.moderation import CommentModerator, moderator 2 4 3 5 class Entry(models.Model): … … 23 25 def get_absolute_url(self): 24 26 return "/weblog/%s/%s/" % (self.pub_date.strftime("%Y/%b/%d").lower(), self.slug) 27 28 @property 29 def comments_enabled(self): 30 delta = datetime.datetime.now() - self.pub_date 31 return delta.days < 60 32 33 class EntryModerator(CommentModerator): 34 akismet = True 35 enable_field = "comments_enabled" 36 37 moderator.register(Entry, EntryModerator) djangoproject.com/django_website/settings.py
r6064 r6472 48 48 'django_website.apps.aggregator', 49 49 'registration', 50 'comment_utils', 50 51 ) 51 52 ADMIN_MEDIA_PREFIX = 'http://media.djangoproject.com/admin/' … … 76 77 # django-registration settings 77 78 ACCOUNT_ACTIVATION_DAYS = 3 79 80 # comment_utils settings 81 AKISMET_API_KEY = "c892e4962244" djangoproject.com/django_website/templates/blog/entry_archive.html
r3008 r6472 3 3 {% block content %} 4 4 5 {% load comments .comments %}5 {% load comments comment_utils %} 6 6 7 7 <h1>Latest entries</h1> 8 8 9 9 {% for object in latest %} 10 {% get_ free_comment_count for blog.entry object.id as comment_count %}10 {% get_public_free_comment_count for blog.entry object.id as comment_count %} 11 11 <h2><a href="{{ object.get_absolute_url }}">{{ object.headline }}</a></h2> 12 12 {{ object.body }} djangoproject.com/django_website/templates/blog/entry_detail.html
r4401 r6472 9 9 <p class="date small">Posted by <strong>{{ object.author }}</strong> on {{ object.pub_date|date:"F j, Y" }}</p> 10 10 11 {% load comments %}12 {% get_ free_comment_list for blog.entry object.id as comment_list %}11 {% load comments comment_utils %} 12 {% get_public_free_comment_list for blog.entry object.id as comment_list %} 13 13 14 14 <div id="content-secondary"> … … 22 22 {% endfor %} 23 23 24 <h2> Post a comment</h2>24 <h2>Comments are closed</h2> 25 25 26 {% if object.comments_enabled %} 26 27 {% free_comment_form for blog.entry object.id %} 28 {% else %} 29 <p>To prevent spam, comments are no longer allowed after sixty days.</p> 30 {% endif %} 27 31 </div> 28 32 {% endblock %} djangoproject.com/django_website/templates/flatfiles/homepage.html
r6060 r6472 71 71 <h2>Weblog</h2> 72 72 73 {% load comments %} 74 {% load latestblogentry %} 73 {% load comments comment_utils latestblogentry %} 75 74 {% get_latest_blog_entries 4 as latest_entries %} 76 75 77 76 {% for latest_entry in latest_entries %} 78 {% get_ free_comment_count for blog.entry latest_entry.id as comment_count %}77 {% get_public_free_comment_count for blog.entry latest_entry.id as comment_count %} 79 78 <h3><a href="{{ latest_entry.get_absolute_url }}">{{ latest_entry.headline }}</a></h3> 80 79 <p class="date">by <strong>{{ latest_entry.author }}</strong> on {{ latest_entry.pub_date|date:"M. j, Y" }}</p> djangoproject.com/django_website/urls.py
r6064 r6472 10 10 11 11 comments_info_dict = { 12 'queryset': FreeComment.objects. all(),12 'queryset': FreeComment.objects.filter(is_public=True), 13 13 'paginate_by': 15, 14 14 }
