changeset 49:a10fff6199b0

verbesserung f?r text unterst?tzung, text kann jetzt aus url kommen, sprache bisher nur deutsch
author dwinter
date Mon, 11 Sep 2006 16:43:09 +0200
parents 6b5b153209bd
children 6c0f20cecc60
files documentViewer.py zpt/head_main.zpt zpt/viewer_main.zpt
diffstat 3 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/documentViewer.py	Sat Sep 09 12:52:59 2006 +0200
+++ b/documentViewer.py	Mon Sep 11 16:43:09 2006 +0200
@@ -340,6 +340,9 @@
        textUrls=dom.xpath("//texttool/text")
        if textUrls and (len(textUrls)>0):
            textUrl=getTextFromNode(textUrls[0])
+           if urlparse.urlparse(textUrl)[0]=="": #keine url
+               textUrl=os.path.join(archivePath,textUrl) 
+
            docinfo['textURL'] = textUrl
                      
        docinfo = self.getBibinfoFromIndexMeta(url,docinfo=docinfo,dom=dom)
--- a/zpt/head_main.zpt	Sat Sep 09 12:52:59 2006 +0200
+++ b/zpt/head_main.zpt	Mon Sep 11 16:43:09 2006 +0200
@@ -1,6 +1,9 @@
-<tal:block tal:define="docinfo options/docinfo">
+<tal:block tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode python:options.get('viewMode','images')">
   <span tal:condition="not:exists:docinfo/author">(no bibliographical information)</span>
   <tal:y tal:condition="exists:docinfo/author">
     <b tal:content="docinfo/author"/>,<i tal:content="docinfo/title"/>,<i tal:content="docinfo/year"/>
   </tal:y>
+  <tal:x tal:condition="python:viewMode=='text'">
+  <a target="_blank" tal:attributes="href string:${here/imageViewerUrl}fn=${docinfo/imagePath}&pn=${pageinfo/current}">view image</a>
+  </tal:x>
 </tal:block>
--- a/zpt/viewer_main.zpt	Sat Sep 09 12:52:59 2006 +0200
+++ b/zpt/viewer_main.zpt	Mon Sep 11 16:43:09 2006 +0200
@@ -4,7 +4,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 </head>
 <body tal:condition="docinfo/numPages">
-<div tal:replace="structure python:here.template.head_main(docinfo=docinfo)"/>
+<div tal:replace="structure python:here.template.head_main(docinfo=docinfo,viewMode=viewMode,pageinfo=pageinfo)"/>
 <tal:block tal:condition="python:here.isAccessible(docinfo)">
 <table border="0" width="100%" height="100%">
   <tr>