# HG changeset patch # User Aurelien Campeas # Date 1304672825 -7200 # Node ID 53f38d39287fc230147881371107897268ca6716 # Parent 108c87e0538c0452280b36c9dfec81f904298f19 [nav component/cosmetics] have nice looking arrows insteads of << / >> 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 diff -r 108c87e0538c -r 53f38d39287f web/data/cubicweb.css --- a/web/data/cubicweb.css Fri May 06 08:52:09 2011 +0200 +++ b/web/data/cubicweb.css Fri May 06 11:07:05 2011 +0200 @@ -120,6 +120,19 @@ border: none; } + +img.prevnext { + width: 22px; + height: 22px; +} + +img.prevnext_nogo { + width: 22px; + height: 22px; + filter:alpha(opacity=25); /* IE */ + opacity:.25; +} + fieldset { border: none; } diff -r 108c87e0538c -r 53f38d39287f web/data/cubicweb.old.css --- a/web/data/cubicweb.old.css Fri May 06 08:52:09 2011 +0200 +++ b/web/data/cubicweb.old.css Fri May 06 11:07:05 2011 +0200 @@ -69,6 +69,18 @@ text-align: center; } +img.prevnext { + width: 22px; + height: 22px; +} + +img.prevnext_nogo { + width: 22px; + height: 22px; + filter:alpha(opacity=25); /* IE */ + opacity:.25; +} + p { margin: 0em 0px 0.2em; padding-top: 2px; diff -r 108c87e0538c -r 53f38d39287f web/data/go_next.png Binary file web/data/go_next.png has changed diff -r 108c87e0538c -r 53f38d39287f web/data/go_prev.png Binary file web/data/go_prev.png has changed diff -r 108c87e0538c -r 53f38d39287f web/views/navigation.py --- a/web/views/navigation.py Fri May 06 08:52:09 2011 +0200 +++ b/web/views/navigation.py Fri May 06 11:07:05 2011 +0200 @@ -40,10 +40,10 @@ self.clean_params(params) basepath = self._cw.relative_path(includeparams=False) self.w(u'') def index_display(self, start, stop): @@ -74,12 +74,12 @@ basepath = self._cw.relative_path(includeparams=False) w = self.w w(u'')