Rafał Pitoń 12 лет назад
Родитель
Сommit
c186b8e3b1
2 измененных файлов с 12 добавлено и 9 удалено
  1. 10 7
      misago/apps/forummap.py
  2. 2 2
      templates/cranefly/forum_map.html

+ 10 - 7
misago/apps/forummap.py

@@ -1,8 +1,11 @@
-from django.template import RequestContext
-from misago.models import Forum
-from misago.shortcuts import render_to_response
-
-def forum_map(request):
-    return render_to_response('forum_map.html',
-                              {'forums': Forum.objects.treelist(request.acl.forums),},
+from django.template import RequestContext
+from misago.models import Forum
+from misago.shortcuts import render_to_response
+
+def forum_map(request):
+    return render_to_response('forum_map.html',
+                              {
+                               'forums': Forum.objects.treelist(request.acl.forums,
+                                                                Forum.objects.special_model('root'))
+                              },
                               context_instance=RequestContext(request));

+ 2 - 2
templates/cranefly/forum_map.html

@@ -15,12 +15,12 @@
   {% if forums %}
   <div class="row">
     <div class="span6">
-      {% for category in forums %}{% if loop.index0 is odd and category.subforums %}
+      {% for category in forums %}{% if loop.index is odd and category.subforums %}
       {{ draw_category(category) }}
       {% endif %}{% endfor %}
     </div>
     <div class="span6">
-      {% for category in forums %}{% if loop.index0 is even and category.subforums %}
+      {% for category in forums %}{% if loop.index is even and category.subforums %}
       {{ draw_category(category) }}
       {% endif %}{% endfor %}
     </div>