+ return direct_to_template(request, 'explorer/panels/'+name+'.html',\
+ extra_context=extra_context)
+
+ @staticmethod
+ @ajax_login_required
+ @with_repo
+ def xmleditor_panel(request, path, panel, repo):
+ return {'text': repo.get_file(path, file_branch(path, request.user))}
+
+ @staticmethod
+ @ajax_login_required
+ def gallery_panel(request, path, panel):
+ return {'form': forms.ImageFoldersForm() }
+
+ @staticmethod
+ @ajax_login_required
+ @with_repo
+ def htmleditor_panel(request, path, panel, repo):
+ user_branch = file_branch(path, request.user)
+ try:
+ return {'html': html.transform(repo.get_file(path, user_branch), is_file=False)}
+ except (ParseError, ValidationError), e:
+ return direct_to_template(request, 'explorer/panels/parse_error.html', extra_context={
+ 'fileid': path, 'exception_type': type(e).__name__, 'exception': e,
+ 'panel_name': panel.display_name})
+
+ @staticmethod
+ @ajax_login_required
+ @with_repo
+ def dceditor_panel(request, path, panel, repo):
+ user_branch = file_branch(path, request.user)
+ try:
+ doc_text = repo.get_file(path, user_branch)
+ document = parser.WLDocument.from_string(doc_text)
+ form = forms.DublinCoreForm(info=document.book_info)
+ return {'form': form}
+ except (ParseError, ValidationError), e:
+ return direct_to_template(request, 'explorer/panels/parse_error.html', extra_context={
+ 'fileid': path, 'exception_type': type(e).__name__, 'exception': e,
+ 'panel_name': panel.display_name})
+
+
+@login_required