diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -422,11 +422,12 @@ def bool2icon(value): return value -def action_parser(user_log): - """This helper will map the specified string action into translated +def action_parser(user_log, feed=False): + """This helper will action_map the specified string action into translated fancy names with icons and links :param user_log: user log instance + :param feed: use output for feeds (no html and fancy icons) """ action = user_log.action @@ -470,11 +471,16 @@ def action_parser(user_log): html_tmpl = (' %s ' '%s ' '%s') - cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \ + if not feed: + cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \ % (len(revs) - revs_limit), _('revisions')) - html_tmpl = '' + if not feed: + html_tmpl = '' + else: + html_tmpl = ' %s ' + cs_links += html_tmpl % (uniq_id, ', '.join([link_to(rev, url('changeset_home', repo_name=repo_name, revision=rev), @@ -489,7 +495,7 @@ def action_parser(user_log): return _('fork name ') + str(link_to(action_params, url('summary_home', repo_name=repo_name,))) - map = {'user_deleted_repo':(_('[deleted] repository'), None), + action_map = {'user_deleted_repo':(_('[deleted] repository'), None), 'user_created_repo':(_('[created] repository'), None), 'user_forked_repo':(_('[forked] repository'), get_fork_name), 'user_updated_repo':(_('[updated] repository'), None), @@ -503,8 +509,11 @@ def action_parser(user_log): 'stopped_following_repo':(_('[stopped following] repository'), None), } - action_str = map.get(action, action) - action = action_str[0].replace('[', '')\ + action_str = action_map.get(action, action) + if feed: + action = action_str[0].replace('[', '').replace(']', '') + else: + action = action_str[0].replace('[', '')\ .replace(']', '') action_params_func = lambda :"" @@ -588,6 +597,6 @@ def changed_tooltip(nodes): suf = '' if len(nodes) > 30: suf = '
' + _(' and %s more') % (len(nodes) - 30) - return literal(pref + '
'.join([x.path for x in nodes[:30]]) + suf) + return literal(pref + '
'.join([x.path.decode('utf-8') for x in nodes[:30]]) + suf) else: return ': ' + _('No Files')