Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…elease
  • Loading branch information...
commit 9a8dae98a0b3963ce9812cd4567878c61ab3bd61 1 parent fbab264
kevin authored September 07, 2009

Showing 29 changed files with 258 additions and 126 deletions. Show diff stats Hide diff stats

  1. 8  AUTHORS
  2. 26  mingus/core/views.py
  3. 34  mingus/fixtures/initial_data.json
  4. 1  mingus/models.py
  5. 1  mingus/settings.py
  6. 14  mingus/templates/base.html
  7. 14  mingus/templates/blog/category_detail.html
  8. 13  mingus/templates/blog/includes/_post_detail.html
  9. 0  mingus/templates/blog/includes/{_comments.html → comments.html}
  10. 8  mingus/templates/blog/includes/{_pagination.html → pagination.html}
  11. 13  mingus/templates/blog/includes/post_detail.html
  12. 0  mingus/templates/blog/includes/{_post_list.html → post_list.html}
  13. 12  mingus/templates/blog/post_detail.html
  14. 14  mingus/templates/blog/post_search.html
  15. 12  mingus/templates/blog/tag_detail.html
  16. 36  mingus/templates/contact_form/contact_form.html
  17. 8  mingus/templates/contact_form/contact_form_sent.html
  18. 2  mingus/templates/feeds/categories_description.html
  19. 3  mingus/templates/feeds/posts_description.html
  20. 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. 22  mingus/templates/proxy/proxy_list.html
  25. 0  mingus/templates/quotes/includes/{_quote.html → quote.html}
  26. 6  mingus/templates/quotes/quote_detail.html
  27. 6  mingus/templates/quotes/quote_list.html
  28. 100  mingus/tests.py
  29. 4  setup.py
8  AUTHORS
... ...
@@ -0,0 +1,8 @@
  1
+Authors
  2
+-------
  3
+* All the authors behind the terrific reusable apps mingus leverages
  4
+* Kevin Fricovsky (montylounge)
  5
+
  6
+Contributors
  7
+------------
  8
+* Jannie Leidel (jezdez)
26  mingus/core/views.py
@@ -7,7 +7,6 @@
7 7
 from django.template import loader, Context
8 8
 from django_proxy.models import Proxy
9 9
 from django.views.generic import list_detail
10  
-from django.core.cache import cache
11 10
 from basic.blog.models import Settings
12 11
 from view_cache_utils import cache_page_with_prefix
13 12
 from contact_form.views import contact_form as django_contact_form
@@ -15,13 +14,20 @@
15 14
 from honeypot.decorators import check_honeypot
16 15
 
17 16
 def page_key_prefix(request):
  17
+    '''Used by cache_page_with_prefix to create a cache key prefix.'''
18 18
     return request.GET.get('page','')
19 19
 
  20
+
  21
+def build_url(domainname):
  22
+    '''Given a domain name (ex mywebsite.com) it returns the full url.'''
  23
+    return 'http://%s' % domainname
  24
+
  25
+
20 26
 def post_result_item(post):
21 27
     '''Generates the item result object for django-springsteen integration.'''
22 28
     return {
23 29
         'title': post.title,
24  
-        'url': settings.SITE_URL + post.get_absolute_url(),
  30
+        'url': build_url(Settings.get_current().site.domain) + post.get_absolute_url(),
25 31
         'text': post.body,
26 32
         }
27 33
 
@@ -48,7 +54,6 @@ def server_error(request, template_name='500.html'):
48 54
         "STATIC_URL": settings.STATIC_URL,
49 55
     })))
50 56
 
51  
-
52 57
 def springsteen_firehose(request):
53 58
     '''Generates django-springsteen compliant JSON results of proxy models for findjango integration.'''
54 59
 
@@ -58,7 +63,7 @@ def result_item(proxy):
58 63
         if proxy.content_type.name == 'bookmark':
59 64
             url = proxy.content_object.get_absolute_url()
60 65
         else:
61  
-            url = settings.SITE_URL + proxy.content_object.get_absolute_url()
  66
