+
+# =================
+# = Pull requests =
+# =================
+def pull_requests(request):
+ objects = PullRequest.objects.order_by('-status', 'timestamp')
+
+ if not request.user.has_perm('explorer.book.can_share'):
+ objects = objects.filter(comitter=request.user)
+
+ return direct_to_template(request, 'manager/pull_request.html',
+ extra_context = {'objects': objects} )
+
+
+#
+# Testing
+#
+def renderer_test(request):
+ return direct_to_template(request, 'renderer.html', mimetype="text/html",
+ extra_context = {} )
+
+
+def document_gallery(request, directory):
+ try:
+ base_dir = os.path.join(settings.MEDIA_ROOT, settings.FILEBROWSER_DIRECTORY, directory)
+ print base_dir
+ images = ['%s%s%s/%s' % (settings.MEDIA_URL, settings.FILEBROWSER_DIRECTORY, directory, f) for f in os.listdir(base_dir) if os.path.splitext(f)[1].lower() in ('.jpg', '.jpeg', '.png')]
+ return HttpResponse(json.dumps(images))
+ except (IndexError, OSError), e:
+ raise Http404