Commit 478b8a68 authored by Fabien Morin's avatar Fabien Morin

* add the following condition : <tal:block tal:condition="python:...

* add the following condition : <tal:block tal:condition="python: here.total_pages > 1"> to not display the page navigation if there is only one page. This permit to increase performances in case there only one page.
* change all the indentation due to this new condition

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26840 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b2692f05
...@@ -44,114 +44,116 @@ ...@@ -44,114 +44,116 @@
xmlns:metal="http://xml.zope.org/namespaces/metal"\n xmlns:metal="http://xml.zope.org/namespaces/metal"\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n">\n xmlns:i18n="http://xml.zope.org/namespaces/i18n">\n
<tal:block metal:define-macro="page_navigation">\n <tal:block metal:define-macro="page_navigation">\n
<tal:block tal:condition="not: is_gadget_mode">\n <tal:block tal:condition="python: here.total_pages > 1">\n
<tal:block tal:condition="python: here.current_page > 0">\n <tal:block tal:condition="not: is_gadget_mode">\n
<input\n <tal:block tal:condition="python: here.current_page > 0">\n
id="listbox_first_page" type="image" src="2leftarrowv.png"\n <input\n
title="First Page" name="firstPage:method"\n id="listbox_first_page" type="image" src="2leftarrowv.png"\n
class="listbox_first_page"\n title="First Page" name="firstPage:method"\n
tal:attributes="id string:${field_id}_first_page;\n class="listbox_first_page"\n
name string:${field_id}_firstPage:method;\n tal:attributes="id string:${field_id}_first_page;\n
src string:${portal_url_string}/images/2leftarrowv.png"\n name string:${field_id}_firstPage:method;\n
i18n:domain="ui" i18n:attributes="title" />\n src string:${portal_url_string}/images/2leftarrowv.png"\n
<input\n i18n:domain="ui" i18n:attributes="title" />\n
id="listbox_previous_page" type="image" src="1leftarrowv.png"\n <input\n
title="Previous Page" name="previousPage:method"\n id="listbox_previous_page" type="image" src="1leftarrowv.png"\n
class="listbox_previous_page"\n title="Previous Page" name="previousPage:method"\n
tal:attributes="id string:${field_id}_previous_page;\n class="listbox_previous_page"\n
name string:${field_id}_previousPage:method;\n tal:attributes="id string:${field_id}_previous_page;\n
src string:${portal_url_string}/images/1leftarrowv.png"\n name string:${field_id}_previousPage:method;\n
i18n:domain="ui" i18n:attributes="title" />\n src string:${portal_url_string}/images/1leftarrowv.png"\n
i18n:domain="ui" i18n:attributes="title" />\n
</tal:block>\n
<input id="listbox_set_page" name="page_start" onblur="this.value=this.defaultValue"\n
tal:attributes="id string:${field_id}_set_page;\n
name string:${field_id}_page_start;\n
value python:here.current_page + 1;\n
size python:len(str(here.total_pages));\n
onkeyup string:submitFormOnEnter(event, this.form, \'${field_id}_setPage\')" />\n
/ \n
<tal:block content="here/total_pages" />\n
<tal:block tal:condition="python: here.current_page < here.total_pages - 1">\n
<input\n
id="listbox_next_page" type="image" src="1rightarrowv.png"\n
title="Next Page" name="nextPage:method" class="listbox_next_page"\n
tal:attributes="id string:${field_id}_next_page;\n
name string:${field_id}_nextPage:method;\n
src string:${portal_url_string}/images/1rightarrowv.png"\n
i18n:domain="ui" i18n:attributes="title" />\n
<input\n
id="listbox_last_page" type="image" src="2rightarrowv.png"\n
title="Last Page" name="lastPage:method" class="listbox_last_page"\n
tal:attributes="id string:${field_id}_last_page;\n
name string:${field_id}_lastPage:method;\n
src string:${portal_url_string}/images/2rightarrowv.png"\n
i18n:domain="ui" i18n:attributes="title" />\n
</tal:block>\n
</tal:block>\n </tal:block>\n
<input id="listbox_set_page" name="page_start" onblur="this.value=this.defaultValue"\n \n
tal:attributes="id string:${field_id}_set_page;\n <tal:block tal:condition="is_gadget_mode"\n
name string:${field_id}_page_start;\n tal:define="max_lines python: here.getMaxLineNumber();\n
value python:here.current_page + 1;\n total_page python: here.total_pages;\n
size python:len(str(here.total_pages));\n page_id python: here.current_page;\n
onkeyup string:submitFormOnEnter(event, this.form, \'${field_id}_setPage\')" />\n current_page python: page_id + 1;\n
/ \n previous_page python: current_page - 1;\n
<tal:block content="here/total_pages" />\n next_page python: current_page + 1;">\n
<tal:block tal:condition="python: here.current_page < here.total_pages - 1">\n <tal:block tal:condition="python: here.current_page > 0">\n
<input\n <button tal:define ="params python: {field_id+\'_firstPage:method\':\'\', \'list_style\':list_style}"\n
id="listbox_next_page" type="image" src="1rightarrowv.png"\n title="First Page" \n
title="Next Page" name="nextPage:method" class="listbox_next_page"\n name="firstPage"\n
tal:attributes="id string:${field_id}_next_page;\n type = "button" \n
name string:${field_id}_nextPage:method;\n class = "listbox_first_page"\n
src string:${portal_url_string}/images/1rightarrowv.png"\n tal:attributes="id string:${field_id}_first_page;\n
i18n:domain="ui" i18n:attributes="title" />\n value string:|&lt;;\n
<input\n onclick python:\n
id="listbox_last_page" type="image" src="2rightarrowv.png"\n real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n
title="Last Page" name="lastPage:method" class="listbox_last_page"\n i18n:domain="ui" i18n:attributes="title">\n
tal:attributes="id string:${field_id}_last_page;\n <span class="image"/>\n
name string:${field_id}_lastPage:method;\n </button>\n
src string:${portal_url_string}/images/2rightarrowv.png"\n <button tal:define ="params python: {field_id+\'_previousPage:method\':\'\',\'page_start\':here.current_page+1,\'list_style\':list_style}"\n
i18n:domain="ui" i18n:attributes="title" />\n title="Previous Page"\n
</tal:block>\n name="previousPage"\n
</tal:block>\n type="button"\n
\n class="listbox_previous_page"\n
<tal:block tal:condition="is_gadget_mode"\n tal:attributes="id string:${field_id}_previous_page;\n
tal:define="max_lines python: here.getMaxLineNumber();\n value string:&lt;&lt;;\n
total_page python: here.total_pages;\n onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n
page_id python: here.current_page;\n i18n:domain="ui" i18n:attributes="title">\n
current_page python: page_id + 1;\n \n
previous_page python: current_page - 1;\n <span class="image"/>\n
next_page python: current_page + 1;">\n </button>\n
<tal:block tal:condition="python: here.current_page > 0">\n </tal:block>\n
<button tal:define ="params python: {field_id+\'_firstPage:method\':\'\', \'list_style\':list_style}"\n <input id="listbox_set_page" name="page_start"\n
title="First Page" \n tal:define="params python: {field_id+\'_setPage:method\':\'\',field_id+\'_page_start\':\'this.value\',\'list_style\':list_style}"\n
name="firstPage"\n tal:attributes=\'id string:${field_id}_set_page;\n
type = "button" \n name string:${field_id}_page_start;\n
class = "listbox_first_page"\n value python:here.current_page + 1;\n
tal:attributes="id string:${field_id}_first_page;\n size python:len(str(here.total_pages));\n
value string:|&lt;;\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
onclick python:\n / \n
real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n <tal:block content="here/total_pages" />\n
i18n:domain="ui" i18n:attributes="title">\n <tal:block tal:condition="python: current_page < total_page">\n
<span class="image"/>\n <button tal:define ="params python: {field_id+\'_nextPage:method\':\'\',\'page_start\':here.current_page+1,\'list_style\':list_style}"\n
</button>\n title="Next Page"\n
<button tal:define ="params python: {field_id+\'_previousPage:method\':\'\',\'page_start\':here.current_page+1,\'list_style\':list_style}"\n name="nextPage"\n
title="Previous Page"\n type="button"\n
name="previousPage"\n class="listbox_next_page"\n
type="button"\n tal:attributes="id string:${field_id}_next_page;\n
class="listbox_previous_page"\n onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n
tal:attributes="id string:${field_id}_previous_page;\n i18n:domain="ui" i18n:attributes="title">\n
value string:&lt;&lt;;\n <span class="image"/>\n
onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n </button>\n
i18n:domain="ui" i18n:attributes="title">\n <button tal:define ="params python: {field_id+\'_lastPage:method\':\'\',\'total_size\':int(here.total_size), \'list_style\':list_style}"\n
\n title="Last Page"\n
<span class="image"/>\n name="lastPage"\n
</button>\n type="button"\n
</tal:block>\n class="listbox_last_page"\n
<input id="listbox_set_page" name="page_start"\n tal:attributes="id string:${field_id}_last_page;\n
tal:define="params python: {field_id+\'_setPage:method\':\'\',field_id+\'_page_start\':\'this.value\',\'list_style\':list_style}"\n onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n
tal:attributes=\'id string:${field_id}_set_page;\n i18n:domain="ui" i18n:attributes="title">\n
name string:${field_id}_page_start;\n <span class="image"/>\n
value python:here.current_page + 1;\n </button>\n
size python:len(str(here.total_pages));\n </tal:block>\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
/ \n
<tal:block content="here/total_pages" />\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="id string:${field_id}_next_page;\n
onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\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="id string:${field_id}_last_page;\n
onclick python: real_context.KnowledgePad_generateAjaxCall(context_url+\'/\'+form_id,box,dom_id,params)"\n
i18n:domain="ui" i18n:attributes="title">\n
<span class="image"/>\n
</button>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
</tal:block>\n </tal:block>\n
......
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