# HG changeset patch # User Marcin Kuzminski # Date 2011-02-01 14:19:42 # Node ID 7a1df0130533de6d5c52d28adffe53bec5b4fe99 # Parent 801cdb3e0969e040f5afde4863fc2fc59ecf5278 moved tooltip function from the for loop and from templates to helpers diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -593,3 +593,13 @@ def safe_unicode(str): u_str = unicode(str(str).encode('string_escape')) return u_str + +def changed_tooltip(nodes): + if nodes: + pref = ':
' + suf = '' + if len(nodes) > 30: + suf = '
' + _(' and %s more') % (len(nodes) - 30) + return literal(pref + '
'.join([x.path for x in nodes[:30]]) + suf) + else: + return ': ' + _('No Files') diff --git a/rhodecode/templates/changelog/changelog.html b/rhodecode/templates/changelog/changelog.html --- a/rhodecode/templates/changelog/changelog.html +++ b/rhodecode/templates/changelog/changelog.html @@ -61,23 +61,10 @@
${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
-
- - <% - def changed_tooltip(cs): - if cs: - pref = ': ' - suf = '' - if len(cs) > 30: - suf='
'+_(' and %s more') % (len(cs) - 30) - return pref+'
'.join([x.path for x in cs[:30]]) + suf - else: - return ': '+_('No Files') - %> - - ${len(cs.removed)} - ${len(cs.changed)} - ${len(cs.added)} +
+ ${len(cs.removed)} + ${len(cs.changed)} + ${len(cs.added)}
%if len(cs.parents)>1: