# HG changeset patch # User Brian Neal # Date 1285201567 0 # Node ID 307a74e2811256ad4e703eee60da2063a81e2221 # Parent 5232d58080571894148419b4237dbf1207061c3e Fixing #113; re-arrange the RSS forum feed icons around a bit. diff -r 5232d5808057 -r 307a74e28112 gpp/forums/views/main.py --- a/gpp/forums/views/main.py Wed Sep 22 23:54:49 2010 +0000 +++ b/gpp/forums/views/main.py Thu Sep 23 00:26:07 2010 +0000 @@ -38,6 +38,8 @@ TOPICS_PER_PAGE = 50 POSTS_PER_PAGE = 20 +FEED_BASE = '/feeds/forums/' +FORUM_FEED = FEED_BASE + '%s/' def get_page_num(request): @@ -92,7 +94,7 @@ return redirect(SPECIAL_QUERIES[query]) public_forums = Forum.objects.public_forums() - feeds = [{'name': 'All Forums', 'feed': '/feeds/forums/'}] + feeds = [{'name': 'All Forums', 'feed': FEED_BASE}] forums = Forum.objects.forums_for_user(request.user) get_forum_unread_status(forums, request.user) @@ -102,7 +104,7 @@ if forum.has_feed: feeds.append({ 'name': '%s Forum' % forum.name, - 'feed': '/feeds/forums/%s/' % forum.slug, + 'feed': FORUM_FEED % forum.slug, }) cat = cats.setdefault(forum.category.id, { @@ -130,6 +132,13 @@ if not forum.category.can_access(request.user): return HttpResponseForbidden() + feed = None + if not forum.category.groups.all(): + feed = { + 'name': '%s Forum' % forum.name, + 'feed': FORUM_FEED % forum.slug, + } + topics = forum.topics.select_related('user', 'last_post', 'last_post__user') get_topic_unread_status(forum, topics, request.user) @@ -149,6 +158,7 @@ return render_to_response('forums/forum_index.html', { 'forum': forum, + 'feed': feed, 'page': page, 'page_nav': page_nav, 'can_moderate': can_moderate, diff -r 5232d5808057 -r 307a74e28112 gpp/templates/forums/forum_index.html --- a/gpp/templates/forums/forum_index.html Wed Sep 22 23:54:49 2010 +0000 +++ b/gpp/templates/forums/forum_index.html Thu Sep 23 00:26:07 2010 +0000 @@ -1,8 +1,17 @@ {% extends 'base.html' %} {% load forum_tags %} +{% block custom_head %} +{% if feed %} + +{% endif %} +{% endblock %} {% block title %}Forums: {{ forum.name }}{% endblock %} {% block content %} -

Forums: {{ forum.name }}

+

Forums: {{ forum.name }} + {% if feed %} + RSS Feed + {% endif %} +

SurfGuitar101 Forum Index » diff -r 5232d5808057 -r 307a74e28112 gpp/templates/forums/index.html --- a/gpp/templates/forums/index.html Wed Sep 22 23:54:49 2010 +0000 +++ b/gpp/templates/forums/index.html Thu Sep 23 00:26:07 2010 +0000 @@ -40,12 +40,9 @@ {% if forum.has_unread %} New Posts {% endif %} -

{{ forum.name }} - {% if forum.has_feed %} - - RSS Feed - {% endif %}

-

{{ forum.description }}

+

{{ forum.name }}

+

{{ forum.description }}

+ {{ forum.topic_count }} {{ forum.post_count }} {% last_post_info forum.last_post %}