X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/75669838ac1f6c847aa2c343fee17ea642d52462..bc45c0b826b50a6d5f472d0ebcbe92bb1b5a68c4:/apps/explorer/views.py diff --git a/apps/explorer/views.py b/apps/explorer/views.py index 8d80d029..eeac7b65 100644 --- a/apps/explorer/views.py +++ b/apps/explorer/views.py @@ -3,8 +3,10 @@ import hg, urllib2 from django.utils import simplejson as json from django.views.generic.simple import direct_to_template + from django.conf import settings from django.http import HttpResponseRedirect +from django.contrib.auth.decorators import login_required from explorer import forms, models @@ -39,13 +41,30 @@ def file_xml(request, path): }) -def file_html(request, path): - return direct_to_template(request, 'explorer/file_html.html', extra_context={ - 'object': html.transform(repo.get_file(path).data(), is_file=False), - 'hash': path, - 'image_folders_form': forms.ImageFoldersForm(), +# =============== +# = Panel views = +# =============== +def xmleditor_panel(request, path): + form = forms.BookForm() + text = repo.get_file(path).data() + + return direct_to_template(request, 'explorer/panels/xmleditor.html', extra_context={ + 'text': text, }) - + + +def gallery_panel(request, path): + return direct_to_template(request, 'explorer/panels/gallery.html', extra_context={ + 'form': forms.ImageFoldersForm(), + }) + + +def htmleditor_panel(request, path): + return direct_to_template(request, 'explorer/panels/htmleditor.html', extra_context={ + 'html': html.transform(repo.get_file(path).data(), is_file=False), + }) + + def folder_images(request, folder): return direct_to_template(request, 'explorer/folder_images.html', extra_context={ 'images': models.get_images_from_folder(folder),