+            url = build_url(Settings.get_current().site.domain) + proxy.content_object.get_absolute_url()
62 67
 
63 68
         return {
64 69
             'title': proxy.title,
@@ -66,7 +71,7 @@ def result_item(proxy):
66 71
             'text': proxy.description,
67 72
             }
68 73
 
69  
-    posts = Proxy.objects.published()[:50].order_by('-pub_date')
  74
+    posts = Proxy.objects.published().order_by('-pub_date')[:50]
70 75
     results = [ result_item(item) for item in posts ]
71 76
     response_dict = { 'total_results': Proxy.objects.published().count(), 'results': results, }
72 77
     return HttpResponse(simplejson.dumps(response_dict), mimetype='application/javascript')
@@ -148,5 +153,16 @@ def quote_detail(request, template_name='quotes/quote_detail.html', **kwargs):
148 153
 def contact_form(request, form_class=ContactForm,
149 154
                  template_name='contact_form/contact_form.html'):
150 155
 
  156
+    '''
  157
+    Handles the contact form view. Leverages django-contact-form.
  158
+
  159
+    This is an example of overriding another reusable apps view. This particular
  160
+    view also contains a form. For this example we are just doing the basic
  161
+    implementation by wrapping the view function and simply passing the
  162
+    arguments along.
  163
+
  164
+    This view is also leveraging another reusable app, django-honeypot. The
  165
+    decorator you see being applied is used to protect your app from spam.
  166
+    '''
151 167
     return django_contact_form(request, form_class=form_class,
152 168
                  template_name=template_name)
34  mingus/fixtures/initial_data.json
... ...
@@ -0,0 +1,34 @@
  1
+[
  2
+
  3
+{"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"}},
  4
+
  5
+{"pk": 1, "model": "blog.category", "fields": {"slug": "django", "title": "Django"}},
  6
+
  7
+{"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"}},
  8
+
  9
+{"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"}},
  10
+
  11
+{"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"}},
  12
+
  13
+{"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"}},
  14
+
  15
+{"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": ""}},
  16
+
  17
+{"pk": 1, "model": "blog.blogroll", "fields": {"url": "http://blog.montylounge.com/", "sort_order": 0, "name": "Montylounge"}},
  18
+
  19
+{"pk": 1, "model": "elsewhere.socialnetworkprofile", "fields": {"url": "http://github.com/montylounge", "category": 1, "sort_order": 0, "name": "Github", "description": ""}},
  20
+
  21
+{"pk": 1, "model": "elsewhere.category", "fields": {"sort_order": 0, "title": "Development"}},
  22
+
  23
+{"pk": 1, "model": "navbar.navbarentry", "fields": {"name": "about", "parent": null, "title": "about", "url": "/about/", "user_type": "E", "groups": [], "path_type": "A", "order": 0}},
  24
+
  25
+{"pk": 2, "model": "navbar.navbarentry", "fields": {"name": "contact", "parent": null, "title": "contact", "url": "/contact/", "user_type": "E", "groups": [], "path_type": "A", "order": 1}},
  26
+
  27
+{"pk": 1, "model": "robots.url", "fields": {"pattern": "/*"}}, {"pk": 1, "model": "robots.rule", "fields": {"sites": [1], "crawl_delay": null, "robot": "*", "disallowed": [], "allowed": [1]}},
  28
+
  29
+{"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}},
  30
+
  31
+{"pk": 1, "model": "google_analytics.analytics", "fields": {"analytics_code": "PUTYOURCODEHERE", "site": 1}},
  32
+
  33
+]
  34
+
1  mingus/models.py
... ...
@@ -0,0 +1 @@
  1
+#EMPTY, but required for initial_data to be executed from fixtures directory
1  mingus/settings.py
@@ -82,6 +82,7 @@
82 82
   'honeypot',
83 83
   'sugar',
84 84
   'quoteme',
  85
+  'mingus',
85 86
 )
86 87
 
87 88
 try:
