Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added i18n, renamed includes, moved initial_data, work towards next r…

…elease
  • Loading branch information...
commit 9a8dae98a0b3963ce9812cd4567878c61ab3bd61 1 parent fbab264
@montylounge authored
Showing with 258 additions and 126 deletions.
  1. +8 −0 AUTHORS
  2. +21 −5 mingus/core/views.py
  3. +34 −0 mingus/fixtures/initial_data.json
  4. +1 −0  mingus/models.py
  5. +1 −0  mingus/settings.py
  6. +7 −7 mingus/templates/base.html
  7. +7 −7 mingus/templates/blog/category_detail.html
  8. +0 −13 mingus/templates/blog/includes/_post_detail.html
  9. 0  mingus/templates/blog/includes/{_comments.html → comments.html}
  10. +4 −4 mingus/templates/blog/includes/{_pagination.html → pagination.html}
  11. +13 −0 mingus/templates/blog/includes/post_detail.html
  12. 0  mingus/templates/blog/includes/{_post_list.html → post_list.html}
  13. +6 −6 mingus/templates/blog/post_detail.html
  14. +7 −7 mingus/templates/blog/post_search.html
  15. +6 −6 mingus/templates/blog/tag_detail.html
  16. +18 −18 mingus/templates/contact_form/contact_form.html
  17. +4 −4 mingus/templates/contact_form/contact_form_sent.html
  18. +1 −1  mingus/templates/feeds/categories_description.html
  19. +1 −2  mingus/templates/feeds/posts_description.html
  20. +0 −27 mingus/templates/people/quote_detail.html
  21. 0  mingus/templates/proxy/includes/{_bookmark_item.html → bookmark_item.html}
  22. 0  mingus/templates/proxy/includes/{_post_item.html → post_item.html}
  23. 0  mingus/templates/proxy/includes/{_quote_item.html → quote_item.html}
  24. +11 −11 mingus/templates/proxy/proxy_list.html
  25. 0  mingus/templates/quotes/includes/{_quote.html → quote.html}
  26. +3 −3 mingus/templates/quotes/quote_detail.html
  27. +3 −3 mingus/templates/quotes/quote_list.html
  28. +100 −0 mingus/tests.py
  29. +2 −2 setup.py
