fix urls in template
This commit is contained in:
parent
ac6a7e1552
commit
3905421ce5
3 changed files with 10 additions and 7 deletions
|
@ -18,6 +18,7 @@ class ForumFeed(Feed):
|
|||
def item_pubdate(self, obj):
|
||||
return obj.created
|
||||
|
||||
|
||||
class LastPosts(ForumFeed):
|
||||
title = _('Latest posts on forum')
|
||||
description = _('Latest posts on forum')
|
||||
|
@ -36,7 +37,8 @@ class LastTopics(ForumFeed):
|
|||
|
||||
def items(self):
|
||||
return Topic.objects.order_by('-created')[:15]
|
||||
|
||||
|
||||
|
||||
class LastPostsOnTopic(ForumFeed):
|
||||
title_template = 'forum/feeds/posts_title.html'
|
||||
description_template = 'forum/feeds/posts_description.html'
|
||||
|
@ -60,11 +62,11 @@ class LastPostsOnTopic(ForumFeed):
|
|||
def items(self, obj):
|
||||
return Post.objects.filter(topic__id__exact=obj.id).order_by('-created')[:15]
|
||||
|
||||
|
||||
|
||||
class LastPostsOnForum(ForumFeed):
|
||||
title_template = 'forum/feeds/posts_title.html'
|
||||
description_template = 'forum/feeds/posts_description.html'
|
||||
|
||||
|
||||
def get_object(self, forums):
|
||||
if len(forums) != 1:
|
||||
raise ObjectDoesNotExist
|
||||
|
@ -84,6 +86,7 @@ class LastPostsOnForum(ForumFeed):
|
|||
def items(self, obj):
|
||||
return Post.objects.filter(topic__forum__id__exact=obj.id).order_by('-created')[:15]
|
||||
|
||||
|
||||
class LastPostsOnCategory(ForumFeed):
|
||||
title_template = 'forum/feeds/posts_title.html'
|
||||
description_template = 'forum/feeds/posts_description.html'
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<form id="qjump" method="get" action="forum">
|
||||
<div><label>{% trans "Jump to" %}
|
||||
<br />
|
||||
<select name="id" id="forum_id" onchange="window.location=('/forum/'+this.options[this.selectedIndex].value)">
|
||||
<select name="id" id="forum_id" onchange="window.location=('{% url index %}'+this.options[this.selectedIndex].value)">
|
||||
{% for category in categories %}
|
||||
<optgroup label="{{ category }}">
|
||||
{% for forum in category.forums.all %}
|
||||
|
@ -90,7 +90,7 @@
|
|||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="button" onclick="window.location=('/forum/'+getElementById('forum_id').value)" value=" {% trans "Go" %} " accesskey="g" />
|
||||
<input type="button" onclick="window.location=('{% url index %}'+getElementById('forum_id').value)" value=" {% trans "Go" %} " accesskey="g" />
|
||||
</label></div>
|
||||
</form>
|
||||
{% if moderator %}
|
||||
|
|
|
@ -196,7 +196,7 @@
|
|||
<form id="qjump" method="GET" action="forum">
|
||||
<div><label>{% trans "Jump to " %}
|
||||
<br />
|
||||
<select name="id" id="forum_id" onchange="window.location=('/forum/'+this.options[this.selectedIndex].value)">
|
||||
<select name="id" id="forum_id" onchange="window.location=('{% url index %}'+this.options[this.selectedIndex].value)">
|
||||
{% for category in categories %}
|
||||
<optgroup label="{{ category }}">
|
||||
{% for forum in category.forums.all %}
|
||||
|
@ -205,7 +205,7 @@
|
|||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="button" onclick="window.location=('/forum/'+getElementById('forum_id').value)" value=" {% trans "Go" %} " accesskey="g" />
|
||||
<input type="button" onclick="window.location=('{% url index %}'+getElementById('forum_id').value)" value=" {% trans "Go" %} " accesskey="g" />
|
||||
</label></div>
|
||||
|
||||
</form>
|
||||
|
|
Reference in a new issue