14  mingus/templates/base.html
... ...
@@ -1,4 +1,4 @@
1  
-{% load disqus_tags flatblock_tags cache navbar generic_content blog compress analytics elsewhere feeds %}
  1
+{% load disqus_tags flatblock_tags cache navbar generic_content blog compress analytics elsewhere feeds i18n %}
2 2
 
3 3
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
4 4
    "http://www.w3.org/TR/html4/strict.dtd">
@@ -73,7 +73,7 @@
73 73
 
74 74
     <div id="right-rail" class="grid_6">
75 75
 
76  
-      <h4>About</h4>
  76
+      <h4>{% trans "About" %}</h4>
77 77
       <p>{{ BLOG_SETTINGS.about }}</p>
78 78
 
79 79
       <h4>Subscribe</h4>
@@ -83,7 +83,7 @@
83 83
         <li><a href="{{ BLOG_SETTINGS.email_subscribe_url }}" title="Subscribe via Email">Email</a></li>
84 84
       </ul>
85 85
 
86  
-      <h4>Elsewhere</h4>
  86
+      <h4>{% trans "Elsewhere" %}</h4>
87 87
       <ul>
88 88
         {% cache 3600 "base.profiles" %}
89 89
         {% get_elsewhere_profiles as profiles %}
@@ -93,7 +93,7 @@
93 93
       </ul>
94 94
       {% endcache %}
95 95
 
96  
-      <h4>Categories</h4>
  96
+      <h4>{% trans "Categories" %}</h4>
97 97
       <ul>
98 98
       {% cache 3600 "base.category_list" %}
99 99
         {% get_blog_categories as category_list %}
@@ -105,7 +105,7 @@
105 105
 
106 106
       {% cache 3600 "base.post_list" %}
107 107
       {% get_latest_posts 10 as post_list %}
108  
-      <h4>Recent Posts</h4>
  108
+      <h4>{% trans "Recent Posts" %}</h4>
109 109
       <ul class="recent-posts">
110 110
       {% for post in post_list %}
111 111
       <li><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></li>
@@ -115,7 +115,7 @@
115 115
 
116 116
       {% cache 3600 "base.blogroll" %}
117 117
       {% get_blogroll 10 as blogroll %}
118  
-      <h4>BlogRoll</h4>
  118
+      <h4>{% trans "BlogRoll" %}</h4>
119 119
       <ul class="recent-posts">
120 120
       {% for item in blogroll %}
121 121
       <li><a href="{{ item.get_absolute_url }}">{{ item.name }}</a></li>
@@ -125,7 +125,7 @@
125 125
 
126 126
       {% cache 1800 "delicious.popular" %}
127 127
       {% parse_feed 'http://feeds.delicious.com/v2/rss/tag/django?count=15' as items %}
128  
-      <h4>Django Popular</h4>
  128
+      <h4>{% trans "Django Popular" %}</h4>
129 129
       <ul class="recent-posts">
130 130
       {% for item in items.entries %}
131 131
       <li><a href="{{ item.link }}" title="{{ item.title }}">{{ item.title }}</a></li>
14  mingus/templates/blog/category_detail.html
... ...
@@ -1,20 +1,20 @@
1 1
 {% extends "blog/base_blog.html" %}
2  
-{% load cache %}
  2
+{% load cache i18n %}
3 3
 
4 4
 
5  
-{% block title %}Posts for {{ category.title }} | {{ block.super }}{% endblock %}
  5
+{% block title %}{% trans "Posts for" %} {{ category.title }} | {{ block.super }}{% endblock %}
6 6
 {% block body_class %}{{ block.super }} category_detail{% endblock %}
7 7
 {% block body_id %}category_{{ category.id }}{% endblock %}
8 8
 
9 9
 {% block content %}
10 10
 
11  
-<h2 class="filter-title">Posts for {{ category.title }}</h2>
  11
+<h2 class="filter-title">{% trans "Posts for" %} {{ category.title }}</h2>
12 12
 
