diff -r 108c87e0538c -r 53f38d39287f web/component.py
--- a/web/component.py Fri May 06 08:52:09 2011 +0200
+++ b/web/component.py Fri May 06 11:07:05 2011 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
@@ -57,8 +57,6 @@
page_link_templ = u'%s'
selected_page_link_templ = u'%s'
previous_page_link_templ = next_page_link_templ = page_link_templ
- no_previous_page_link = u'<<'
- no_next_page_link = u'>>'
def __init__(self, req, rset, **kwargs):
super(NavigationComponent, self).__init__(req, rset=rset, **kwargs)
@@ -131,7 +129,33 @@
return self.selected_page_link_templ % (url, content, content)
return self.page_link_templ % (url, content, content)
- def previous_link(self, path, params, content='<<', title=_('previous_results')):
+ @property
+ def prev_icon_url(self):
+ return xml_escape(self._cw.data_url('go_prev.png'))
+
+ @property
+ def next_icon_url(self):
+ return xml_escape(self._cw.data_url('go_next.png'))
+
+ @property
+ def no_previous_page_link(self):
+ return u'
' % self.prev_icon_url
+
+ @property
+ def no_next_page_link(self):
+ return u'
' % self.next_icon_url
+
+ @property
+ def no_content_prev_link(self):
+ return '
' % self.prev_icon_url
+
+ @property
+ def no_content_next_link(self):
+ return '
' % self.next_icon_url
+
+ def previous_link(self, path, params, content=None, title=_('previous_results')):
+ if not content:
+ content = self.no_content_prev_link
start = self.starting_from
if not start :
return self.no_previous_page_link
@@ -140,7 +164,9 @@
url = xml_escape(self.page_url(path, params, start, stop))
return self.previous_page_link_templ % (url, title, content)
- def next_link(self, path, params, content='>>', title=_('next_results')):
+ def next_link(self, path, params, content=None, title=_('next_results')):
+ if not content:
+ content = self.no_content_next_link
start = self.starting_from + self.page_size
if start >= self.total:
return self.no_next_page_link