HTML iupdate.
authorŁukasz Rekucki <lrekucki@gmail.com>
Sat, 26 Sep 2009 19:50:55 +0000 (21:50 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Sat, 26 Sep 2009 19:50:55 +0000 (21:50 +0200)
apps/api/handlers/library_handlers.py
apps/api/management/commands/doc_upload.py
apps/api/resources.py
apps/api/urls.py

index 86aef21..0ad23d9 100644 (file)
@@ -173,7 +173,7 @@ class DocumentHTMLHandler(BaseHandler):
             else:
                 document = lib.document_for_rev(revision)
 
             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()
 
         except RevisionNotFound:
             return response.EntityNotFound().django_response()
 
index 66ef924..414c474 100644 (file)
@@ -32,11 +32,12 @@ class Command(BaseCommand):
         bookname = args[1]
 
         print "Uploading '%s' as document '%s'" % (filename, bookname)
         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),
 
         print client.post( reverse("document_list_view"),\
         {
             'bookname': bookname,
             'ocr_file': open(filename),
-            'generate_dc': options['dc'] } )
+            'generate_dc': options['dc'] or False } )
                   
                   
index 2d09787..51127e4 100644 (file)
@@ -39,6 +39,7 @@ __all__ = [
     'library_resource',
     'document_resource',
     'document_text_resource',
     'library_resource',
     'document_resource',
     'document_text_resource',
+    'document_html_resource',
     'document_dc_resource',
     'document_merge',
     'toolbar_buttons',
     'document_dc_resource',
     'document_merge',
     'toolbar_buttons',
index 8c47e83..6a95cf0 100644 (file)
@@ -47,7 +47,7 @@ urlpatterns = patterns('',
         name="doctext_view"),
 
     url(urlpath(r'documents', DOC, 'html', REVISION, format=False),
         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),
         name="dochtml_view"),
 
     url(urlpath(r'documents', DOC, 'dc', REVISION),