13  
-  <div class="post_list">	
14  
-	{% cache 3600 "blog.category_detail.object_list" category.title %}
  13
+  <div class="post_list">
  14
+  {% cache 3600 "blog.category_detail.object_list" category.title %}
15 15
     {% for post in object_list %}
16  
-	{% include "blog/includes/_post_list.html" %}
  16
+  {% include "blog/includes/post_list.html" %}
17 17
     {% endfor %}
18  
-	{% endcache %}
  18
+  {% endcache %}
19 19
   </div>
20 20
 {% endblock %}
13  mingus/templates/blog/includes/_post_detail.html
... ...
@@ -1,13 +0,0 @@
1  
-{% load blog tagging_tags inlines oembed_tags %}
2  
-
3  
-<div class="post clearfix">
4  
-	<div class="date">{{ post.publish|date:"M d" }}</div>
5  
-	<h2><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h2>
6  
-	<p class="teaser">{{ post.tease|safe }}</p>
7  
-  	<div class="body">
8  
-	{% oembed %}
9  
-    {{ post.body_markup|render_inlines }}
10  
-	{% endoembed %}
11  
-  	</div>
12  
-</div>
13  
-<!-- post -->
0  mingus/templates/blog/includes/_comments.html → mingus/templates/blog/includes/comments.html
File renamed without changes
8  mingus/templates/blog/includes/_pagination.html → mingus/templates/blog/includes/pagination.html
... ...
@@ -1,12 +1,12 @@
1 1
 <div id="pagination">
2 2
   {% if has_next %}
3  
-	<p class="older">
  3
+  <p class="older">
4 4
   <a class="older" href="?page={{ next }}">Older posts &raquo;</a>
5  
-	</p>
  5
+  </p>
6 6
   {% endif %}
7 7
   {% if has_previous %}
8  
-	<p class="newew">
  8
+  <p class="newew">
9 9
   <a class="newer" href="?page={{ previous }}">&laquo; Newer posts</a>
10  
-	</p>
  10
+  </p>
11 11
   {% endif %}
12 12
 </div>
13  mingus/templates/blog/includes/post_detail.html
... ...
@@ -0,0 +1,13 @@
  1
+{% load blog tagging_tags inlines oembed_tags %}
  2
+
  3
+<div class="post clearfix">
  4
+  <div class="date">{{ post.publish|date:"M d" }}</div>
  5
+  <h2><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h2>
  6
+  <p class="teaser">{{ post.tease|safe }}</p>
  7
+    <div class="body">
  8
+  {% oembed %}
  9
+    {{ post.body_markup|render_inlines }}
  10
+  {% endoembed %}
  11
+    </div>
  12
+</div>
  13
+<!-- post -->
0  mingus/templates/blog/includes/_post_list.html → mingus/templates/blog/includes/post_list.html
File renamed without changes
12  mingus/templates/blog/post_detail.html
... ...
@@ -1,5 +1,5 @@
1 1
 {% extends "blog/base_blog.html" %}
2  
-{% load blog tagging_tags inlines cache pygment_tags oembed_tags %}
  2
+{% load blog tagging_tags inlines cache pygment_tags oembed_tags i18n %}
3 3
 
4 4
 {% block title %}{{ object.title }} | {{ block.super }}{% endblock %}
5 5
 
@@ -51,14 +51,14 @@
51 51
 
52 52
   <div class="subscribe clearfix">
53 53
     <ul>
54  
-      <li><a href="http://twitter.com/?status=reading: {{ object.title }} - {{ SITE_URL }}{{ object.get_absolute_url }}" target="_blank">Twitter this</a></li>
55  
-      <li><a href="http://www.reddit.com/r/programming/submit">Reddit this</a></li>
56  
-      <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>
57  
-      <li><a href="{{ FEED_SUBSCRIBE_RSS }}">Subscribe RSS</a></li>
  54
+      <li><a href="http://twitter.com/?status=reading: {{ object.title }} - {{ SITE_URL }}{{ object.get_absolute_url }}" target="_blank">{% trans "Twitter this" %}</a></li>
  55
