Changeset 9073
- Timestamp:
- 09/19/08 15:49:50 (2 months ago)
- Files:
-
- djangoproject.com (modified) (1 prop)
- djangoproject.com/djangodocs/forms.py (modified) (1 diff)
- djangoproject.com/djangodocs/templates/docs/doc.html (modified) (2 diffs)
- djangoproject.com/djangodocs/templates/docs/search_form.html (modified) (1 diff)
- djangoproject.com/django_website/apps/aggregator/admin.py (added)
- djangoproject.com/django_website/apps/aggregator/models.py (modified) (2 diffs)
- djangoproject.com/django_website/apps/blog/admin.py (added)
- djangoproject.com/django_website/apps/blog/models.py (modified) (3 diffs)
- djangoproject.com/django_website/apps/contact/forms.py (modified) (1 diff)
- djangoproject.com/django_website/apps/docs/models.py (modified) (1 diff)
- djangoproject.com/django_website/settings.py (modified) (3 diffs)
- djangoproject.com/django_website/templates/blog/entry_archive_day.html (modified) (1 diff)
- djangoproject.com/django_website/templates/blog/entry_archive.html (modified) (1 diff)
- djangoproject.com/django_website/templates/blog/entry_archive_month.html (modified) (1 diff)
- djangoproject.com/django_website/templates/blog/entry_detail.html (modified) (3 diffs)
- djangoproject.com/django_website/templates/blog/entry_snippet.html (modified) (1 diff)
- djangoproject.com/django_website/templates/comments/base.html (added)
- djangoproject.com/django_website/templates/comments/comment_list.html (moved) (moved from djangoproject.com/django_website/templates/comments/freecomment_list.html)
- djangoproject.com/django_website/templates/comments/form.html (added)
- djangoproject.com/django_website/templates/comments/freeform.html (deleted)
- djangoproject.com/django_website/templates/comments/free_preview.html (deleted)
- djangoproject.com/django_website/templates/comments/preview.html (added)
- djangoproject.com/django_website/templates/contact/foundation.html (modified) (1 diff)
- djangoproject.com/django_website/templates/homepage.html (moved) (moved from djangoproject.com/django_website/templates/flatpages/homepage.html)
- djangoproject.com/django_website/templates/registration/registration_form.html (modified) (1 diff)
- djangoproject.com/django_website/upgrade (added)
- djangoproject.com/django_website/upgrade/upgrade-to-1.0.sql (added)
- djangoproject.com/django_website/urls.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
djangoproject.com
- Property svn:externals changed from
django -r6063 http://code.djangoproject.com/svn/django/trunk/django/
registration -r139 http://django-registration.googlecode.com/svn/trunk/registration/
comment_utils -r78 http://django-comment-utils.googlecode.com/svn/trunk/comment_utils/
contact_form -r48 http://django-contact-form.googlecode.com/svn/trunk/contact_form/
to
django http://code.djangoproject.com/svn/django/tags/releases/1.0/django
registration -r168 http://django-registration.googlecode.com/svn/trunk/registration/
contact_form -r49 http://django-contact-form.googlecode.com/svn/trunk/contact_form/
- Property svn:externals changed from
djangoproject.com/djangodocs/forms.py
r8844 r9073 1 from django import newforms asforms1 from django import forms 2 2 3 3 AS_Q_CHOICES = ( djangoproject.com/djangodocs/templates/docs/doc.html
r8926 r9073 39 39 40 40 {% block body %} 41 {{ doc.body }}41 {{ doc.body|safe }} 42 42 {% endblock %} 43 43 … … 76 76 <h2>Contents</h2> 77 77 {% block toc %} 78 {{ doc.toc }}78 {{ doc.toc|safe }} 79 79 {% endblock %} 80 80 {% endblock %} djangoproject.com/djangodocs/templates/docs/search_form.html
r8844 r9073 10 10 </div> 11 11 </form> 12 <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form={{ search_form_id|escape }}& lang={{ lang|escape }}"></script>12 <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form={{ search_form_id|escape }}&lang={{ lang|escape }}"></script> djangoproject.com/django_website/apps/aggregator/models.py
r7892 r9073 2 2 3 3 class Feed(models.Model): 4 title = models.CharField(max length=500)5 feed_url = models.URLField(unique=True, max length=500)6 public_url = models.URLField(max length=500)4 title = models.CharField(max_length=500) 5 feed_url = models.URLField(unique=True, max_length=500) 6 public_url = models.URLField(max_length=500) 7 7 is_defunct = models.BooleanField() 8 8 9 9 class Meta: 10 10 db_table = 'aggregator_feeds' 11 12 class Admin:13 list_display = ["title", "public_url", "is_defunct"]14 list_filter = ["is_defunct"]15 ordering = ["title"]16 search_fields = ["title", "public_url"]17 list_per_page = 50018 11 19 12 def __unicode__(self): … … 22 15 class FeedItem(models.Model): 23 16 feed = models.ForeignKey(Feed) 24 title = models.CharField(max length=500)25 link = models.URLField(max length=500)17 title = models.CharField(max_length=500) 18 link = models.URLField(max_length=500) 26 19 summary = models.TextField(blank=True) 27 20 date_modified = models.DateTimeField() 28 guid = models.CharField(max length=500, unique=True, db_index=True)21 guid = models.CharField(max_length=500, unique=True, db_index=True) 29 22 30 23 class Meta: djangoproject.com/django_website/apps/blog/models.py
r6472 r9073 1 import akismet 1 2 import datetime 3 from django.conf import settings 2 4 from django.db import models 3 from comment_utils.moderation import CommentModerator, moderator 5 from django.contrib.sites.models import Site 6 from django.contrib.comments.signals import comment_was_posted 7 from django.utils.encoding import smart_str 4 8 5 9 class Entry(models.Model): 6 10 pub_date = models.DateTimeField() 7 11 slug = models.SlugField(unique_for_date='pub_date') 8 headline = models.CharField(max length=200)12 headline = models.CharField(max_length=200) 9 13 summary = models.TextField(help_text="Use raw HTML.") 10 14 body = models.TextField(help_text="Use raw HTML.") 11 author = models.CharField(max length=100)15 author = models.CharField(max_length=100) 12 16 13 17 class Meta: … … 16 20 ordering = ('-pub_date',) 17 21 get_latest_by = 'pub_date' 18 19 class Admin:20 list_display = ('pub_date', 'headline', 'author')21 22 22 23 def __unicode__(self): … … 31 32 return delta.days < 60 32 33 33 class EntryModerator(CommentModerator): 34 akismet = True 35 enable_field = "comments_enabled" 36 37 moderator.register(Entry, EntryModerator) 34 def moderate_comment(sender, comment, request, **kwargs): 35 ak = akismet.Akismet( 36 key = settings.AKISMET_API_KEY, 37 blog_url = 'http://%s/' % Site.objects.get_current().domain 38 ) 39 data = { 40 'user_ip': request.META.get('REMOTE_ADDR', '127.0.0.1'), 41 'user_agent': request.META.get('HTTP_USER_AGENT', ''), 42 'referrer': request.META.get('HTTP_REFERRER', ''), 43 'comment_type': 'comment', 44 'comment_author': smart_str(comment.user_name), 45 } 46 if ak.comment_check(smart_str(comment.comment), data=data, build_data=True): 47 comment.is_public = False 48 comment.save() 49 50 comment_was_posted.connect(moderate_comment) djangoproject.com/django_website/apps/contact/forms.py
r8468 r9073 1 1 import textwrap 2 from django import newforms asforms2 from django import forms 3 3 from contact_form.forms import AkismetContactForm 4 4 djangoproject.com/django_website/apps/docs/models.py
r6063 r9073 2 2 3 3 class DocumentRelease(models.Model): 4 version = models.CharField(max length=20, unique=True)5 repository_path = models.CharField(max length=50, help_text="(i.e. 'tags/releases/0.95' or 'branches/0.95-bugfixes')")4 version = models.CharField(max_length=20, unique=True) 5 repository_path = models.CharField(max_length=50, help_text="(i.e. 'tags/releases/0.95' or 'branches/0.95-bugfixes')") 6 6 release_date = models.DateField() 7 7 djangoproject.com/django_website/settings.py
r7898 r9073 19 19 CACHE_BACKEND = "dummy:///" 20 20 DJANGO_SVN_ROOT = "http://code.djangoproject.com/svn/django/" 21 ADMIN_MEDIA_PREFIX = '/media/' 21 22 else: 22 23 DEBUG = False … … 26 27 TEMPLATE_DIRS = ['/home/djangoproject.com/django_website/templates'] 27 28 DJANGO_SVN_ROOT = "file:///home/svn/django/django/" 29 ADMIN_MEDIA_PREFIX = 'http://media.djangoproject.com/admin/' 28 30 29 31 SITE_ID = 1 … … 44 46 'django_website.apps.aggregator', 45 47 'registration', 46 'comment_utils',47 48 ) 48 ADMIN_MEDIA_PREFIX = 'http://media.djangoproject.com/admin/'49 49 MEDIA_ROOT = "/home/html/djangoproject.com/m/" 50 50 MEDIA_URL = "http://www.djangoproject.com.com/m/" djangoproject.com/django_website/templates/blog/entry_archive_day.html
r3008 r9073 8 8 9 9 {% for object in object_list %} 10 <h2><a href="{{ object.get_absolute_url }}">{{ object.headline }}</a></h2>10 <h2><a href="{{ object.get_absolute_url }}">{{ object.headline|safe }}</a></h2> 11 11 <p class="small date">{{ object.pub_date|date:"F j, Y" }}</p> 12 {{ object.body }}12 {{ object.body|safe }} 13 13 14 14 {% endfor %} djangoproject.com/django_website/templates/blog/entry_archive.html
r6526 r9073 3 3 {% block content %} 4 4 5 {% load comments comment_utils %}6 7 5 <h1>Latest entries</h1> 8 6 9 7 {% for object in latest %} 10 <h2><a href="{{ object.get_absolute_url }}">{{ object.headline }}</a></h2>11 {{ object.body }}8 <h2><a href="{{ object.get_absolute_url }}">{{ object.headline|safe }}</a></h2> 9 {{ object.body|safe }} 12 10 <p class="date small">Posted by <strong>{{ object.author }}</strong> on {{ object.pub_date|date:"F j, Y" }}</p> 13 11 {% endfor %} djangoproject.com/django_website/templates/blog/entry_archive_month.html
r3008 r9073 8 8 9 9 {% for object in object_list %} 10 <h2><a href="{{ object.get_absolute_url }}">{{ object.headline }}</a></h2>10 <h2><a href="{{ object.get_absolute_url }}">{{ object.headline|safe }}</a></h2> 11 11 <p class="small date">{{ object.pub_date|date:"F j, Y" }}</p> 12 {{ object.body }}12 {{ object.body|safe }} 13 13 14 14 {% endfor %} djangoproject.com/django_website/templates/blog/entry_detail.html
r6526 r9073 5 5 {% block content %} 6 6 7 <h1>{{ object.headline }}</h1>8 {{ object.body }}7 <h1>{{ object.headline|safe }}</h1> 8 {{ object.body|safe }} 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 comment_utils%}12 {% get_ public_free_comment_list for blog.entry object.id as comment_list %}11 {% load comments %} 12 {% get_comment_list for blog.entry object.id as comment_list %} 13 13 14 14 <div id="content-secondary"> … … 17 17 {% for comment in comment_list %} 18 18 <div class="comment" id="c{{ comment.id }}"> 19 <h3>{{ comment. person_name|escape }} <span class="small quiet">{{ comment.submit_date|date:"F j, Y" }} at {{ comment.submit_date|date:"P" }}</span></h3>19 <h3>{{ comment.user_name|escape }} <span class="small quiet">{{ comment.submit_date|date:"F j, Y" }} at {{ comment.submit_date|date:"P" }}</span></h3> 20 20 {{ comment.comment|escape|urlizetrunc:"40"|linebreaks }} 21 21 </div> … … 24 24 {% if object.comments_enabled %} 25 25 <h2>Post a comment</h2> 26 {% free_comment_form for blog.entry object.id %}26 {% render_comment_form for blog.entry object.id %} 27 27 {% else %} 28 28 <h2>Comments are closed</h2> djangoproject.com/django_website/templates/blog/entry_snippet.html
r8925 r9073 2 2 <h3><a href="{{ e.get_absolute_url }}">{{ e.headline }}</a></h3> 3 3 <p class="date">by <strong>{{ e.author }}</strong> on {{ e.pub_date|date:"M. j, Y" }}</p> 4 {{ e.summary }}4 {{ e.summary|safe }} 5 5 <p class="more"><a href="{{ e.get_absolute_url }}">Read more</a></p> 6 6 {% endfor %} djangoproject.com/django_website/templates/contact/foundation.html
r7895 r9073 3 3 {% block title %}Contact the Django Software Foundation{% endblock %} 4 4 5 {% block extrahead %}6 {{ block.super }}7 <style type="text/css" media="screen">8 form.contact label { display: block; font-weight: bold; margin-top: 1.5em; margin-bottom: 0;}9 form.contact label span { font-weight: normal; color: #555; }10 form.contact input,11 form.contact textarea,12 form.contact select { width: 99%; padding: 1px; }13 form.contact p { margin: 0; }14 form.contact p.submit { text-align: right; margin-top: 1em; margin-right: 0;}15 form.contact p.submit input { width: 10em; font-size: 1.5em; }16 form.contact p.errors { margin: 0; padding: 0; font-weight: bold; color: red; }17 </style>18 {% endblock %}19 20 5 {% block content %} 21 6 <h1>Contact the Django Software Foundation</h1> 22 <form action="." method="post" accept-charset="utf-8" class=" contact">7 <form action="." method="post" accept-charset="utf-8" class="wide"> 23 8 <p> 24 9 <label for="id_name">Your name:</label> djangoproject.com/django_website/templates/registration/registration_form.html
r8925 r9073 6 6 7 7 {% if form.errors %} 8 <p class="error ">Please correct the errors below: {{ form.non_field_errors }}</p>8 <p class="errors">Please correct the errors below: {{ form.non_field_errors }}</p> 9 9 {% endif %} 10 10 11 11 <h1>Create an account</h1> 12 12 13 <form method="post" action=""> 14 <dl> 15 <dt> 16 <label for="id_username">Username:</label> 17 </dt> 18 <dd> 19 {{ form.username }} 20 {% if form.username.errors %} 21 <span class="error">* {{ form.username.errors|join:", " }}</span> 22 {% endif %} 23 </dd> 24 25 <dt> 26 <label for="id_email">Email address:</label> 27 </dt> 28 <dd> 29 {{ form.email }} 30 {% if form.email.errors %} 31 <span class="error">* {{ form.email.errors|join:", " }}</span> 32 {% endif %} 33 </dd> 34 35 <dt> 36 <label for="id_password1">Password:</label> 37 </dt> 38 <dd> 39 {{ form.password1 }} 40 {% if form.password1.errors %} 41 <span class="error">* {{ form.password2.errors|join:", " }}</span> 42 {% endif %} 43 </dd> 44 45 <dt> 46 <label for="id_password2">Password (type again to catch typos):</label> 47 </dt> 48 <dd> 49 {{ form.password2 }} 50 {% if form.password2.errors %} 51 <span class="error">* {{ form.password2.errors|join:", " }}</span> 52 {% endif %} 53 </dd> 54 55 <dt><input type="submit" value="Register" /></dt> 56 </dl> 13 <form method="post" action="" class="wide"> 14 <p> 15 <label for="id_username">Username:</label> 16 {% if form.username.errors %} 17 <p class="errors">{{ form.username.errors.as_text }}</p> 18 {% endif %} 19 {{ form.username }} 20 </p> 21 <p> 22 <label for="id_email">Email address:</label> 23 {% if form.email.errors %} 24 <p class="errors">{{ form.email.errors.as_text }}</p> 25 {% endif %} 26 {{ form.email }} 27 </p> 28 <p> 29 <label for="id_password1">Password:</label> 30 {% if form.password1.errors %} 31 <p class="errors">{{ form.password1.errors.as_text }}</p> 32 {% endif %} 33 {{ form.password1 }} 34 </p> 35 <p> 36 <label for="id_password2">Password (type again to catch typos):</label> 37 {% if form.password2.errors %} 38 <p class="errors">{{ form.password2.errors.as_text }}</p> 39 {% endif %} 40 {{ form.password2 }} 41 </p> 42 <p class="submit"><input type="submit" value="Register →"></p> 57 43 </form> 58 44 djangoproject.com/django_website/urls.py
r7895 r9073 1 from django.conf import settings 1 2 from django.conf.urls.defaults import * 2 from django.contrib.comments.feeds import LatestFreeCommentsFeed 3 from django.contrib.comments.models import FreeComment 3 from django.contrib import admin 4 from django.contrib.comments.feeds import LatestCommentFeed 5 from django.contrib.comments.models import Comment 4 6 from django.contrib.sitemaps import views as sitemap_views 5 7 from django_website.apps.aggregator.feeds import CommunityAggregatorFeed … … 10 12 11 13 comments_info_dict = { 12 'queryset': FreeComment.objects.filter(is_public=True),14 'queryset': Comment.objects.filter(is_public=True).order_by('-submit_date'), 13 15 'paginate_by': 15, 14 16 } … … 21 23 feeds = { 22 24 'weblog': WeblogEntryFeed, 23 'comments': Latest FreeCommentsFeed,25 'comments': LatestCommentFeed, 24 26 'community': CommunityAggregatorFeed, 25 27 } … … 31 33 32 34 urlpatterns = patterns('', 33 (r' freenode\.9xJY7YIUWtwn\.html', 'django.views.generic.simple.direct_to_template', {'template': 'freenode_tmp.html'}),35 (r'^$', 'django.views.generic.simple.direct_to_template', {'template': 'homepage.html'}), 34 36 (r'^accounts/', include('django_website.apps.accounts.urls')), 35 (r'^admin/ ', include('django.contrib.admin.urls')),37 (r'^admin/(.*)', admin.site.root), 36 38 (r'^comments/$', 'django.views.generic.list_detail.object_list', comments_info_dict), 37 (r'^comments/', include('django.contrib.comments.urls .comments')),39 (r'^comments/', include('django.contrib.comments.urls')), 38 40 (r'^community/$', 'django.views.generic.list_detail.object_list', aggregator_info_dict), 39 41 (r'^contact/', include('django_website.apps.contact.urls')), … … 43 45 (r'^sitemap.xml$', cache_page(sitemap_views.sitemap, 60 * 60 * 6), {'sitemaps': sitemaps}), 44 46 (r'^weblog/', include('django_website.apps.blog.urls')), 47 (r'^freenode\.9xJY7YIUWtwn\.html$', 'django.views.generic.simple.direct_to_template', {'template': 'freenode_tmp.html'}), 45 48 (r'', include('django.contrib.flatpages.urls')), 46 49 ) 50 51 admin.autodiscover()
