+ chunks_list = helpers.ChunksList(Chunk.objects.order_by(
+ 'book__title', 'book', 'number'))
+
+ return direct_to_template(request, 'wiki/document_list.html', extra_context={
+ 'books': chunks_list,
+ #'books': [helpers.BookChunks(b) for b in Book.objects.all().select_related()],
+ 'last_books': sorted(request.session.get("wiki_last_books", {}).items(),
+ key=lambda x: x[1]['time'], reverse=True),
+ })
+
+
+@active_tab('unassigned')
+@never_cache
+def unassigned(request):
+ chunks_list = helpers.ChunksList(Chunk.objects.filter(
+ user=None).order_by('book__title', 'book__id', 'number'))
+
+ return direct_to_template(request, 'wiki/document_list.html', extra_context={
+ 'books': chunks_list,
+ 'last_books': sorted(request.session.get("wiki_last_books", {}).items(),
+ key=lambda x: x[1]['time'], reverse=True),
+ })
+
+
+@never_cache
+def user(request, username=None):
+ if username is None:
+ if request.user.is_authenticated():
+ user = request.user
+ else:
+ raise Http404
+ else:
+ user = get_object_or_404(User, username=username)
+
+ chunks_list = helpers.ChunksList(Chunk.objects.filter(
+ user=user).order_by('book__title', 'book', 'number'))
+