+      <li><a href="http://www.reddit.com/r/programming/submit">{% trans "Reddit this" %}</a></li>
  56
+      <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>
  57
+      <li><a href="{{ FEED_SUBSCRIBE_RSS }}">{% trans "Subscribe RSS" %}</a></li>
58 58
     </ul>
59 59
   </div>
60 60
   <!-- post -->
61 61
 
62  
-{% include "blog/includes/_comments.html" %}
  62
+{% include "blog/includes/comments.html" %}
63 63
 
64 64
 {% endblock %}
14  mingus/templates/blog/post_search.html
... ...
@@ -1,25 +1,25 @@
1 1
 {% extends "blog/base_blog.html" %}
2  
-{% load cache %}
  2
+{% load cache i18n %}
3 3
 
4 4
 
5  
-{% block title %}Search results for: {{ search_term }} | {{ block.super }}{% endblock %}
  5
+{% block title %}{% trans "Search results for:" %} {{ search_term }} | {{ block.super }}{% endblock %}
6 6
 {% block body_class %}{{ block.super }} post_search{% endblock %}
7 7
 
8 8
 
9 9
 {% block content %}
10  
-  <h2 class="filter-title">Search results for: {{ search_term }}</h2>
  10
+  <h2 class="filter-title">{% trans "Search results for:" %} {{ search_term }}</h2>
11 11
 
12 12
   {% if message %}
13 13
   <p class="message">{{ message }}</p>
14 14
   {% endif %}
15  
-  
  15
+
16 16
   {% if object_list %}
17 17
   <div class="post_list">
18  
-	{% cache 3600 "blog.post_search.object_list" search_term %}
  18
+  {% cache 3600 "blog.post_search.object_list" search_term %}
19 19
     {% for post in object_list %}
20  
-	{% include "blog/includes/_post_detail.html" %}
  20
+  {% include "blog/includes/post_detail.html" %}
21 21
     {% endfor %}
22  
-	{% endcache %}
  22
+  {% endcache %}
23 23
   </div>
24 24
   {% endif %}
25 25
 {% endblock %}
12  mingus/templates/blog/tag_detail.html
... ...
@@ -1,19 +1,19 @@
1 1
 {% extends "blog/base_blog.html" %}
2  
-{% load cache %}
  2
+{% load cache i18n %}
3 3
 
4  
-{% block title %}Posts for {{ tag.name }} | {{ block.super }}{% endblock %}
  4
+{% block title %}{% trans "Posts for" %} {{ tag.name }} | {{ block.super }}{% endblock %}
5 5
 {% block body_class %}{{ block.super }} tag_detail{% endblock %}
6 6
 {% block body_id %}tag_{{ tag.id }}{% endblock %}
7 7
 
8 8
 {% block content %}
9 9
 
10  
-<h2 class="filter-title">Posts tagged: {{ tag.name }}</h2>
  10
+<h2 class="filter-title">{% trans "Posts tagged:" %} {{ tag.name }}</h2>
11 11
 
12 12
   <div class="post_list">
13  
-	{% cache 3600 "blog.tag_detail.object_list" tag.name %}
  13
+  {% cache 3600 "blog.tag_detail.object_list" tag.name %}
14 14
     {% for post in object_list %}
15  
-	{% include "blog/includes/_post_list.html" %}
  15
+  {% include "blog/includes/post_list.html" %}
16 16
     {% endfor %}
17  
-	{% endcache %}
  17
+  {% endcache %}
18 18
   </div>
19 19
 {% endblock %}
36  mingus/templates/contact_form/contact_form.html
... ...
@@ -1,25 +1,25 @@
1 1
 {% extends "blog/base_blog.html" %}
2  
-{% load honeypot %}
  2
+{% load honeypot i18n %}
3 3
 
4 4
 {% block content %}
5 5
 
