diff --git a/.travis.yml b/.travis.yml index 606305ec7..ce95b9a49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,10 @@ python: install: - pip install -U setuptools - python bootstrap.py - - ./bin/buildout -c ci/travis.cfg + - ./bin/buildout -c travis.cfg before_script: - - make kwalitee + - ./bin/pyflakes zinnia + - ./bin/pep8 --count --show-source --statistics --exclude=migrations zinnia script: - ./bin/test after_success: diff --git a/ci/shiningpanda.cfg b/ci/shiningpanda.cfg deleted file mode 100644 index 58e5b0372..000000000 --- a/ci/shiningpanda.cfg +++ /dev/null @@ -1,26 +0,0 @@ -[buildout] -extends = ../buildout.cfg - -develop = .. - -bin-directory = ../bin - -parts-directory = ../parts - -eggs-directory = ../eggs - -develop-eggs-directory = ../develop-eggs - -parts = cover - pep8 - pyflakes - -eggs -= tweepy - gdata - feedparser - South - akismet - PyMollom - pdbpp - nose-progressive - diff --git a/demo/settings.py b/demo/settings.py index ee9b0c214..855b7fa0e 100644 --- a/demo/settings.py +++ b/demo/settings.py @@ -4,6 +4,7 @@ gettext = lambda s: s DEBUG = True +TEMPLATE_DEBUG = DEBUG DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', diff --git a/docs/development/tests.rst b/docs/development/tests.rst index 50e0e9cd0..d411f1239 100644 --- a/docs/development/tests.rst +++ b/docs/development/tests.rst @@ -51,7 +51,7 @@ Coverage Despite my best efforts, some functionnalities are not yet tested, that's why I need your help ! -As I write these lines the **175** tests in Zinnia cover **96%** of the code +As I write these lines the **182** tests in Zinnia cover **96%** of the code bundled in Zinnia. A real effort has been made to obtain this percentage, for ensuring the quality of the code. diff --git a/ci/travis.cfg b/travis.cfg similarity index 63% rename from ci/travis.cfg rename to travis.cfg index f3873cce3..7289c0656 100644 --- a/ci/travis.cfg +++ b/travis.cfg @@ -1,20 +1,13 @@ [buildout] -extends = ../buildout.cfg - -develop = .. - -bin-directory = ../bin - -parts-directory = ../parts - -eggs-directory = ../eggs - -develop-eggs-directory = ../develop-eggs +extends = buildout.cfg parts = test + pep8 + pyflakes coveralls -eggs -= tweepy +eggs -= django-bitly + tweepy gdata feedparser South diff --git a/zinnia/templates/403.html b/zinnia/templates/403.html index aa966914a..6aad4cd18 100644 --- a/zinnia/templates/403.html +++ b/zinnia/templates/403.html @@ -5,11 +5,11 @@ -{% endblock %} +{% endblock breadcrumbs %} -{% block title %}{% trans "Permission denied" %}{% endblock %} +{% block title %}{% trans "Permission denied" %}{% endblock title %} -{% block body-class %}error-403{% endblock %} +{% block body-class %}error-403{% endblock body-class %} {% block content %}

{% trans "Permission denied" %}

@@ -17,4 +17,4 @@

{% trans "Permission denied" %}

{% trans "Sorry but you don't have the permission to do this action." %}

{{ block.super }} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/404.html b/zinnia/templates/404.html index 53b9760fa..4e2b468ec 100644 --- a/zinnia/templates/404.html +++ b/zinnia/templates/404.html @@ -5,11 +5,11 @@ -{% endblock %} +{% endblock breadcrumbs %} -{% block title %}{% trans "Page not found" %}{% endblock %} +{% block title %}{% trans "Page not found" %}{% endblock title %} -{% block body-class %}error-404{% endblock %} +{% block body-class %}error-404{% endblock body-class %} {% block content %}

{% trans "Page not found" %}

@@ -17,4 +17,4 @@

{% trans "Page not found" %}

{% trans "Sorry, but the requested page could not be found." %}

{{ block.super }} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/500.html b/zinnia/templates/500.html index 050fc3213..023af01b3 100644 --- a/zinnia/templates/500.html +++ b/zinnia/templates/500.html @@ -5,11 +5,11 @@ -{% endblock %} +{% endblock breadcrumbs %} -{% block title %}{% trans "Server error" %}{% endblock %} +{% block title %}{% trans "Server error" %}{% endblock title %} -{% block body-class %}error-500{% endblock %} +{% block body-class %}error-500{% endblock body-class %} {% block content %}

{% trans "Server error" %}

@@ -17,4 +17,4 @@

{% trans "Server error" %}

{% trans "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience." %}

{{ block.super }} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/admin/zinnia/app_index.html b/zinnia/templates/admin/zinnia/app_index.html index 520afdf07..06c693b5c 100644 --- a/zinnia/templates/admin/zinnia/app_index.html +++ b/zinnia/templates/admin/zinnia/app_index.html @@ -5,7 +5,7 @@ {{ block.super }} -{% endblock %} +{% endblock extrastyle %} {% block extrahead %} {{ block.super }} @@ -21,7 +21,7 @@ }); }); -{% endblock %} +{% endblock extrahead %} {% block content %}
@@ -31,4 +31,4 @@ {% include "admin/zinnia/widgets/draft_entries.html" %} {% include "admin/zinnia/widgets/recent_linkbacks.html" %}
-{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/admin/zinnia/widgets/base.html b/zinnia/templates/admin/zinnia/widgets/base.html index d0790cdfc..2c7952c08 100644 --- a/zinnia/templates/admin/zinnia/widgets/base.html +++ b/zinnia/templates/admin/zinnia/widgets/base.html @@ -1,6 +1,6 @@ -
- - - {% block content %}{% endblock %} +
+
{% block title %}{% endblock %}
+ + {% block content %}{% endblock content %}
{% block title %}{% endblock title %}
diff --git a/zinnia/templates/admin/zinnia/widgets/content_stats.html b/zinnia/templates/admin/zinnia/widgets/content_stats.html index b9752f465..7c7715797 100644 --- a/zinnia/templates/admin/zinnia/widgets/content_stats.html +++ b/zinnia/templates/admin/zinnia/widgets/content_stats.html @@ -1,12 +1,12 @@ {% extends "admin/zinnia/widgets/base.html" %} {% load i18n zinnia_tags %} -{% block module_id %}contents{% endblock %} +{% block module_id %}contents{% endblock module_id %} -{% block summary %}{% trans "Today" %}{% endblock %} +{% block summary %}{% trans "Today" %}{% endblock summary %} -{% block title %}{% trans "Today" %}{% endblock %} +{% block title %}{% trans "Today" %}{% endblock title %} {% block content %} {% zinnia_statistics "admin/zinnia/widgets/_content_stats.html" %} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/admin/zinnia/widgets/draft_entries.html b/zinnia/templates/admin/zinnia/widgets/draft_entries.html index edeb4a9df..bbf50de4c 100644 --- a/zinnia/templates/admin/zinnia/widgets/draft_entries.html +++ b/zinnia/templates/admin/zinnia/widgets/draft_entries.html @@ -1,12 +1,12 @@ {% extends "admin/zinnia/widgets/base.html" %} {% load i18n zinnia_tags %} -{% block module_id %}drafts{% endblock %} +{% block module_id %}drafts{% endblock module_id %} -{% block summary %}{% trans "Draft entries" %}{% endblock %} +{% block summary %}{% trans "Draft entries" %}{% endblock summary %} -{% block title %}{% trans "Draft entries" %}{% endblock %} +{% block title %}{% trans "Draft entries" %}{% endblock title %} {% block content %} {% get_draft_entries template="admin/zinnia/widgets/_draft_entries.html" %} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/admin/zinnia/widgets/recent_comments.html b/zinnia/templates/admin/zinnia/widgets/recent_comments.html index d8e2c02c1..e0bf349f7 100644 --- a/zinnia/templates/admin/zinnia/widgets/recent_comments.html +++ b/zinnia/templates/admin/zinnia/widgets/recent_comments.html @@ -1,12 +1,12 @@ {% extends "admin/zinnia/widgets/base.html" %} {% load i18n zinnia_tags %} -{% block module_id %}comments{% endblock %} +{% block module_id %}comments{% endblock module_id %} -{% block summary %}{% trans "Recent comments" %}{% endblock %} +{% block summary %}{% trans "Recent comments" %}{% endblock summary %} -{% block title %}{% trans "Recent comments" %}{% endblock %} +{% block title %}{% trans "Recent comments" %}{% endblock title %} {% block content %} {% get_recent_comments template="admin/zinnia/widgets/_recent_comments.html" %} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/admin/zinnia/widgets/recent_linkbacks.html b/zinnia/templates/admin/zinnia/widgets/recent_linkbacks.html index bfa120cdd..972d23273 100644 --- a/zinnia/templates/admin/zinnia/widgets/recent_linkbacks.html +++ b/zinnia/templates/admin/zinnia/widgets/recent_linkbacks.html @@ -1,12 +1,12 @@ {% extends "admin/zinnia/widgets/base.html" %} {% load i18n zinnia_tags %} -{% block module_id %}linkbacks{% endblock %} +{% block module_id %}linkbacks{% endblock module_id %} -{% block summary %}{% trans "Recent linkbacks" %}{% endblock %} +{% block summary %}{% trans "Recent linkbacks" %}{% endblock summary %} -{% block title %}{% trans "Recent linkbacks" %}{% endblock %} +{% block title %}{% trans "Recent linkbacks" %}{% endblock title %} {% block content %} {% get_recent_linkbacks template="admin/zinnia/widgets/_recent_linkbacks.html" %} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/comments/zinnia/entry/posted.html b/zinnia/templates/comments/zinnia/entry/posted.html index d4c9f4562..614c797a0 100644 --- a/zinnia/templates/comments/zinnia/entry/posted.html +++ b/zinnia/templates/comments/zinnia/entry/posted.html @@ -1,9 +1,9 @@ {% extends "zinnia/base.html" %} {% load i18n %} -{% block title %}{% trans "Thanks for your comment" %}{% endblock %} +{% block title %}{% trans "Thanks for your comment" %}{% endblock title %} -{% block body-class %}comment-posted{% endblock %} +{% block body-class %}comment-posted{% endblock body-class %} {% block content %}

{% trans "Thanks for your comment" %}

@@ -28,4 +28,4 @@

{% trans "Thanks for your comment" %}

-{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/comments/zinnia_entry_preview.html b/zinnia/templates/comments/zinnia_entry_preview.html index f8d7d2727..b76cb13d3 100644 --- a/zinnia/templates/comments/zinnia_entry_preview.html +++ b/zinnia/templates/comments/zinnia_entry_preview.html @@ -1,9 +1,9 @@ {% extends "zinnia/base.html" %} {% load i18n zinnia_tags comments %} -{% block title %}{% trans "Comment preview" %}{% endblock %} +{% block title %}{% trans "Comment preview" %}{% endblock title %} -{% block body-class %}comment-preview{% endblock %} +{% block body-class %}comment-preview{% endblock body-class %} {% block content %} {% if form.errors %} @@ -33,4 +33,4 @@

{% trans "Preview of the comment" %}

{% endif %} {% include "comments/zinnia/entry/form.html" %} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/zinnia/_entry_detail_base.html b/zinnia/templates/zinnia/_entry_detail_base.html index eff3b94f9..cfbcfe430 100644 --- a/zinnia/templates/zinnia/_entry_detail_base.html +++ b/zinnia/templates/zinnia/_entry_detail_base.html @@ -8,7 +8,7 @@

{{ object.title|widont }}

- {% endblock %} + {% endblock entry-title %} {% block entry-info %}

{% block entry-authors %} @@ -25,10 +25,10 @@

{% trans "Written on" %} {% endif %} {% endwith %} - {% endblock %} + {% endblock entry-authors %} {% block entry-published %} {{ object.creation_date|date:"DATE_FORMAT" }} - {% endblock %} + {% endblock entry-published %} {% block entry-categories %} {% with categories=object.categories.all %} {% if categories|length %} @@ -38,16 +38,16 @@

title="{% blocktrans %}Show all entries in {{ category }}{% endblocktrans %}" rel="tag category">{{ category }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endif %}. {% endwith %} - {% endblock %} + {% endblock entry-categories %}

- {% endblock %} + {% endblock entry-info %} {% block entry-last-update %}

{% trans "Last update on" %} {{ object.last_update|date:"DATE_FORMAT" }}.

- {% endblock %} + {% endblock entry-last-update %} - {% endblock %} + {% endblock entry-header %} {% block entry-body %}
@@ -65,12 +65,12 @@

{% endif %} - {% endblock %} + {% endblock entry-image %} {% block entry-content %}
{{ object_content|safe }}
- {% endblock %} + {% endblock entry-content %} {% block continue-reading %} {% if continue_reading and object_content.has_more %}

@@ -81,9 +81,9 @@

{% endif %} - {% endblock %} + {% endblock continue-reading %} - {% endblock %} + {% endblock entry-body %} {% block entry-footer %}
@@ -98,7 +98,7 @@

{% trans "No tags" %} {% endfor %}

- {% endblock %} + {% endblock entry-tags %} {% block entry-shorturl %}

{% trans "Short url" %} : @@ -108,7 +108,7 @@

{{ object.short_url }}

- {% endblock %} + {% endblock entry-shorturl %} {% block entry-discussions %}

{% trans "Discussions" %} : @@ -131,7 +131,7 @@

{% endif %} {% endif %} {% endwith %} - {% endblock %} + {% endblock entry-comments %} {% block entry-pingbacks %} {% with pingback_count=object.pingback_count %} {% if pingback_count %} @@ -140,7 +140,7 @@

{% endif %} {% endwith %} - {% endblock %} + {% endblock entry-pingbacks %} {% block entry-trackbacks %} {% with trackback_count=object.trackback_count %} {% if trackback_count %} @@ -149,9 +149,9 @@

{% endif %} {% endwith %} - {% endblock %} + {% endblock entry-trackbacks %}

- {% endblock %} + {% endblock entry-discussions %}

- {% endblock %} + {% endblock entry-footer %} diff --git a/zinnia/templates/zinnia/author_list.html b/zinnia/templates/zinnia/author_list.html index a0f120f65..53085a692 100644 --- a/zinnia/templates/zinnia/author_list.html +++ b/zinnia/templates/zinnia/author_list.html @@ -1,11 +1,11 @@ {% extends "zinnia/base.html" %} {% load i18n %} -{% block meta-description %}{% trans "Author list" %}{% endblock %} +{% block meta-description %}{% trans "Author list" %}{% endblock meta-description %} -{% block title %}{% trans "Authors" %}{% endblock %} +{% block title %}{% trans "Authors" %}{% endblock title %} -{% block body-class %}author-list{% endblock %} +{% block body-class %}author-list{% endblock body-class %} {% block content %}

{% trans "Author list" %}

@@ -24,4 +24,4 @@

{% trans "Author list" %}

{% endfor %} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/zinnia/base.html b/zinnia/templates/zinnia/base.html index 07231d893..28b286744 100644 --- a/zinnia/templates/zinnia/base.html +++ b/zinnia/templates/zinnia/base.html @@ -1,11 +1,11 @@ {% extends "zinnia/skeleton.html" %} {% load zinnia_tags i18n %} -{% block meta-keywords %}{% get_tags as entry_tags %}{{ entry_tags|join:", "}}{% endblock %} +{% block meta-keywords %}{% get_tags as entry_tags %}{{ entry_tags|join:", "}}{% endblock meta-keywords %} {% block meta %} -{% endblock %} +{% endblock meta %} {% block link %} @@ -16,11 +16,11 @@ {% get_archives_entries "zinnia/tags/archives_entries_link.html" %} -{% endblock %} +{% endblock link %} {% block breadcrumbs %} {% zinnia_breadcrumbs %} -{% endblock %} +{% endblock breadcrumbs %} {% block sidebar %}
@@ -90,8 +90,8 @@

{% trans "Tools" %}

{% endif %} - {% block admin_tools %} - {% endblock %} + {% block admin-tools %} + {% endblock admin-tools %}
  • {% trans "Log out" %} @@ -100,4 +100,4 @@

    {% trans "Tools" %}

  • {% endif %} -{% endblock %} +{% endblock sidebar %} diff --git a/zinnia/templates/zinnia/category_list.html b/zinnia/templates/zinnia/category_list.html index 16778f3c6..ea6c9288b 100644 --- a/zinnia/templates/zinnia/category_list.html +++ b/zinnia/templates/zinnia/category_list.html @@ -1,11 +1,11 @@ {% extends "zinnia/base.html" %} {% load i18n mptt_tags %} -{% block meta-description %}{% trans "Category list" %}{% endblock %} +{% block meta-description %}{% trans "Category list" %}{% endblock meta-description %} -{% block title %}{% trans "Categories" %}{% endblock %} +{% block title %}{% trans "Categories" %}{% endblock title %} -{% block body-class %}category-list{% endblock %} +{% block body-class %}category-list{% endblock body-class %} {% block content %}

    {% trans "Category list" %}

    @@ -29,4 +29,4 @@

    {% trans "Category list" %}

    {% endif %} -{% endblock %} +{% endblock content %} diff --git a/zinnia/templates/zinnia/entry_archive.html b/zinnia/templates/zinnia/entry_archive.html index 7dd97bf48..548bdddb3 100644 --- a/zinnia/templates/zinnia/entry_archive.html +++ b/zinnia/templates/zinnia/entry_archive.html @@ -1,15 +1,15 @@ {% extends "zinnia/entry_list.html" %} {% load i18n zinnia_tags %} -{% block meta-description %}{% trans "Latest entries" %}{% endblock %} +{% block meta-description %}{% trans "Latest entries" %}{% endblock meta-description %} -{% block title %}{% trans "Latest entries" %}{% endblock %} +{% block title %}{% trans "Latest entries" %}{% endblock title %} -{% block body-class %}{{ block.super }} archive index {% now "\y\e\a\r-Y \m\o\n\t\h-m \w\e\ek-W \d\a\y-d" %}{% endblock %} +{% block body-class %}{{ block.super }} archive index {% now "\y\e\a\r-Y \m\o\n\t\h-m \w\e\ek-W \d\a\y-d" %}{% endblock body-class %} {% block slider %} {% get_featured_entries template="zinnia/tags/slider_entries.html" %} -{% endblock %} +{% endblock slider %} {% block content-related %} {% if date_list %} @@ -22,4 +22,4 @@

    {% trans "Yearly archives" %}

    {% endfor %} {% endif %} -{% endblock %} +{% endblock content-related %} diff --git a/zinnia/templates/zinnia/entry_archive_day.html b/zinnia/templates/zinnia/entry_archive_day.html index 657bed2f2..01c55fa55 100644 --- a/zinnia/templates/zinnia/entry_archive_day.html +++ b/zinnia/templates/zinnia/entry_archive_day.html @@ -1,15 +1,15 @@ {% extends "zinnia/entry_list.html" %} {% load i18n %} -{% block meta-description %}{% trans "Archives" %} {{ day|date:"DATE_FORMAT" }}{% endblock %} +{% block meta-description %}{% trans "Archives" %} {{ day|date:"DATE_FORMAT" }}{% endblock meta-description %} -{% block title %}{% trans "Archives" %} {{ day|date:"DATE_FORMAT" }}{% endblock %} +{% block title %}{% trans "Archives" %} {{ day|date:"DATE_FORMAT" }}{% endblock title %} -{% block body-class %}{{ block.super }} archive date day year-{{ day|date:"Y" }} month-{{ day|date:"m" }} week-{{ day|date:"W" }} day-{{ day|date:"d" }}{% endblock %} +{% block body-class %}{{ block.super }} archive date day year-{{ day|date:"Y" }} month-{{ day|date:"m" }} week-{{ day|date:"W" }} day-{{ day|date:"d" }}{% endblock body-class %} {% block content-title %}

    {% trans "Archives" %} {{ day|date:"DATE_FORMAT" }}

    -{% endblock %} +{% endblock content-title %} {% block content-related %} {% if previous_day %} @@ -44,4 +44,4 @@

    {% trans "Archives" %}

    {% endif %} -{% endblock %} +{% endblock content-related %} diff --git a/zinnia/templates/zinnia/entry_archive_month.html b/zinnia/templates/zinnia/entry_archive_month.html index bffff1fe8..1f83ac67b 100644 --- a/zinnia/templates/zinnia/entry_archive_month.html +++ b/zinnia/templates/zinnia/entry_archive_month.html @@ -1,15 +1,15 @@ {% extends "zinnia/entry_list.html" %} {% load i18n %} -{% block meta-description %}{% trans "Archives" %} {{ month|date:"YEAR_MONTH_FORMAT" }}{% endblock %} +{% block meta-description %}{% trans "Archives" %} {{ month|date:"YEAR_MONTH_FORMAT" }}{% endblock meta-description %} -{% block title %}{% trans "Archives" %} {{ month|date:"YEAR_MONTH_FORMAT" }}{% endblock %} +{% block title %}{% trans "Archives" %} {{ month|date:"YEAR_MONTH_FORMAT" }}{% endblock title %} -{% block body-class %}{{ block.super }} archive date month year-{{ month|date:"Y" }} month-{{ month|date:"m" }}{% endblock %} +{% block body-class %}{{ block.super }} archive date month year-{{ month|date:"Y" }} month-{{ month|date:"m" }}{% endblock body-class %} {% block content-title %}

    {% trans "Archives" %} {{ month|date:"YEAR_MONTH_FORMAT" }}

    -{% endblock %} +{% endblock content-title %} {% block content-related %}

    {% trans "Daily archives" %}

    @@ -39,4 +39,4 @@

    {% trans "Archives" %}

    {{ month|date:"Y" }} -{% endblock %} +{% endblock content-related %} diff --git a/zinnia/templates/zinnia/entry_archive_today.html b/zinnia/templates/zinnia/entry_archive_today.html index cc04e6e9a..2fcc95527 100644 --- a/zinnia/templates/zinnia/entry_archive_today.html +++ b/zinnia/templates/zinnia/entry_archive_today.html @@ -1,15 +1,15 @@ {% extends "zinnia/entry_list.html" %} {% load i18n %} -{% block meta-description %}{% trans "Today archives" %} {{ day|date:"DATE_FORMAT" }}{% endblock %} +{% block meta-description %}{% trans "Today archives" %} {{ day|date:"DATE_FORMAT" }}{% endblock meta-description %} -{% block title %}{% trans "Today archives" %} {{ day|date:"DATE_FORMAT" }}{% endblock %} +{% block title %}{% trans "Today archives" %} {{ day|date:"DATE_FORMAT" }}{% endblock title %} -{% block body-class %}{{ block.super }} archive date today year-{{ day|date:"Y" }} month-{{ day|date:"m" }} week-{{ day|date:"W" }} day-{{ day|date:"d" }}{% endblock %} +{% block body-class %}{{ block.super }} archive date today year-{{ day|date:"Y" }} month-{{ day|date:"m" }} week-{{ day|date:"W" }} day-{{ day|date:"d" }}{% endblock body-class %} {% block content-title %}

    {% trans "Today archives" %}

    -{% endblock %} +{% endblock content-title %} {% block content-related %} {% if previous_day %} @@ -33,4 +33,4 @@

    {% trans "Archives" %}

    {{ day|date:"YEAR_MONTH_FORMAT" }}