View
8 AUTHORS
@@ -0,0 +1,8 @@
+Authors
+-------
+* All the authors behind the terrific reusable apps mingus leverages
+* Kevin Fricovsky (montylounge)
+
+Contributors
+------------
+* Jannie Leidel (jezdez)
View
26 mingus/core/views.py
@@ -7,7 +7,6 @@
from django.template import loader, Context
from django_proxy.models import Proxy
from django.views.generic import list_detail
-from django.core.cache import cache
from basic.blog.models import Settings
from view_cache_utils import cache_page_with_prefix
from contact_form.views import contact_form as django_contact_form
@@ -15,13 +14,20 @@
from honeypot.decorators import check_honeypot
def page_key_prefix(request):
+ '''Used by cache_page_with_prefix to create a cache key prefix.'''
return request.GET.get('page','')
+
+def build_url(domainname):
+ '''Given a domain name (ex mywebsite.com) it returns the full url.'''
+ return 'http://%s' % domainname
+
+
def post_result_item(post):
'''Generates the item result object for django-springsteen integration.'''
return {
'title': post.title,
- 'url': settings.SITE_URL + post.get_absolute_url(),
+ 'url': build_url(Settings.get_current().site.domain) + post.get_absolute_url(),
'text': post.body,
}
@@ -48,7 +54,6 @@ def server_error(request, template_name='500.html'):
"STATIC_URL": settings.STATIC_URL,
})))
-
def springsteen_firehose(request):
'''Generates django-springsteen compliant JSON results of proxy models for findjango integration.'''
@@ -58,7 +63,7 @@ def result_item(proxy):
if proxy.content_type.name == 'bookmark':
url = proxy.content_object.get_absolute_url()
else:
- url = settings.SITE_URL + proxy.content_object.get_absolute_url()
+ url = build_url(Settings.get_current().site.domain) + proxy.content_object.get_absolute_url()
return {
'title': proxy.title,
@@ -66,7 +71,7 @@ def result_item(proxy):
'text': proxy.description,
}
- posts = Proxy.objects.published()[:50].order_by('-pub_date')
+ posts = Proxy.objects.published().order_by('-pub_date')[:50]
results = [ result_item(item) for item in posts ]
response_dict = { 'total_results': Proxy.objects.published().count(), 'results': results, }
return HttpResponse(simplejson.dumps(response_dict), mimetype='application/javascript')
@@ -148,5 +153,16 @@ def quote_detail(request, template_name='quotes/quote_detail.html', **kwargs):
def contact_form(request, form_class=ContactForm,
template_name='contact_form/contact_form.html'):
+ '''
+ Handles the contact form view. Leverages django-contact-form.
+
+ This is an example of overriding another reusable apps view. This particular
+ view also contains a form. For this example we are just doing the basic
+ implementation by wrapping the view function and simply passing the
+ arguments along.
+
+ This view is also leveraging another reusable app, django-honeypot. The
+ decorator you see being applied is used to protect your app from spam.
+ '''
return django_contact_form(request, form_class=form_class,
template_name=template_name)
View
34 mingus/fixtures/initial_data.json
@@ -0,0 +1,34 @@
+[
+
+{"pk": 1, "model":"flatblocks.flatblock", "fields": {"content": "Powered by <a href=\"http://github.com/montylounge/django-mingus/tree/master\" title=\"Mingus blog engine\">Django-Mingus</a> a <a href=\"http://djangoproject.com\" title=\"Django - web framework for perfectionists with deadlines.\">Django</a> project. You're enjoying the Basic theme.", "header": "", "slug": "footer"}},
+
+{"pk": 1, "model": "blog.category", "fields": {"slug": "django", "title": "Django"}},
+
+{"pk": 1, "model": "blog.post", "fields": {"body": "Welcome to django-mingus powered blog engine.", "status": 2, "allow_comments": true, "author": null, "markup": "markdown", "tease": "Hello world.", "modified": "2009-08-23 23:51:31", "publish": "2009-08-23 23:49:32", "created": "2009-08-23 23:51:31", "body_markup": "<p>Welcome to django-mingus powered blog engine.\n</p>", "categories": [1], "title": "Welcome to Mingus", "slug": "welcome-mingus", "tags": "django, django-mingus, blog"}},
+
+{"pk": 2, "model": "blog.post", "fields": {"body": "<p>\r\nSometimes you just <em>need</em> some Mingus to get you movin' along.\r\n</p>\r\n\r\n<p>\r\nhttp://www.youtube.com/watch?v=__OSyznVDOY&feature=related\r\n</p>\r\n\r\n", "status": 2, "allow_comments": true, "author": null, "markup": "none", "tease": "A classic song from the \"The Angry Man of Jazz\", Charles Mingus.", "modified": "2009-09-03 22:23:47", "publish": "2009-09-03 22:19:19", "created": "2009-09-03 22:21:44", "body_markup": "<p>\r\nSometimes you just <em>need</em> some Mingus to get you movin' along.\r\n</p>\r\n\r\n<p>\r\nhttp://www.youtube.com/watch?v=__OSyznVDOY&feature=related\r\n</p>\r\n\r\n", "categories": [1], "title": "Charles Mingus -Moanin", "slug": "charles-mingus-moanin", "tags": "mingus, jazz"}},
+
+{"pk": 3, "model": "blog.post", "fields": {"body": "I'm a huge fan of this Erich Holscher [djangosnippet](http://ericholscher.com/blog/2008/nov/15/debugging-django-production-environments/) which is included in [django-sugar](http://github.com/montylounge/django-sugar/tree/master). This middleware allows you to easily debug your django app whether you're an admin user or your machine's IP is listed in settings.py INTERNAL_IPS tuple. Here is is in its entirety below.\r\n\r\n<code>\r\nfrom django.views.debug import technical_500_response\r\nimport sys\r\nfrom django.conf import settings\r\nclass UserBasedExceptionMiddleware(object):\r\n def process_exception(self, request, exception):\r\n if request.user.is_superuser or request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS:\r\n return technical_500_response(request, *sys.exc_info())\r\n</code>", "status": 2, "allow_comments": true, "author": null, "markup": "markdown", "tease": "Ever wanted to view the verbose Django error page when you're live app is executing with DEBUG=False?", "modified": "2009-09-03 22:54:04", "publish": "2009-09-03 22:46:32", "created": "2009-09-03 22:51:08", "body_markup": "<p>I'm a huge fan of this Erich Holscher <a href=\"http://ericholscher.com/blog/2008/nov/15/debugging-django-production-environments/\">djangosnippet</a> which is included in <a href=\"http://github.com/montylounge/django-sugar/tree/master\">django-sugar</a>. This middleware allows you to easily debug your django app whether you're an admin user or your machine's IP is listed in settings.py INTERNAL_IPS tuple. Here is is in its entirety below.\n</p>\n<p><code>\n from django.views.debug import technical_500_response\n import sys\n from django.conf import settings\n class UserBasedExceptionMiddleware(object):\n def process_exception(self, request, exception):\n if request.user.is_superuser or request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS:\n return technical_500_response(request, *sys.exc_info())\n </code>\n</p>", "categories": [1], "title": "User Based Debug your Django App", "slug": "user-based-debug-your-django-app", "tags": "snippet, debug"}},
+
+{"pk": 1, "model": "bookmarks.bookmark", "fields": {"extended": "", "description": "A must subscribe resource for all things Django.", "created": "2009-09-03 21:58:28", "url": "http://www.djangoproject.com/community/", "title": "Django Community", "modified": "2009-09-03 21:58:28", "slug": "django-community", "tags": "django, community"}},
+
+{"pk": 1, "model": "blog.settings", "fields": {"meta_description": "A blog engine powered by Mingus, a Django project.", "rss_url": "http://127.0.0.1:8000/feeds/latest/", "about": "This is a little bit about myself for the right hand rail.", "meta_keywords": "Blog, blog engine, Django, django-mingus.", "site_name": "example.com", "copyright": "Acme LLC.", "twitter_url": "http://twitter.com/YOURUSERNAME", "ping_google": true, "site": 1, "author_name": "Jane Shmoe", "page_size": 20, "disqus_shortname": "", "email_subscribe_url": ""}},
+
+{"pk": 1, "model": "blog.blogroll", "fields": {"url": "http://blog.montylounge.com/", "sort_order": 0, "name": "Montylounge"}},
+
+{"pk": 1, "model": "elsewhere.socialnetworkprofile", "fields": {"url": "http://github.com/montylounge", "category": 1, "sort_order": 0, "name": "Github", "description": ""}},
+
+{"pk": 1, "model": "elsewhere.category", "fields": {"sort_order": 0, "title": "Development"}},
+
+{"pk": 1, "model": "navbar.navbarentry", "fields": {"name": "about", "parent": null, "title": "about", "url": "/about/", "user_type": "E", "groups": [], "path_type": "A", "order": 0}},
+
+{"pk": 2, "model": "navbar.navbarentry", "fields": {"name": "contact", "parent": null, "title": "contact", "url": "/contact/", "user_type": "E", "groups": [], "path_type": "A", "order": 1}},
+
+{"pk": 1, "model": "robots.url", "fields": {"pattern": "/*"}}, {"pk": 1, "model": "robots.rule", "fields": {"sites": [1], "crawl_delay": null, "robot": "*", "disallowed": [], "allowed": [1]}},
+
+{"pk": 1, "model": "flatpages.flatpage", "fields": {"registration_required": false, "title": "About", "url": "/about/", "template_name": "", "sites": [1], "content": "A little about yourself here.", "enable_comments": false}},
+
+{"pk": 1, "model": "google_analytics.analytics", "fields": {"analytics_code": "PUTYOURCODEHERE", "site": 1}},
+
+]
+
View
1  mingus/models.py
@@ -0,0 +1 @@
+#EMPTY, but required for initial_data to be executed from fixtures directory
View
1  mingus/settings.py
@@ -82,6 +82,7 @@
'honeypot',
'sugar',
'quoteme',
+ 'mingus',
)
try:
View
14 mingus/templates/base.html
@@ -1,4 +1,4 @@
-{% load disqus_tags flatblock_tags cache navbar generic_content blog compress analytics elsewhere feeds %}
+{% load disqus_tags flatblock_tags cache navbar generic_content blog compress analytics elsewhere feeds i18n %}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
@@ -73,7 +73,7 @@
<div id="right-rail" class="grid_6">
- <h4>About</h4>
+ <h4>{% trans "About" %}</h4>
<p>{{ BLOG_SETTINGS.about }}</p>
<h4>Subscribe</h4>
@@ -83,7 +83,7 @@
<li><a href="{{ BLOG_SETTINGS.email_subscribe_url }}" title="Subscribe via Email">Email</a></li>
</ul>
- <h4>Elsewhere</h4>
+ <h4>{% trans "Elsewhere" %}</h4>
<ul>
{% cache 3600 "base.profiles" %}
{% get_elsewhere_profiles as profiles %}
@@ -93,7 +93,7 @@
</ul>
{% endcache %}
- <h4>Categories</h4>
+ <h4>{% trans "Categories" %}</h4>
<ul>
{% cache 3600 "base.category_list" %}
{% get_blog_categories as category_list %}
@@ -105,7 +105,7 @@
{% cache 3600 "base.post_list" %}
{% get_latest_posts 10 as post_list %}
- <h4>Recent Posts</h4>
+ <h4>{% trans "Recent Posts" %}</h4>
<ul class="recent-posts">
{% for post in post_list %}
<li><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></li>
@@ -115,7 +115,7 @@
{% cache 3600 "base.blogroll" %}
{% get_blogroll 10 as blogroll %}
- <h4>BlogRoll</h4>
+ <h4>{% trans "BlogRoll" %}</h4>
<ul class="recent-posts">
{% for item in blogroll %}
<li><a href="{{ item.get_absolute_url }}">{{ item.name }}</a></li>
@@ -125,7 +125,7 @@
{% cache 1800 "delicious.popular" %}
{% parse_feed 'http://feeds.delicious.com/v2/rss/tag/django?count=15' as items %}
- <h4>Django Popular</h4>
+ <h4>{% trans "Django Popular" %}</h4>
<ul class="recent-posts">
{% for item in items.entries %}
<li><a href="{{ item.link }}" title="{{ item.title }}">{{ item.title }}</a></li>
View
14 mingus/templates/blog/category_detail.html
@@ -1,20 +1,20 @@
{% extends "blog/base_blog.html" %}
-{% load cache %}
+{% load cache i18n %}
-{% block title %}Posts for {{ category.title }} | {{ block.super }}{% endblock %}
+{% block title %}{% trans "Posts for" %} {{ category.title }} | {{ block.super }}{% endblock %}
{% block body_class %}{{ block.super }} category_detail{% endblock %}
{% block body_id %}category_{{ category.id }}{% endblock %}
{% block content %}
-<h2 class="filter-title">Posts for {{ category.title }}</h2>
+<h2 class="filter-title">{% trans "Posts for" %} {{ category.title }}</h2>
- <div class="post_list">
- {% cache 3600 "blog.category_detail.object_list" category.title %}
+ <div class="post_list">
+ {% cache 3600 "blog.category_detail.object_list" category.title %}
{% for post in object_list %}
- {% include "blog/includes/_post_list.html" %}
+ {% include "blog/includes/post_list.html" %}
{% endfor %}
- {% endcache %}
+ {% endcache %}
</div>
{% endblock %}
View
13 mingus/templates/blog/includes/_post_detail.html
@@ -1,13 +0,0 @@
-{% load blog tagging_tags inlines oembed_tags %}
-
-<div class="post clearfix">
- <div class="date">{{ post.publish|date:"M d" }}</div>
- <h2><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h2>
- <p class="teaser">{{ post.tease|safe }}</p>
- <div class="body">
- {% oembed %}
- {{ post.body_markup|render_inlines }}
- {% endoembed %}
- </div>
-</div>
-<!-- post -->
View
0  ...us/templates/blog/includes/_comments.html → mingus/templates/blog/includes/comments.html
File renamed without changes
View
8 .../templates/blog/includes/_pagination.html → ...s/templates/blog/includes/pagination.html
@@ -1,12 +1,12 @@
<div id="pagination">
{% if has_next %}
- <p class="older">
+ <p class="older">
<a class="older" href="?page={{ next }}">Older posts &raquo;</a>
- </p>
+ </p>
{% endif %}
{% if has_previous %}
- <p class="newew">
+ <p class="newew">
<a class="newer" href="?page={{ previous }}">&laquo; Newer posts</a>
- </p>
+ </p>
{% endif %}
</div>
View
13 mingus/templates/blog/includes/post_detail.html
@@ -0,0 +1,13 @@
+{% load blog tagging_tags inlines oembed_tags %}
+
+<div class="post clearfix">
+ <div class="date">{{ post.publish|date:"M d" }}</div>
+ <h2><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h2>
+ <p class="teaser">{{ post.tease|safe }}</p>
+ <div class="body">
+ {% oembed %}
+ {{ post.body_markup|render_inlines }}
+ {% endoembed %}
+ </div>
+</div>
+<!-- post -->
View
0  ...s/templates/blog/includes/_post_list.html → ...us/templates/blog/includes/post_list.html
File renamed without changes
View
12 mingus/templates/blog/post_detail.html
@@ -1,5 +1,5 @@
{% extends "blog/base_blog.html" %}
-{% load blog tagging_tags inlines cache pygment_tags oembed_tags %}
+{% load blog tagging_tags inlines cache pygment_tags oembed_tags i18n %}
{% block title %}{{ object.title }} | {{ block.super }}{% endblock %}
@@ -51,14 +51,14 @@
<div class="subscribe clearfix">
<ul>
- <li><a href="http://twitter.com/?status=reading: {{ object.title }} - {{ SITE_URL }}{{ object.get_absolute_url }}" target="_blank">Twitter this</a></li>
- <li><a href="http://www.reddit.com/r/programming/submit">Reddit this</a></li>
- <li><a href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;">Add to Delicious</a></li>
- <li><a href="{{ FEED_SUBSCRIBE_RSS }}">Subscribe RSS</a></li>
+ <li><a href="http://twitter.com/?status=reading: {{ object.title }} - {{ SITE_URL }}{{ object.get_absolute_url }}" target="_blank">{% trans "Twitter this" %}</a></li>
+ <li><a href="http://www.reddit.com/r/programming/submit">{% trans "Reddit this" %}</a></li>
+ <li><a href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;">{% trans "Add to Delicious" %}</a></li>
+ <li><a href="{{ FEED_SUBSCRIBE_RSS }}">{% trans "Subscribe RSS" %}</a></li>
</ul>
</div>
<!-- post -->
-{% include "blog/includes/_comments.html" %}
+{% include "blog/includes/comments.html" %}
{% endblock %}
View
14 mingus/templates/blog/post_search.html
@@ -1,25 +1,25 @@
{% extends "blog/base_blog.html" %}
-{% load cache %}
+{% load cache i18n %}
-{% block title %}Search results for: {{ search_term }} | {{ block.super }}{% endblock %}
+{% block title %}{% trans "Search results for:" %} {{ search_term }} | {{ block.super }}{% endblock %}
{% block body_class %}{{ block.super }} post_search{% endblock %}
{% block content %}
- <h2 class="filter-title">Search results for: {{ search_term }}</h2>
+ <h2 class="filter-title">{% trans "Search results for:" %} {{ search_term }}</h2>
{% if message %}
<p class="message">{{ message }}</p>
{% endif %}
-
+
{% if object_list %}
<div class="post_list">
- {% cache 3600 "blog.post_search.object_list" search_term %}
+ {% cache 3600 "blog.post_search.object_list" search_term %}
{% for post in object_list %}
- {% include "blog/includes/_post_detail.html" %}
+ {% include "blog/includes/post_detail.html" %}
{% endfor %}
- {% endcache %}
+ {% endcache %}
</div>
{% endif %}
{% endblock %}
View
12 mingus/templates/blog/tag_detail.html
@@ -1,19 +1,19 @@
{% extends "blog/base_blog.html" %}
-{% load cache %}
+{% load cache i18n %}
-{% block title %}Posts for {{ tag.name }} | {{ block.super }}{% endblock %}
+{% block title %}{% trans "Posts for" %} {{ tag.name }} | {{ block.super }}{% endblock %}
{% block body_class %}{{ block.super }} tag_detail{% endblock %}
{% block body_id %}tag_{{ tag.id }}{% endblock %}
{% block content %}
-<h2 class="filter-title">Posts tagged: {{ tag.name }}</h2>
+<h2 class="filter-title">{% trans "Posts tagged:" %} {{ tag.name }}</h2>
<div class="post_list">
- {% cache 3600 "blog.tag_detail.object_list" tag.name %}
+ {% cache 3600 "blog.tag_detail.object_list" tag.name %}
{% for post in object_list %}
- {% include "blog/includes/_post_list.html" %}
+ {% include "blog/includes/post_list.html" %}
{% endfor %}
- {% endcache %}
+ {% endcache %}
</div>
{% endblock %}
View
36 mingus/templates/contact_form/contact_form.html
@@ -1,25 +1,25 @@
{% extends "blog/base_blog.html" %}
-{% load honeypot %}
+{% load honeypot i18n %}
{% block content %}
-<h2>Contact me</h2>
-
-<p>Get in touch.</p>
-
-<form method="POST" action=".">
-
- {% if form.errors %}
- <div id="form-error">
- <p>Woops, looks like you forgot some information.</p>
- <ul>
- {% for field in form %}
- {% if field.errors %}<li>{{ field.label }} - {{ field.errors|striptags }}</li>{% endif %}
- {% endfor %}
- </ul>
- </div>
- {% endif %}
-
+<h2>{% "Contact me" %}</h2>
+
+<p>{% trans "Get in touch." %}</p>
+
+<form method="POST" action=".">
+
+ {% if form.errors %}
+ <div id="form-error">
+ <p>{% trans "Woops, looks like you forgot some information." %}</p>
+ <ul>
+ {% for field in form %}
+ {% if field.errors %}<li>{{ field.label }} - {{ field.errors|striptags }}</li>{% endif %}
+ {% endfor %}
+ </ul>
+ </div>
+ {% endif %}
+
<p>
<label for="form.name.label">{{ form.name.label }}</label>
{{ form.name }}
View
8 mingus/templates/contact_form/contact_form_sent.html
@@ -1,14 +1,14 @@
{% extends "blog/base_blog.html" %}
-{% load blog %}
+{% load blog i18n %}
{% block content %}
-<h2>Contact me</h2>
+<h2>{% trans "Contact me" %}</h2>
-<p>Thanks! I'll make sure to responsd shortly. In the meantime, check out some of my latest and greatest posts.</p>
+<p>{% trans "Thanks! I'll make sure to responsd shortly. In the meantime, check out some of my latest and greatest posts." %}</p>
{% get_latest_posts 10 as post_list %}
-<h4>Recent Posts</h4>
+<h4>{% trans "Recent Posts" %}</h4>
<ul class="recent-posts">
{% for post in post_list %}
<li><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></li>
View
2  mingus/templates/feeds/categories_description.html
@@ -1 +1 @@
-{{ obj.body|safe }}
+{{ obj.body_markup|safe }}
View
3  mingus/templates/feeds/posts_description.html
@@ -1,2 +1 @@
-{% load markup %}
-{{ obj.body|markdown }}
+{{ obj.body_markup|safe }}
View
27 mingus/templates/people/quote_detail.html
@@ -1,27 +0,0 @@
-{% extends "base.html" %}
-
-{% block title %}{{ block.super }} | {{ object.title }}{% endblock %}
-{% block body_class %}{{ block.super }} quote_detail{% endblock %}
-
-{% block content_title %}{% endblock %}
-
-{% block content %}
-
-<div class="post clearfix">
- <div class="date">{{ object.publish|date:"M d" }}</div>
- <h2>{{ object.title }}</h2>
- <div class="body">
- <blockquote class="quote">
- {{ object.quote|safe }}
- <p class="source">&mdash; {{ object.source }}<p>
- </blockquote>
- </div>
-</div>
-<!-- post -->
-
-
-
-{% include "blog/includes/_comments.html" %}
-
-{% endblock %}
-
View
0  ...plates/proxy/includes/_bookmark_item.html → ...mplates/proxy/includes/bookmark_item.html
File renamed without changes
View
0  .../templates/proxy/includes/_post_item.html → ...s/templates/proxy/includes/post_item.html
File renamed without changes
View
0  ...templates/proxy/includes/_quote_item.html → .../templates/proxy/includes/quote_item.html
File renamed without changes
View
22 mingus/templates/proxy/proxy_list.html
@@ -9,19 +9,19 @@
{% block content %}
<div class="post_list">
{% for object in object_list %}
- {% ifequal object.content_type.name "post" %}
- {% include "proxy/includes/_post_item.html" %}
- {% endifequal %}
- {% ifequal object.content_type.name "quote" %}
- {% include "proxy/includes/_quote_item.html" %}
- {% endifequal %}
- {% ifequal object.content_type.name "bookmark" %}
- {% include "proxy/includes/_bookmark_item.html" %}
- {% endifequal %}
+ {% ifequal object.content_type.name "post" %}
+ {% include "proxy/includes/post_item.html" %}
+ {% endifequal %}
+ {% ifequal object.content_type.name "quote" %}
+ {% include "proxy/includes/quote_item.html" %}
+ {% endifequal %}
+ {% ifequal object.content_type.name "bookmark" %}
+ {% include "proxy/includes/bookmark_item.html" %}
+ {% endifequal %}
{% endfor %}
</div>
-
+
{% if is_paginated %}
- {% include "blog/includes/_pagination.html" %}
+ {% include "blog/includes/pagination.html" %}
{% endif %}
{% endblock %}
View
0  mingus/templates/quotes/includes/_quote.html → mingus/templates/quotes/includes/quote.html
File renamed without changes
View
6 mingus/templates/quotes/quote_detail.html
@@ -1,9 +1,9 @@
{% extends "base.html" %}
-{% load cache %}
+{% load cache i18n %}
{% block content %}
-<p>Quick fact, my favorite food is {{ favorite_food }}.</p>
+<p>{% trans "Quick fact, my favorite food is" %} {{ favorite_food }}.</p>
<h2>{{ object.title }}</h2>
@@ -27,6 +27,6 @@
</div>
{% endcache %}
-{% include "blog/includes/_comments.html" %}
+{% include "blog/includes/comments.html" %}
{% endblock %}
View
6 mingus/templates/quotes/quote_list.html
@@ -1,11 +1,11 @@
{% extends "base.html" %}
-{% load cache %}
+{% load cache i18n %}
{% block content %}
-<h2>Quotes</h2>
+<h2>{% trans "Quotes" %}</h2>
-A little side note, my favorite jazz album is {{ favorite_jazz_album }}.
+{% trans "A little side note, my favorite jazz album is" %} {{ favorite_jazz_album }}.
{% cache 180 "quote.quote_list" %}
{% for object in object_list %}
View
100 mingus/tests.py
@@ -0,0 +1,100 @@
+from django.test.client import Client
+import unittest
+
+
+class MingusClientTests(unittest.TestCase):
+ fixtures = ['mammals.json', 'birds']
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+
+ def test_HomePage(self):
+ '''Test if the homepage renders.'''
+ c = Client()
+ response = c.get('/')
+ self.failUnlessEqual(response.status_code, 200)
+
+ def test_About(self):
+ 'Test if the about page renders.'
+ c = Client()
+ response = c.get('/about/')
+ self.failUnlessEqual(response.status_code, 200)
+
+ def test_Contact(self):
+ 'Test if the contact page renders.'
+ c = Client()
+ response = c.get('/contact/')
+
+ self.failUnlessEqual(response.status_code, 200)
+
+ def test_ContactSubmit(self):
+ '''Test submitting the contact form. Expect to return to the form sent template.
+
+ The field 'fonzie_kungfu' is the honeypot field to protect you from
+ spam. This feature is provided by django-honeypot.
+
+ '''
+ c = Client()
+ response = c.post('/contact/', {'name': 'charles', 'email': 'foo@foo.com',
+ 'body': 'hello.', 'fonzie_kungfu': ''},
+ follow=True)
+ self.failUnlessEqual(response.status_code, 200)
+ self.assertEquals(response.template[0].name, 'contact_form/contact_form_sent.html')
+
+
+ def test_ContactSubmit_WithHoneyPot(self):
+ '''Test the @honeypot decorator which exists to reduce spam.
+
+ HoneyPot will return a 400 response if the honeypot field is
+ submited with a value.
+
+ '''
+ c = Client()
+ response = c.post('/contact/', {'name': 'charles', 'email':
+ 'foo@foo.com', 'body': 'hello.', 'fonzie_kungfu': 'evil'},
+ follow=True)
+ self.failUnlessEqual(response.status_code, 400)
+
+
+ def test_QuoteList(self):
+ '''Test quote list page renders.'''
+
+ c = Client()
+ response = c.get('/quotes/')
+ self.failUnlessEqual(response.status_code, 200)
+
+ def test_QuoteDetail(self):
+ '''Test quote list page renders.'''
+
+ from quoteme.models import Quote
+
+ quote = Quote.objects.get()
+
+ c = Client()
+ response = c.get(quote.get_absolute_url())
+ self.failUnlessEqual(response.status_code, 200)
+
+
+ def test_RSS(self):
+ '''Test the latest posts feed displays.'''
+
+ c = Client()
+ response = c.get('/feeds/latest/')
+ self.failUnlessEqual(response.status_code, 200)
+
+ def test_SpringsteenFeed(self):
+ '''Test the latest springsteen feed for findjango integration displays.'''
+
+ c = Client()
+ response = c.get('/api/springsteen/posts/')
+ self.failUnlessEqual(response.status_code, 200)
+
+
+
+
+
+
View
4 setup.py
@@ -2,7 +2,7 @@
setup(
name='django-mingus',
- version='0.3.2',
+ version='0.4',
description='A django blog engine.',
author='Kevin Fricovsky',
author_email='kfricovsky@gmail.com',
@@ -13,7 +13,7 @@
'mingus.core',
],
classifiers=[
- 'Development Status :: 3 - Alpha',
+ 'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
Please sign in to comment.
Something went wrong with that request. Please try again.