Commit 13c4c516 authored by Ivan Tyagov's avatar Ivan Tyagov

Use Page Templates for listbox page navigation.

Do not use HTML Id's for "select" listbox action icon.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39945 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4a5e4568
......@@ -77,8 +77,8 @@
show_listbox_tree_mode_selection python: not is_gadget_mode and \n
(is_domain_tree_supported or is_report_tree_supported);\n
show_list_action_link python: here.field.get_value(\'list_action\');\n
page_navigation_mode python: request.get(\'page_navigation_mode\', here.getPageNavigationMode());\n
is_slider_mode python: page_navigation_mode in (\'\', \'slider\');\n
page_navigation_template python: request.get(\'page_navigation_template\', here.getPageNavigationTemplate());\n
is_slider_mode python: \'Slider\' in page_navigation_template;\n
is_default_listbox_field python: field_id==\'listbox\';">\n
\n
<!-- Define hidden input. -->\n
......@@ -364,9 +364,9 @@
<!--Select cell -->\n
<th tal:condition="show_select_column"\n
class="listbox-table-select-cell">\n
<input id="listbox_select" type="image"\n
<input class="listbox-select-action" type="image"\n
title="Action" alt="Action" name="Base_doSelect:method"\n
tal:attributes="id string:${field_id}_select;\n
tal:attributes="class string:${field_id}-select-action;\n
src string:${portal_url_string}/images/exec16.png"\n
i18n:domain="ui" i18n:attributes="title" />\n
</th>\n
......
......@@ -186,16 +186,165 @@
tal:define="class python: test(is_slider_mode, \'listbox-page-navigation listbox-page-navigation-slider\',\'listbox-page-navigation listbox-page-navigation-text\');"\n
tal:attributes="class class">\n
\n
<tal:block tal:condition="is_slider_mode">\n
<tal:block metal:use-macro="real_context/page_navigation_render/macros/page_navigation" />\n
</tal:block> \n
\n
<tal:block tal:condition="not: is_slider_mode">\n
<tal:block metal:use-macro="real_context/page_navigation_render/macros/text_navigation" />\n
</tal:block> \n
<tal:block metal:use-macro="python: getattr(real_context, page_navigation_template).macros[\'page_navigation\']" />\n
\n
</div>\n
\n
<!-- Listbox Macros -->\n
<!-- First & Previous button navigation --> \n
<tal:block metal:define-macro="first_previous_page_navigation">\n
\n
<tal:block tal:condition="python: here.current_page > 0">\n
<button type="submit"\n
title="First Page" name="firstPage:method"\n
class="listbox_first_page"\n
tal:attributes="name string:${field_id}_firstPage:method;\n
class python: test(is_default_listbox_field, \'listbox_first_page\', \'listbox_first_page %s_first_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n
</button>\n
<button type="submit"\n
title="Previous Page" name="previousPage:method"\n
class="listbox_previous_page"\n
tal:attributes="name string:${field_id}_previousPage:method;\n
class python: test(is_default_listbox_field, \'listbox_previous_page\', \'listbox_previous_page %s_previous_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n
</button>\n
\n
</tal:block>\n
\n
</tal:block>\n
\n
<!-- Next & Last button navigation --> \n
<tal:block metal:define-macro="next_last_page_navigation">\n
\n
<tal:block tal:condition="python: here.current_page < here.total_pages - 1">\n
<button type="submit"\n
title="Next Page" name="nextPage:method" class="listbox_next_page"\n
tal:attributes="name string:${field_id}_nextPage:method;\n
class python: test(is_default_listbox_field, \'listbox_next_page\', \'listbox_next_page %s_next_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n
</button>\n
<button type="submit"\n
title="Last Page" name="lastPage:method" class="listbox_last_page"\n
tal:attributes="name string:${field_id}_lastPage:method;\n
class python: test(is_default_listbox_field, \'listbox_last_page\', \'listbox_last_page %s_last_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title" >\n
<span class="image"/>\n
</button>\n
\n
</tal:block>\n
\n
</tal:block>\n
\n
<!-- First & Previous button navigation (asynchronous mode) --> \n
<tal:block metal:define-macro="first_previous_page_navigation_asynchronous">\n
\n
<tal:block tal:condition="python: here.current_page > 0">\n
<button tal:define ="params python: {field_id+\'_firstPage:method\':\'\', \'list_style\':list_style}"\n
title="First Page" \n
name="firstPage"\n
type = "button" \n
class = "listbox_first_page"\n
tal:attributes="value string:|&lt;;\n
onclick python:\n
real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params);\n
class python: test(is_default_listbox_field, \'listbox_first_page\', \'listbox_first_page %s_first_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n
</button>\n
<button tal:define ="params python: {field_id+\'_previousPage:method\':\'\',\'page_start\':here.current_page+1,\'list_style\':list_style}"\n
title="Previous Page"\n
name="previousPage"\n
type="button"\n
class="listbox_previous_page"\n
tal:attributes="value string:&lt;&lt;;\n
onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params);\n
class python: test(is_default_listbox_field, \'listbox_previous_page\', \'listbox_previous_page %s_previous_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n
</button>\n
</tal:block>\n
\n
</tal:block>\n
\n
<!-- Next & Last button navigation (asynchronous mode) --> \n
<tal:block metal:define-macro="next_last_page_navigation_asynchronous">\n
\n
<tal:block tal:condition="python: current_page < total_page">\n
<button tal:define ="params python: {field_id+\'_nextPage:method\':\'\',\'page_start\':here.current_page+1,\'list_style\':list_style}"\n
title="Next Page"\n
name="nextPage"\n
type="button"\n
class="listbox_next_page"\n
tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params);\n
class python: test(is_default_listbox_field, \'listbox_next_page\', \'listbox_next_page %s_next_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n
</button>\n
<button tal:define ="params python: {field_id+\'_lastPage:method\':\'\',\'total_size\':int(here.total_size), \'list_style\':list_style}"\n
title="Last Page"\n
name="lastPage"\n
type="button"\n
class="listbox_last_page"\n
tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params);\n
class python: test(is_default_listbox_field, \'listbox_last_page\', \'listbox_last_page %s_last_page\' %field_id)"\n
i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n
</button>\n
</tal:block>\n
\n
</tal:block>\n
\n
<!-- Type in listbox navigation --> \n
<tal:block metal:define-macro="type_in_page_navigation">\n
<input class="listbox_set_page" \n
name="page_start" onblur="this.value=this.defaultValue"\n
tal:attributes="name string:${field_id}_page_start;\n
class python: test(is_default_listbox_field, \'listbox_set_page\', \'listbox_set_page %s_set_page\' %field_id);\n
value python:here.current_page + 1;\n
size python:len(str(here.total_pages));\n
onkeypress string:submitFormOnEnter(event, this.form, \'${field_id}_setPage\')" />\n
/ <tal:block content="here/total_pages" />\n
</tal:block>\n
\n
</div>
<!-- Type in listbox page number navigation (asyncronous) --> \n
<tal:block metal:define-macro="type_in_page_navigation_asynchronous">\n
\n
<input class="listbox_set_page" \n
name="page_start" onblur="this.value=this.defaultValue"\n
tal:define="params python: {field_id+\'_setPage:method\':\'\',field_id+\'_page_start\':\'this.value\',\'list_style\':list_style}"\n
tal:attributes=\'name string:${field_id}_page_start;\n
class python: test(is_default_listbox_field, "listbox_set_page", "listbox_set_page %s_set_page" %field_id);\n
value python:here.current_page + 1;\n
size python:len(str(here.total_pages));\n
onkeypress python:"if(event.keyCode==13){" + real_context.KnowledgePad_generateAjaxCall(context_url+"/"+form_id,box,dom_id,params).replace("\\"this.value\\"","this.value")+ "return false;;}"\'/>\n
/ <tal:block content="here/total_pages" />\n
</tal:block>\n
\n
<!-- Show list of direct listbox page selection -->\n
<tal:block metal:define-macro="text_link_page_navigation">\n
<tal:block tal:repeat="page_index page_index_list ">\n
<a tal:attributes="href python: \'%s_setPage?%s_page_start=%s&list_selection_name=%s&listbox_uid:list=[]\' %(field_id, field_id, page_index, selection_name);\n
class python: test(page_index==current_page, \'selected\', \'\');\n
title string:Page ${page_index}"\n
tal:content="page_index"/>\n
</tal:block>\n
</tal:block>\n
\n
<!-- Show list of direct listbox page selection (asynchronous) -->\n
<tal:block metal:define-macro="text_link_page_navigation_asynchronous">\n
<tal:block tal:repeat="page_index page_index_list ">\n
<a tal:define="params python: {field_id+\'_setPage:method\':\'\',field_id+\'_page_start\':page_index,\'list_style\':list_style, \'list_selection_name\':selection_name, \'listbox_uid\':[]}"\n
tal:attributes="onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params);\n
class python: test(page_index==current_page, \'selected\', \'\');\n
title string:Page ${page_index}"\n
tal:content="page_index"/>\n
</tal:block>\n
</tal:block>\n
<!-- Listbox Navigation Macros -->
]]></unicode> </value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<!-- Slider navigation with input (i.e. first, previous, next, last links)-->\n
<tal:block metal:define-macro="page_navigation">\n
<tal:block tal:condition="python: here.total_pages > 1">\n
\n
<!-- Non gadget mode -->\n
<tal:block tal:condition="not: is_gadget_mode">\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/first_previous_page_navigation" />\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/type_in_page_navigation" />\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/next_last_page_navigation" />\n
</tal:block>\n
\n
<!-- Gadget mode -->\n
<tal:block tal:condition="is_gadget_mode"\n
tal:define="max_lines python: here.getMaxLineNumber();\n
total_page python: here.total_pages;\n
page_id python: here.current_page;\n
current_page python: page_id + 1;\n
previous_page python: current_page - 1;\n
next_page python: current_page + 1;">\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/first_previous_page_navigation_asynchronous" />\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/type_in_page_navigation_asynchronous" />\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/next_last_page_navigation_asynchronous" />\n
</tal:block>\n
</tal:block>\n
</tal:block>
]]></unicode> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ListBox_viewSliderPageNavigationRenderer</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[
<!-- Text navigation (i.e. 1 2 3 4 .. n links)-->\n
<tal:block metal:define-macro="page_navigation"\n
tal:define="offset python: 7;\n
all_page_index_list python: range(1, here.total_pages + 1);\n
page_index_list python: all_page_index_list[max(current_page-offset, 1)-1: min(current_page+offset, len(all_page_index_list))];">\n
\n
<!-- Non gadget mode -->\n
<tal:block tal:condition="not: is_gadget_mode">\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/first_previous_page_navigation" />\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/text_link_page_navigation" />\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/next_last_page_navigation" />\n
</tal:block>\n
\n
<!-- Gadget mode -->\n
<tal:block tal:condition="is_gadget_mode"\n
tal:define="max_lines python: here.getMaxLineNumber();\n
total_page python: here.total_pages;\n
page_id python: here.current_page;\n
current_page python: page_id + 1;\n
previous_page python: current_page - 1;\n
next_page python: current_page + 1;">\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/first_previous_page_navigation_asynchronous" />\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/text_link_page_navigation_asynchronous" />\n
<tal:block metal:use-macro="real_context/ListBox_asHTMLLibrary/macros/next_last_page_navigation_asynchronous" />\n
</tal:block>\n
\n
</tal:block>
]]></unicode> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ListBox_viewTextPageNavigationRenderer</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -729,6 +729,12 @@ table.listbox input{\n
float:none;\n
}\n
\n
table.listbox input.listbox-check-all,\n
table.listbox input.listbox-uncheck-all,\n
table.listbox input.listbox-select-action{\n
width:auto;\n
}\n
\n
.listbox-table-data-cell > .figure{\n
float:right;\n
display:block;\n
......
1040
\ No newline at end of file
1043
\ 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