remvoe the wrong publish button,
[redakcja.git] / apps / catalogue / templatetags / book_list.py
index f5b7e64..f7e7047 100755 (executable)
@@ -103,6 +103,9 @@ def document_list_filter(request, **kwargs):
 
     chunks = chunks.order_by('book__title', 'book', 'number')
 
+    if not request.user.is_authenticated():
+        chunks = chunks.filter(book__public=True)
+
     state = arg_or_GET('status')
     if state in _states_dict:
         chunks = chunks.filter(_states_dict[state])
@@ -127,6 +130,7 @@ def book_list(context, user=None):
                 '-count', 'last_name', 'first_name')}
 
     new_context.update({
+        "filters": True,
         "request": request,
         "books": ChunksList(document_list_filter(request, **filters)),
         "stages": Chunk.tag_model.objects.all(),
@@ -134,4 +138,3 @@ def book_list(context, user=None):
     })
 
     return new_context
-