6  
-<h2>Contact me</h2>
7  
-
8  
-<p>Get in touch.</p>
9  
-
10  
-<form method="POST" action="."> 
11  
-	
12  
-	{% if form.errors %}
13  
-	<div id="form-error">
14  
-		<p>Woops, looks like you forgot some information.</p>
15  
-		<ul>
16  
-		{% for field in form %}
17  
-		{% if field.errors %}<li>{{ field.label }} - {{ field.errors|striptags }}</li>{% endif %}
18  
-		{% endfor %}
19  
-		</ul>
20  
-	</div>
21  
-	{% endif %}
22  
-	
  6
+<h2>{% "Contact me" %}</h2>
  7
+
  8
+<p>{% trans "Get in touch." %}</p>
  9
+
  10
+<form method="POST" action=".">
  11
+
  12
+  {% if form.errors %}
  13
+  <div id="form-error">
  14
+    <p>{% trans "Woops, looks like you forgot some information." %}</p>
  15
+    <ul>
  16
+    {% for field in form %}
  17
+    {% if field.errors %}<li>{{ field.label }} - {{ field.errors|striptags }}</li>{% endif %}
  18
+    {% endfor %}
  19
+    </ul>
  20
+  </div>
  21
+  {% endif %}
  22
+
23 23
 <p>
24 24
 <label for="form.name.label">{{ form.name.label }}</label>
25 25
 {{ form.name }}
8  mingus/templates/contact_form/contact_form_sent.html
... ...
@@ -1,14 +1,14 @@
1 1
 {% extends "blog/base_blog.html" %}
2  
-{% load blog %}
  2
+{% load blog i18n %}
3 3
 
4 4
 {% block content %}
5 5
 
6  
-<h2>Contact me</h2>
  6
+<h2>{% trans "Contact me" %}</h2>
7 7
 
8  
-<p>Thanks! I'll make sure to responsd shortly. In the meantime, check out some of my latest and greatest posts.</p>
  8
+<p>{% trans "Thanks! I'll make sure to responsd shortly. In the meantime, check out some of my latest and greatest posts." %}</p>
9 9
 
10 10
 {% get_latest_posts 10 as post_list %}
11  
-<h4>Recent Posts</h4>
  11
+<h4>{% trans "Recent Posts" %}</h4>
12 12
 <ul class="recent-posts">
13 13
 {% for post in post_list %}
14 14
 <li><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></li>
2  mingus/templates/feeds/categories_description.html
... ...
@@ -1 +1 @@
1  
-{{ obj.body|safe }}
  1
+{{ obj.body_markup|safe }}
3  mingus/templates/feeds/posts_description.html
... ...
@@ -1,2 +1 @@
1  
-{% load markup %}
2  
-{{ obj.body|markdown }}
  1
+{{ obj.body_markup|safe }}
27  mingus/templates/people/quote_detail.html
... ...
@@ -1,27 +0,0 @@
1  
-{% extends "base.html" %}
2  
-
3  
-{% block title %}{{ block.super }} | {{ object.title }}{% endblock %}
4  
-{% block body_class %}{{ block.super }} quote_detail{% endblock %}
5  
-
6  
-{% block content_title %}{% endblock %}
7  
-
8  
-{% block content %}
9  
-
10  
-<div class="post clearfix">
11  
-	<div class="date">{{ object.publish|date:"M d" }}</div>
12  
-	<h2>{{ object.title }}</h2>
13  
-  	<div class="body">
14  
-	 <blockquote class="quote">
15  
-	   {{ object.quote|safe }}
16  
-	   <p class="source">&mdash; {{ object.source }}<p>
17  
-	 </blockquote>
18  
-  	</div>
19  
-</div>
20  
-<!-- post -->
21  
-
22  
-
23  
-
24  
-{% include "blog/includes/_comments.html" %}
25  
-
26  
-{% endblock %}
27  
-
0  mingus/templates/proxy/includes/_bookmark_item.html → mingus/templates/proxy/includes/bookmark_item.html
File renamed without changes
0  mingus/templates/proxy/includes/_post_item.html → mingus/templates/proxy/includes/post_item.html
File renamed without changes
0  mingus/templates/proxy/includes/_quote_item.html → mingus/templates/proxy/includes/quote_item.html
File renamed without changes
22  mingus/templates/proxy/proxy_list.html
@@ -9,19 +9,19 @@
9 9
 {% block content %}
