diff rhodecode/lib/helpers.py @ 990:7a1df0130533 beta

moved tooltip function from the for loop and from templates to helpers
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 01 Feb 2011 15:19:42 +0100
parents 63c91390853c
children d14723711d17
line wrap: on
line diff
--- a/rhodecode/lib/helpers.py	Tue Feb 01 02:18:05 2011 +0100
+++ b/rhodecode/lib/helpers.py	Tue Feb 01 15:19:42 2011 +0100
@@ -593,3 +593,13 @@
             u_str = unicode(str(str).encode('string_escape'))
 
     return u_str
+
+def changed_tooltip(nodes):
+    if nodes:
+        pref = ': <br/> '
+        suf = ''
+        if len(nodes) > 30:
+            suf = '<br/>' + _(' and %s more') % (len(nodes) - 30)
+        return literal(pref + '<br/> '.join([x.path for x in nodes[:30]]) + suf)
+    else:
+        return ': ' + _('No Files')