From: Ɓukasz Rekucki Date: Sat, 26 Sep 2009 19:50:55 +0000 (+0200) Subject: HTML iupdate. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/283ed815395b037ef132b4a9bd1e6e0c9d026183?hp=--cc HTML iupdate. --- 283ed815395b037ef132b4a9bd1e6e0c9d026183 diff --git a/apps/api/handlers/library_handlers.py b/apps/api/handlers/library_handlers.py index 86aef21b..0ad23d9f 100644 --- a/apps/api/handlers/library_handlers.py +++ b/apps/api/handlers/library_handlers.py @@ -173,7 +173,7 @@ class DocumentHTMLHandler(BaseHandler): else: document = lib.document_for_rev(revision) - return librarian.html.transform(document.data('xml')) + return librarian.html.transform(document.data('xml'), is_file=False) except RevisionNotFound: return response.EntityNotFound().django_response() diff --git a/apps/api/management/commands/doc_upload.py b/apps/api/management/commands/doc_upload.py index 66ef9243..414c4746 100644 --- a/apps/api/management/commands/doc_upload.py +++ b/apps/api/management/commands/doc_upload.py @@ -32,11 +32,12 @@ class Command(BaseCommand): bookname = args[1] print "Uploading '%s' as document '%s'" % (filename, bookname) - print "Wth DC template" if options['dc'] else "" + print options['dc'] + print "With DC template" if options['dc'] is not None else "" print client.post( reverse("document_list_view"),\ { 'bookname': bookname, 'ocr_file': open(filename), - 'generate_dc': options['dc'] } ) + 'generate_dc': options['dc'] or False } ) diff --git a/apps/api/resources.py b/apps/api/resources.py index 2d097877..51127e48 100644 --- a/apps/api/resources.py +++ b/apps/api/resources.py @@ -39,6 +39,7 @@ __all__ = [ 'library_resource', 'document_resource', 'document_text_resource', + 'document_html_resource', 'document_dc_resource', 'document_merge', 'toolbar_buttons', diff --git a/apps/api/urls.py b/apps/api/urls.py index 8c47e830..6a95cf0c 100644 --- a/apps/api/urls.py +++ b/apps/api/urls.py @@ -47,7 +47,7 @@ urlpatterns = patterns('', name="doctext_view"), url(urlpath(r'documents', DOC, 'html', REVISION, format=False), - document_text_resource, {'emitter_format': 'rawhtml'}, + document_html_resource, {'emitter_format': 'rawhtml'}, name="dochtml_view"), url(urlpath(r'documents', DOC, 'dc', REVISION),