10 10
   <div class="post_list">
11 11
     {% for object in object_list %}
12  
-		{% ifequal object.content_type.name "post" %}
13  
-			{% include "proxy/includes/_post_item.html" %}
14  
-		{% endifequal %}
15  
-		{% ifequal object.content_type.name "quote" %}
16  
-			{% include "proxy/includes/_quote_item.html" %}
17  
-		{% endifequal %}
18  
-		{% ifequal object.content_type.name "bookmark" %}
19  
-			{% include "proxy/includes/_bookmark_item.html" %}
20  
-		{% endifequal %}
  12
+    {% ifequal object.content_type.name "post" %}
  13
+      {% include "proxy/includes/post_item.html" %}
  14
+    {% endifequal %}
  15
+    {% ifequal object.content_type.name "quote" %}
  16
+      {% include "proxy/includes/quote_item.html" %}
  17
+    {% endifequal %}
  18
+    {% ifequal object.content_type.name "bookmark" %}
  19
+      {% include "proxy/includes/bookmark_item.html" %}
  20
+    {% endifequal %}
21 21
     {% endfor %}
22 22
   </div>
23  
-  
  23
+
24 24
   {% if is_paginated %}
25  
-		{% include "blog/includes/_pagination.html" %}
  25
+    {% include "blog/includes/pagination.html" %}
26 26
   {% endif %}
27 27
 {% endblock %}
0  mingus/templates/quotes/includes/_quote.html → mingus/templates/quotes/includes/quote.html
File renamed without changes
6  mingus/templates/quotes/quote_detail.html
... ...
@@ -1,9 +1,9 @@
1 1
 {% extends "base.html" %}
2  
-{% load cache %}
  2
+{% load cache i18n %}
3 3
 
4 4
 {% block content %}
5 5
 
6  
-<p>Quick fact, my favorite food is {{ favorite_food }}.</p>
  6
+<p>{% trans "Quick fact, my favorite food is" %} {{ favorite_food }}.</p>
7 7
 
8 8
 <h2>{{ object.title }}</h2>
9 9
 
@@ -27,6 +27,6 @@
27 27
 </div>
28 28
 {% endcache %}
29 29
 
30  
-{% include "blog/includes/_comments.html" %}
  30
+{% include "blog/includes/comments.html" %}
31 31
 
32 32
 {% endblock %}
6  mingus/templates/quotes/quote_list.html
... ...
@@ -1,11 +1,11 @@
1 1
 {% extends "base.html" %}
2  
-{% load cache %}
  2
+{% load cache i18n %}
3 3
 
4 4
 {% block content %}
5 5
 
6  
-<h2>Quotes</h2>
  6
+<h2>{% trans "Quotes" %}</h2>
7 7
 
8  
-A little side note, my favorite jazz album is {{ favorite_jazz_album }}.
  8
+{% trans "A little side note, my favorite jazz album is" %} {{ favorite_jazz_album }}.
9 9
 
10 10
 {% cache 180 "quote.quote_list" %}
11 11
 {% for object in object_list %}
100  mingus/tests.py
... ...
@@ -0,0 +1,100 @@
  1
+from django.test.client import Client
  2
+import unittest
  3
+
  4
+
  5
+class MingusClientTests(unittest.TestCase):
  6
+    fixtures = ['mammals.json', 'birds']
  7
+
  8
+    def setUp(self):
  9
+        pass
  10
+
  11
+    def tearDown(self):
  12
+        pass
  13
+
  14
+
  15
+    def test_HomePage(self):
  16
+        '''Test if the homepage renders.'''
  17
+        c = Client()
  18
+        response = c.get('/')
  19
