Commit afcbff4e authored by Ivan Tyagov's avatar Ivan Tyagov

Add navigation when browsing generated PDF thumbnails.

Improve code structure.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22829 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 819d75c1
......@@ -51,10 +51,14 @@
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<div tal:define="frame request/frame|python:here.PDF_getPageNumberFromSelectionIndex(request.get(\'selection_index\', 0));\n
<div class="pdf-preview-content"\n
tal:define="frame request/frame|\n
python:here.PDF_getPageNumberFromSelectionIndex(request.get(\'selection_index\', 0));\n
display request/display|string:large;\n
format request/format|string:jpg;">\n
<img src="" tal:attributes="src string:${here/absolute_url}/index_html?display=${display}&format=${format}&frame=${frame}">\n
<img src="" \n
tal:attributes="src\n
string:${here/absolute_url}/index_html?display=${display}&format=${format}&frame=${frame}">\n
</div>
]]></string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block tal:define="current_thumbnail_index \n
request/frame|\n
python:here.PDF_getPageNumberFromSelectionIndex(request.get(\'selection_index\', 0));\n
selection_name request/selection_name;\n
all_thunmbnails python: here.PDF_countThumbnailList()[0][0];\n
next_thunmbnail_index python: current_thumbnail_index + 1;\n
previous_thunmbnail_index python: current_thumbnail_index - 1;\n
parent_doc_url here/absolute_url;\n
base_url string:\n
${parent_doc_url}/PDF_viewHTMLPreviewAsImage?selection_name=${selection_name}&;">\n
\n
<div class="pdf-preview-navigation">\n
<!--\n
<span i18n:translate=""\n
i18n:domain="ui">Thumbnail</span>: \n
<span tal:content="current_thumbnail_index"/> of <span tal:content="all_thunmbnails"/>\n
-->\n
\n
<a href=""\n
tal:attributes="href string:${base_url}selection_index=0">\n
<img src="images/2leftarrowb.png" \n
i18n:translate="alt"\n
i18n:domain="ui"\n
alt="First"/>\n
</a>\n
\n
<a href=""\n
tal:condition="python: current_thumbnail_index >= 1"\n
tal:attributes="href string:${base_url}selection_index=${previous_thunmbnail_index}">\n
<img src="images/1leftarrowb.png" \n
i18n:translate="alt"\n
i18n:domain="ui"\n
alt="Previous"/>\n
</a>\n
\n
<a href=""\n
style="font-weight: bold;vertical-align:top;"\n
i18n:translate=""\n
i18n:domain="ui"\n
tal:attributes="href string:${parent_doc_url}/view">Exit Preview</a>\n
\n
<a href=""\n
i18n:translate=""\n
i18n:domain="ui"\n
tal:condition="python: all_thunmbnails > next_thunmbnail_index"\n
tal:attributes="href string:${base_url}selection_index=${next_thunmbnail_index}">\n
<img src="images/1rightarrowb.png" \n
i18n:translate="alt"\n
i18n:domain="ui"\n
alt="Next"/>\n
</a>\n
\n
<a href=""\n
i18n:translate=""\n
i18n:domain="ui"\n
tal:attributes="href string:${base_url}selection_index=${all_thunmbnails}">\n
<img src="images/2rightarrowb.png" \n
i18n:translate="alt"\n
i18n:domain="ui"\n
alt="Last"/>\n
</a>\n
\n
\n
</div>\n
</tal:block>
]]></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PDF_renderHTMLPreviewNavigation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -84,6 +84,7 @@
<key> <string>bottom</string> </key>
<value>
<list>
<string>navigation</string>
<string>body</string>
</list>
</value>
......
907
\ No newline at end of file
908
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment