##// END OF EJS Templates
fixed unicode problems with file paths....
marcink -
r1087:51076a2a beta
parent child Browse files
Show More
@@ -422,11 +422,12 b' def bool2icon(value):'
422 422 return value
423 423
424 424
425 def action_parser(user_log):
426 """This helper will map the specified string action into translated
425 def action_parser(user_log, feed=False):
426 """This helper will action_map the specified string action into translated
427 427 fancy names with icons and links
428 428
429 429 :param user_log: user log instance
430 :param feed: use output for feeds (no html and fancy icons)
430 431 """
431 432
432 433 action = user_log.action
@@ -470,11 +471,16 b' def action_parser(user_log):'
470 471 html_tmpl = ('<span> %s '
471 472 '<a class="show_more" id="_%s" href="#more">%s</a> '
472 473 '%s</span>')
473 cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \
474 if not feed:
475 cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \
474 476 % (len(revs) - revs_limit),
475 477 _('revisions'))
476 478
477 html_tmpl = '<span id="%s" style="display:none"> %s </span>'
479 if not feed:
480 html_tmpl = '<span id="%s" style="display:none"> %s </span>'
481 else:
482 html_tmpl = '<span id="%s"> %s </span>'
483
478 484 cs_links += html_tmpl % (uniq_id, ', '.join([link_to(rev,
479 485 url('changeset_home',
480 486 repo_name=repo_name, revision=rev),
@@ -489,7 +495,7 b' def action_parser(user_log):'
489 495 return _('fork name ') + str(link_to(action_params, url('summary_home',
490 496 repo_name=repo_name,)))
491 497
492 map = {'user_deleted_repo':(_('[deleted] repository'), None),
498 action_map = {'user_deleted_repo':(_('[deleted] repository'), None),
493 499 'user_created_repo':(_('[created] repository'), None),
494 500 'user_forked_repo':(_('[forked] repository'), get_fork_name),
495 501 'user_updated_repo':(_('[updated] repository'), None),
@@ -503,8 +509,11 b' def action_parser(user_log):'
503 509 'stopped_following_repo':(_('[stopped following] repository'), None),
504 510 }
505 511
506 action_str = map.get(action, action)
507 action = action_str[0].replace('[', '<span class="journal_highlight">')\
512 action_str = action_map.get(action, action)
513 if feed:
514 action = action_str[0].replace('[', '').replace(']', '')
515 else:
516 action = action_str[0].replace('[', '<span class="journal_highlight">')\
508 517 .replace(']', '</span>')
509 518 action_params_func = lambda :""
510 519
@@ -588,6 +597,6 b' def changed_tooltip(nodes):'
588 597 suf = ''
589 598 if len(nodes) > 30:
590 599 suf = '<br/>' + _(' and %s more') % (len(nodes) - 30)
591 return literal(pref + '<br/> '.join([x.path for x in nodes[:30]]) + suf)
600 return literal(pref + '<br/> '.join([x.path.decode('utf-8') for x in nodes[:30]]) + suf)
592 601 else:
593 602 return ': ' + _('No Files')
@@ -81,7 +81,7 b''
81 81 <span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span>
82 82 <div class="cs_files">
83 83 %for change,filenode,diff,cs1,cs2 in c.changes:
84 <div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor=h.repo_name_slug('C%s' % filenode.path)))}</div>
84 <div class="cs_${change}">${h.link_to(filenode.path.decode('utf-8'),h.url.current(anchor=h.repo_name_slug('C%s' % filenode.path.decode('utf-8'))))}</div>
85 85 %endfor
86 86 </div>
87 87 </div>
@@ -92,19 +92,19 b''
92 92 %if change !='removed':
93 93 <div style="clear:both;height:10px"></div>
94 94 <div class="diffblock">
95 <div id="${h.repo_name_slug('C%s' % filenode.path)}" class="code-header">
95 <div id="${h.repo_name_slug('C%s' % filenode.path.decode('utf-8'))}" class="code-header">
96 96 <div class="changeset_header">
97 97 <span class="changeset_file">
98 ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
99 revision=filenode.changeset.raw_id,f_path=filenode.path))}
98 ${h.link_to_if(change!='removed',filenode.path.decode('utf-8'),h.url('files_home',repo_name=c.repo_name,
99 revision=filenode.changeset.raw_id,f_path=filenode.path.decode('utf-8')))}
100 100 </span>
101 101 %if 1:
102 102 &raquo; <span>${h.link_to(_('diff'),
103 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='diff'))}</span>
103 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8'),diff2=cs2,diff1=cs1,diff='diff'))}</span>
104 104 &raquo; <span>${h.link_to(_('raw diff'),
105 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='raw'))}</span>
105 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8'),diff2=cs2,diff1=cs1,diff='raw'))}</span>
106 106 &raquo; <span>${h.link_to(_('download diff'),
107 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='download'))}</span>
107 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8'),diff2=cs2,diff1=cs1,diff='download'))}</span>
108 108 %endif
109 109 </div>
110 110 </div>
@@ -54,7 +54,7 b''
54 54 %for cs in c.cs_ranges:
55 55 <div class="cur_cs">r${cs}</div>
56 56 %for change,filenode,diff,cs1,cs2 in c.changes[cs.raw_id]:
57 <div class="cs_${change}">${h.link_to(filenode.path,h.url.current(anchor=h.repo_name_slug('C%s-%s' % (cs.short_id,filenode.path))))}</div>
57 <div class="cs_${change}">${h.link_to(filenode.path.decode('utf-8'),h.url.current(anchor=h.repo_name_slug('C%s-%s' % (cs.short_id,filenode.path.decode('utf-8')))))}</div>
58 58 %endfor
59 59 %endfor
60 60 </div>
@@ -66,19 +66,19 b''
66 66 %if change !='removed':
67 67 <div style="clear:both;height:10px"></div>
68 68 <div class="diffblock">
69 <div id="${h.repo_name_slug('C%s-%s' % (cs.short_id,filenode.path))}" class="code-header">
69 <div id="${h.repo_name_slug('C%s-%s' % (cs.short_id,filenode.path.decode('utf-8')))}" class="code-header">
70 70 <div class="changeset_header">
71 71 <span class="changeset_file">
72 ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
73 revision=filenode.changeset.raw_id,f_path=filenode.path))}
72 ${h.link_to_if(change!='removed',filenode.path.decode('utf-8'),h.url('files_home',repo_name=c.repo_name,
73 revision=filenode.changeset.raw_id,f_path=filenode.path.decode('utf-8')))}
74 74 </span>
75 75 %if 1:
76 76 &raquo; <span>${h.link_to(_('diff'),
77 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='diff'))}</span>
77 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8'),diff2=cs2,diff1=cs1,diff='diff'))}</span>
78 78 &raquo; <span>${h.link_to(_('raw diff'),
79 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='raw'))}</span>
79 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8'),diff2=cs2,diff1=cs1,diff='raw'))}</span>
80 80 &raquo; <span>${h.link_to(_('download diff'),
81 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path,diff2=cs2,diff1=cs1,diff='download'))}</span>
81 h.url('files_diff_home',repo_name=c.repo_name,f_path=filenode.path.decode('utf-8'),diff2=cs2,diff1=cs1,diff='download'))}</span>
82 82 %endif
83 83 </div>
84 84 </div>
@@ -15,6 +15,16 b''
15 15 <!-- box / title -->
16 16 <div class="title">
17 17 <h5>${_('Public Journal')}</h5>
18 <ul class="links">
19 <li>
20 <span>${h.link_to(_('RSS'),h.url('public_journal_rss'),class_='rss_icon')}</span>
21 </li>
22 <li>
23 <span>${h.link_to(_('Atom'),h.url('public_journal_atom'),class_='atom_icon')}</span>
24 </li>
25
26 </ul>
27
18 28 </div>
19 29 <script type="text/javascript">
20 30 function show_more_event(){
@@ -241,7 +241,7 b' def test_push_new_file(commits=15):'
241 241 test_clone(no_errors=True)
242 242
243 243 cwd = path = jn(TESTS_TMP_PATH, HG_REPO)
244 added_file = jn(path, '%ssetup.py' % _RandomNameSequence().next())
244 added_file = jn(path, '%ssetupążźć.py' % _RandomNameSequence().next())
245 245
246 246 Command(cwd).execute('touch %s' % added_file)
247 247
@@ -325,7 +325,7 b" if __name__ == '__main__':"
325 325 #test_clone_wrong_credentials()
326 326
327 327 #test_pull()
328 test_push_new_file(commits=2)
328 test_push_new_file(commits=15)
329 329 #test_push_wrong_path()
330 330 #test_push_wrong_credentials()
331 331
General Comments 0
You need to be logged in to leave comments. Login now