+        self.failUnlessEqual(response.status_code, 200)
  20
+
  21
+    def test_About(self):
  22
+        'Test if the about page renders.'
  23
+        c = Client()
  24
+        response = c.get('/about/')
  25
+        self.failUnlessEqual(response.status_code, 200)
  26
+
  27
+    def test_Contact(self):
  28
+        'Test if the contact page renders.'
  29
+        c = Client()
  30
+        response = c.get('/contact/')
  31
+
  32
+        self.failUnlessEqual(response.status_code, 200)
  33
+
  34
+    def test_ContactSubmit(self):
  35
+        '''Test submitting the contact form. Expect to return to the form sent template.
  36
+
  37
+        The field 'fonzie_kungfu' is the honeypot field to protect you from
  38
+        spam. This feature is provided by django-honeypot.
  39
+
  40
+        '''
  41
+        c = Client()
  42
+        response = c.post('/contact/', {'name': 'charles', 'email': 'foo@foo.com',
  43
+                    'body': 'hello.', 'fonzie_kungfu': ''},
  44
+                    follow=True)
  45
+        self.failUnlessEqual(response.status_code, 200)
  46
+        self.assertEquals(response.template[0].name, 'contact_form/contact_form_sent.html')
  47
+
  48
+
  49
+    def test_ContactSubmit_WithHoneyPot(self):
  50
+        '''Test the @honeypot decorator which exists to reduce spam.
  51
+
  52
+        HoneyPot will return a 400 response if the honeypot field is
  53
+        submited with a value.
  54
+
  55
+        '''
  56
+        c = Client()
  57
+        response = c.post('/contact/', {'name': 'charles', 'email':
  58
+                    'foo@foo.com', 'body': 'hello.', 'fonzie_kungfu': 'evil'},
  59
+                    follow=True)
  60
+        self.failUnlessEqual(response.status_code, 400)
  61
+
  62
+
  63
+    def test_QuoteList(self):
  64
+        '''Test quote list page renders.'''
  65
+
  66
+        c = Client()
  67
+        response = c.get('/quotes/')
  68
+        self.failUnlessEqual(response.status_code, 200)
  69
+
  70
+    def test_QuoteDetail(self):
  71
+        '''Test quote list page renders.'''
  72
+
  73
+        from quoteme.models import Quote
  74
+
  75
+        quote = Quote.objects.get()
  76
+
  77
+        c = Client()
  78
+        response = c.get(quote.get_absolute_url())
  79
+        self.failUnlessEqual(response.status_code, 200)
  80
+
  81
+
  82
+    def test_RSS(self):
  83
+        '''Test the latest posts feed displays.'''
  84
+
  85
+        c = Client()
  86
+        response = c.get('/feeds/latest/')
  87
+        self.failUnlessEqual(response.status_code, 200)
  88
+
  89
+    def test_SpringsteenFeed(self):
  90
+        '''Test the latest springsteen feed for findjango integration displays.'''
  91
+
  92
+        c = Client()
  93
+        response = c.get('/api/springsteen/posts/')
  94
+        self.failUnlessEqual(response.status_code, 200)
  95
+
  96
+
  97
+
  98
+
  99
+
  100
+
4  setup.py
@@ -2,7 +2,7 @@
2 2
 
3 3
 setup(
4 4
     name='django-mingus',
5  
-    version='0.3.2',
  5
+    version='0.4',
6 6
     description='A django blog engine.',
7 7
     author='Kevin Fricovsky',
8 8
     author_email='kfricovsky@gmail.com',
@@ -13,7 +13,7 @@
13 13
         'mingus.core',
14 14
     ],
15 15
     classifiers=[
16  
-        'Development Status :: 3 - Alpha',
  16
+        'Development Status :: 4 - Beta',
17 17
         'Environment :: Web Environment',
18 18
         'Intended Audience :: Developers',
19 19
         'License :: OSI Approved :: BSD License',

0 notes on commit 9a8dae9

Please sign in to comment.
Something went wrong with that request. Please try again.