From 328add2df4cf0539677068707fcdef7e3a023236 Mon Sep 17 00:00:00 2001 From: Yanjin Ding Date: Wed, 28 Jan 2015 09:51:18 -0500 Subject: [PATCH] add url namespace for "reverse" and "url" template tag --- aldryn_news/cms_app.py | 1 + aldryn_news/models.py | 4 ++-- aldryn_news/templates/aldryn_news/news_detail.html | 4 ++-- aldryn_news/templates/aldryn_news/news_list.html | 4 ++-- aldryn_news/templates/aldryn_news/plugins/archive.html | 6 +++--- aldryn_news/templates/aldryn_news/plugins/tags.html | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/aldryn_news/cms_app.py b/aldryn_news/cms_app.py index 565bd5f..0c24de3 100644 --- a/aldryn_news/cms_app.py +++ b/aldryn_news/cms_app.py @@ -10,6 +10,7 @@ class NewsApp(CMSApp): name = _('News') urls = ['aldryn_news.urls'] + app_name = 'aldryn_news' menus = [NewsCategoryMenu] apphook_pool.register(NewsApp) diff --git a/aldryn_news/models.py b/aldryn_news/models.py index 44ff44e..5312035 100644 --- a/aldryn_news/models.py +++ b/aldryn_news/models.py @@ -86,7 +86,7 @@ def get_absolute_url(self, language=None): return '/' kwargs = {'category_slug': slug} - return reverse('news-category', kwargs=kwargs) + return reverse('aldryn_news:news-category', kwargs=kwargs) class Tag(TranslatableModel): @@ -193,7 +193,7 @@ def get_absolute_url(self, language=None): if category_slug: kwargs['category_slug'] = category_slug - return reverse('news-detail', kwargs=kwargs) + return reverse('aldryn_news:news-detail', kwargs=kwargs) class LatestNewsPlugin(CMSPlugin): diff --git a/aldryn_news/templates/aldryn_news/news_detail.html b/aldryn_news/templates/aldryn_news/news_detail.html index 12936e5..8db35d6 100644 --- a/aldryn_news/templates/aldryn_news/news_detail.html +++ b/aldryn_news/templates/aldryn_news/news_detail.html @@ -8,6 +8,6 @@ {% if news.key_visual_id %}

{% endif %}
{{ news.lead_in|safe }}
{% render_placeholder news.content %}
-

{% trans "Back" %}

+

{% trans "Back" %}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/aldryn_news/templates/aldryn_news/news_list.html b/aldryn_news/templates/aldryn_news/news_list.html index 7ae29b6..b23d33e 100644 --- a/aldryn_news/templates/aldryn_news/news_list.html +++ b/aldryn_news/templates/aldryn_news/news_list.html @@ -10,8 +10,8 @@ {% trans "News" %}{% endif %}{% endblock %} {% include "aldryn_news/includes/news_items.html" with news=object_list image="true" %} {% if author or archive_date or tagged_entries %} -

{% trans "Back" %}

+

{% trans "Back" %}

{% endif %} {{ tagged_pks }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/aldryn_news/templates/aldryn_news/plugins/archive.html b/aldryn_news/templates/aldryn_news/plugins/archive.html index e14e082..9291172 100644 --- a/aldryn_news/templates/aldryn_news/plugins/archive.html +++ b/aldryn_news/templates/aldryn_news/plugins/archive.html @@ -6,11 +6,11 @@ {% endwith %} - \ No newline at end of file + diff --git a/aldryn_news/templates/aldryn_news/plugins/tags.html b/aldryn_news/templates/aldryn_news/plugins/tags.html index 735476b..86ab693 100644 --- a/aldryn_news/templates/aldryn_news/plugins/tags.html +++ b/aldryn_news/templates/aldryn_news/plugins/tags.html @@ -3,9 +3,9 @@
-
\ No newline at end of file +