Commit 770d1e2d authored by Ivan Tyagov's avatar Ivan Tyagov

Use some JavaSCript to show only first n possible formats followed by "More"...

Use some JavaSCript to show only first n possible formats followed by "More" link which will show rest (more user frinedly for log OOo format lists). I18n & CSS fixes.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37022 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1f5a9d50
......@@ -1544,6 +1544,7 @@ div.download-document-format-list-menu{\n
border: 1px solid #A8A799;\n
background-color: #FFFFFF;\n
}\n
\n
div.download-document-format-list-container span:hover,\n
div.download-document-format-list-menu ul li:hover{\n
background-color: #A8A799;\n
......@@ -1564,7 +1565,9 @@ div.download-document-format-list-menu ul li.separator{\n
padding-bottom:3px;\n
}\n
\n
\n
div.download-document-format-list-menu ul li.toggle-hidden-format-dialog-selection-link{\n
height:20px;\n
}\n
\n
......
......@@ -15,7 +15,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts78059655.7</string> </value>
<value> <string>ts78681256.09</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -70,6 +70,11 @@ function toggleElement(tag_name, class_name){\n
MochiKit.Visual.toggle(dom_element);\n
}\n
\n
function toggleHiddenFormatDialogSelection(){\n
toggleElement(\'div\', \'download-document-format-list-menu-hidden\');\n
MochiKit.DOM.removeElement(MochiKit.DOM.getFirstElementByTagAndClassName(\'li\', \'toggle-hidden-format-dialog-selection-link\'));\n
}\n
\n
MochiKit.DOM.addLoadEvent(setScreenClass);\n
connect(window, "onresize", setScreenClass);\n
\n
......@@ -88,7 +93,7 @@ function setScreenClass(){\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1540</int> </value>
<value> <int>1787</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -48,15 +48,40 @@
\n
<div class="download-document-format-list-container"\n
tal:define="target_format_item_list python: here.getTargetFormatItemList();\n
document_url here/absolute_url">\n
<span onClick="javascript:toggleElement(\'div\', \'download-document-format-list-menu\');"> Download</span>\n
document_url here/absolute_url;\n
list_index python: 5">\n
<span i18n:domain="erp5_ui" \n
i18n:translate=""\n
onClick="javascript:toggleElement(\'div\', \'download-document-format-list-menu\');"> Download</span>\n
<div class="download-document-format-list-menu" style="opacity: 0.999999; display: none;">\n
<ul>\n
<li class="separator"><a tal:attributes="href document_url"> Original </a></li>\n
<li tal:repeat="target_format_item target_format_item_list">\n
<a tal:attributes="href python: \'%s?format=%s\' %(document_url, target_format_item[1])"\n
<li class="separator">\n
<a tal:attributes="href document_url"\n
i18n:domain="erp5_ui" \n
i18n:translate=""\n
title="Download in original format">Original</a>\n
</li>\n
<li tal:repeat="target_format_item python: target_format_item_list[:list_index]">\n
<a tal:attributes="href python: \'%s?format=%s\' %(document_url, target_format_item[1]);\n
title python: \'Download in %s format\' %target_format_item[0];"\n
tal:content="python: target_format_item[0]"/>\n
</li>\n
<!-- Show more than list_index in initially hidden div -->\n
<tal:block tal:condition="python: len(target_format_item_list)>list_index">\n
<div class="download-document-format-list-menu-hidden" style="opacity: 0.999999; display: none;">\n
<li tal:repeat="target_format_item python: target_format_item_list[list_index:]">\n
<a tal:attributes="href python: \'%s?format=%s\' %(document_url, target_format_item[1]);\n
title python: \'Download in %s format\' %target_format_item[0];"\n
tal:content="python: target_format_item[0]"/>\n
</li>\n
</div>\n
<li class="toggle-hidden-format-dialog-selection-link">\n
<span onClick="javascript:toggleHiddenFormatDialogSelection();"\n
i18n:domain="erp5_ui" \n
i18n:translate=""\n
title="Show more download formats"> More... </span>\n
</li>\n
</tal:block>\n
</ul>\n
</div>\n
\n
......
......@@ -60,7 +60,7 @@
</tal:block>\n
\n
<tal:block tal:condition="python: len(section_list)==0">\n
<p i18n:domain="erp5_ui" i18n:translate=""> No subsections found. </p>\n
<p i18n:domain="erp5_ui" i18n:translate=""> No subsections found. </p>\n
</tal:block>\n
\n
</div>\n
......
1489
\ No newline at end of file
1491
\ 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