Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

add url namespace for "reverse" and "url" template tag #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aldryn_news/cms_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class NewsApp(CMSApp):
name = _('News')
urls = ['aldryn_news.urls']
app_name = 'aldryn_news'
menus = [NewsCategoryMenu]

apphook_pool.register(NewsApp)
4 changes: 2 additions & 2 deletions aldryn_news/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions aldryn_news/templates/aldryn_news/news_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
{% if news.key_visual_id %}<p class="mews-visual"><img src="{% thumbnail news.key_visual 700x200 crop %}" alt="" /></p>{% endif %}
<div class="news-lead">{{ news.lead_in|safe }}</div>
<div class="news-content">{% render_placeholder news.content %}</div>
<p class="news-back"><a href="{% url 'latest-news' %}">{% trans "Back" %}</a></p>
<p class="news-back"><a href="{% url 'aldryn_news:latest-news' %}">{% trans "Back" %}</a></p>
</div>
{% endblock %}
{% endblock %}
4 changes: 2 additions & 2 deletions aldryn_news/templates/aldryn_news/news_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{% trans "News" %}{% endif %}</h2>{% endblock %}
{% include "aldryn_news/includes/news_items.html" with news=object_list image="true" %}
{% if author or archive_date or tagged_entries %}
<p class="news-back"><a href="{% url 'latest-news' %}">{% trans "Back" %}</a></p>
<p class="news-back"><a href="{% url 'aldryn_news:latest-news' %}">{% trans "Back" %}</a></p>
{% endif %}
{{ tagged_pks }}
</div>
{% endblock %}
{% endblock %}
6 changes: 3 additions & 3 deletions aldryn_news/templates/aldryn_news/plugins/archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<ul class="news-archive">
{% for year in years %}
<li{% if year.grouper == current_year %} class="active"{% endif %}>
<a href="{% url 'archive-year' year=year.grouper %}">{{ year.grouper }}</a>
<a href="{% url 'aldryn_news:archive-year' year=year.grouper %}">{{ year.grouper }}</a>
<ul>
{% for month in year.list %}
<li{% if year.grouper == current_year and month.date.month == current_month %} class="active"{% endif %}>
<a href="{% url 'archive-month' year=year.grouper month=month.date|date:"n" %}">{{ month.date|date:"F" }} <span>({{ month.count }})</span></a>
<a href="{% url 'aldryn_news:archive-month' year=year.grouper month=month.date|date:"n" %}">{{ month.date|date:"F" }} <span>({{ month.count }})</span></a>
</li>
{% endfor %}
</ul>
Expand All @@ -20,4 +20,4 @@
{% endfor %}
</ul>
{% endwith %}
</div>
</div>
4 changes: 2 additions & 2 deletions aldryn_news/templates/aldryn_news/plugins/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<div class="plugin plugin-news">
<ul class="news-tags">
{% for tag in tags %}
<li><a href="{% url 'tagged-news' tag=tag.slug %}" class="news-tag-1">{{ tag.name }} <span>({{ tag.count }})</span></a></li>
<li><a href="{% url 'aldryn_news:tagged-news' tag=tag.slug %}" class="news-tag-1">{{ tag.name }} <span>({{ tag.count }})</span></a></li>
{% empty %}
<li class="news-empty"><p>{% trans "No entry found." %}</p></li>
{% endfor %}
</ul>
</div>
</div>