Commit 865adb19 authored by Kevin Deldycke's avatar Kevin Deldycke

Update Next Page, Previous Page button.

Add First Page, Last Page button.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8701 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 69a9413b
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
<input type="hidden" name="selection_name" tal:attributes="value selection_name" tal:condition="selection_name"/>\n <input type="hidden" name="selection_name" tal:attributes="value selection_name" tal:condition="selection_name"/>\n
<input type="hidden" name="selection_index" tal:attributes="value selection_index" tal:condition="selection_index"/>\n <input type="hidden" name="selection_index" tal:attributes="value selection_index" tal:condition="selection_index"/>\n
<input type="hidden" name="reset" value="1"/>\n <input type="hidden" name="reset" value="1"/>\n
<input type="hidden" name="listbox_uid:list" value="" tal:attributes="name string:${field_id}_uid:list"/>\n
<input type="hidden" name="total_size" value="" tal:attributes="value here/total_size"/>\n
<input id="listbox_select" tal:attributes="id string: ${field_id}_select"\n <input id="listbox_select" tal:attributes="id string: ${field_id}_select"\n
title="Filter" alt="Filter" name="Base_doSelect:method"\n title="Filter" alt="Filter" name="Base_doSelect:method"\n
type="submit" style="visibility: hidden"/>\n type="submit" style="visibility: hidden"/>\n
...@@ -161,40 +163,47 @@ ...@@ -161,40 +163,47 @@
</tr>\n </tr>\n
</thead>\n </thead>\n
\n \n
<tal:replace tal:content="nothing">\n
TODO: Move pagination pre-calcultion higher in that code.\n
</tal:replace>\n
<tfoot tal:condition="python: int(here.total_size) > int(here.getMaxLineNumber())">\n <tfoot tal:condition="python: int(here.total_size) > int(here.getMaxLineNumber())">\n
<tr>\n <tr tal:define="max_lines python: here.getMaxLineNumber();\n
<td tal:attributes="colspan python: len(here.getSelectedColumnList())">\n total_page python: here.total_pages;\n
<a class="pageNavigation" href="portal_selections/firstPage:method"\n page_id python: here.current_page;\n
tal:condition="python: here.current_page > 0"\n current_page python: page_id + 1;\n
title="First page: Page 1">|&lt;</a>\n previous_page python: current_page - 1;\n
<a class="pageNavigation" href="portal_selections/previousPage:method"\n next_page python: current_page + 1;\n
tal:condition="python: here.current_page > 0"\n ">\n
tal:attributes="title python: \'Previous Page: page \' + str(here.current_page - 1)"\n <td class="pageNavigation"\n
title="Previous page: Page 67">&lt;&lt;</a>\n tal:attributes="colspan python: len(here.getSelectedColumnList())">\n
<select id="listbox_page_selection" name="list_start" title="Change Page" size="1"\n <tal:block tal:condition="python: current_page > 1">\n
onChange="submitAction(this.form, \'context/portal_selections/setPage\')"\n <button title="First page: Page 1" name="portal_selections/firstPage:method"\n
tal:define="lines here/getMaxLineNumber"\n tal:attributes="id string: ${field_id}_first_page;">|&lt;</button>\n
tal:attributes="id string:${field_id}_page_selection;\n <button name="portal_selections/previousPage:method"\n
onChange string:submitAction(this.form, \'${context_url}/portal_selections/setPage\')"\n tal:attributes="title python: \'Previous Page: page %s\' % previous_page;\n
id string: ${field_id}_previous_page;">&lt;&lt;</button>\n
</tal:block>\n
<select\n
name="list_start" title="Change Page" size="1"\n
tal:attributes="id string: ${field_id}_page_selection;\n
onChange string: submitAction(this.form, \'${context_url}/portal_selections/setPage\')"\n
i18n:domain="ui" i18n:attributes="title">\n i18n:domain="ui" i18n:attributes="title">\n
<option\n <option\n
tal:repeat="p python: range(0, here.total_pages)"\n tal:repeat="p python: range(total_page)"\n
tal:attributes="selected python: p == here.current_page;\n tal:attributes="selected python: p == page_id;\n
value python: p * lines"\n value python: p * max_lines"\n
i18n:domain="ui" i18n:translate="">\n i18n:domain="ui" i18n:translate="">Page <tal:block tal:replace="python: p + 1" i18n:name="page">0</tal:block> of <tal:block tal:replace="total_page" i18n:name="total_pages">1</tal:block></option>\n
Page <tal:block tal:replace="python: p + 1" i18n:name="page">0</tal:block>\n
of <tal:block tal:replace="here/total_pages" i18n:name="total_pages">1</tal:block>\n
</option>\n
</select>\n </select>\n
<a class="pageNavigation"\n <tal:block tal:condition="python: current_page < total_page">\n
href="nextPage:method"\n <button\n
tal:condition="python: here.current_page + 1 < here.total_pages"\n name="portal_selections/nextPage:method"\n
tal:attributes="title python: \'Next page: Page \' + str(here.current_page + 1)"\n tal:attributes="title python: \'Next page: Page %s\' % next_page;\n
>&gt;&gt;</a>\n id string: ${field_id}_next_page;">&gt;&gt;</button>\n
<a class="pageNavigation"\n <button\n
tal:condition="python: here.current_page + 1 < here.total_pages"\n name="portal_selections/lastPage:method"\n
href="portal_selections/lastPage:method"\n tal:attributes="title python: \'Last page: Page %s\' % total_page;\n
tal:attributes="title python: \'Last page: Page \' + str(here.total_pages)">&gt;|</a>\n id string: ${field_id}_last_page;">&gt;|</button>\n
</tal:block>\n
</td>\n </td>\n
</tr>\n </tr>\n
</tfoot>\n </tfoot>\n
...@@ -209,10 +218,6 @@ ...@@ -209,10 +218,6 @@
editable_field_css python: editable_field != None and editable_field.get_value(\'css_class\');\n editable_field_css python: editable_field != None and editable_field.get_value(\'css_class\');\n
empty python: original_value in (\'\', None)"\n empty python: original_value in (\'\', None)"\n
tal:attributes="class python: empty and \'emptyCell\' or nothing">\n tal:attributes="class python: empty and \'emptyCell\' or nothing">\n
<input tal:condition="not: repeat/value/index"\n
type="hidden" value="1" name="listbox_uid:list"\n
tal:attributes="value python: line.getUid() or \'\';\n
name string:${field_id}_uid:list" />\n
<tal:block tal:condition="empty"><span tal:attributes="class editable_field_css">-</span></tal:block>\n <tal:block tal:condition="empty"><span tal:attributes="class editable_field_css">-</span></tal:block>\n
<tal:block tal:condition="not: empty" tal:replace="structure html">value</tal:block>\n <tal:block tal:condition="not: empty" tal:replace="structure html">value</tal:block>\n
</td>\n </td>\n
...@@ -227,8 +232,7 @@ ...@@ -227,8 +232,7 @@
</tal:block>\n </tal:block>\n
<!-- ListBox ends here -->\n <!-- ListBox ends here -->\n
\n \n
</tal:block>\n </tal:block>
]]></string> </value> ]]></string> </value>
</item> </item>
......
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