[views/navigation] use the proper icons instead of ascii art (closes #1624943) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 07 Sep 2011 16:56:27 +0200
branchstable
changeset 7766 a832677c0aa6
parent 7765 6f6253e44bdd
child 7767 07c74f5585d1
[views/navigation] use the proper icons instead of ascii art (closes #1624943)
web/views/navigation.py
--- a/web/views/navigation.py	Tue Sep 06 15:29:05 2011 +0200
+++ b/web/views/navigation.py	Wed Sep 07 16:56:27 2011 +0200
@@ -211,6 +211,14 @@
     context = 'navbottom'
     order = 10
 
+    @property
+    def prev_icon(self):
+        return '<img src="%s"/>' % xml_escape(self._cw.data_url('go_prev.png'))
+
+    @property
+    def next_icon(self):
+        return '<img src="%s"/>' % xml_escape(self._cw.data_url('go_next.png'))
+
     def init_rendering(self):
         adapter = self.entity.cw_adapt_to('IPrevNext')
         self.previous = adapter.previous_entity()
@@ -232,16 +240,19 @@
 
     def prevnext_entity(self, w, entity, type):
         textsize = self._cw.property_value('navigation.short-line-size')
+        content = xml_escape(cut(entity.dc_title(), textsize))
         if type == 'prev':
             title = self._cw._('i18nprevnext_previous')
-            icon = u'&lt;&lt; '
+            icon = self.prev_icon
             cssclass = u'previousEntity left'
+            content = icon + content
         else:
             title = self._cw._('i18nprevnext_next')
-            icon = u'&gt;&gt; '
+            icon = self.next_icon
             cssclass = u'nextEntity right'
+            content = content + '&#160;&#160;' + icon
         self.prevnext_div(w, type, cssclass, entity.absolute_url(),
-                          title, icon + xml_escape(cut(entity.dc_title(), textsize)))
+                          title, content)
 
     def prevnext_div(self, w, type, cssclass, url, title, content):
         w(u'<div class="%s">' % cssclass)