##// 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 return value
422 return value
423
423
424
424
425 def action_parser(user_log):
425 def action_parser(user_log, feed=False):
426 """This helper will map the specified string action into translated
426 """This helper will action_map the specified string action into translated
427 fancy names with icons and links
427 fancy names with icons and links
428
428
429 :param user_log: user log instance
429 :param user_log: user log instance
430 :param feed: use output for feeds (no html and fancy icons)
430 """
431 """
431
432
432 action = user_log.action
433 action = user_log.action
@@ -470,11 +471,16 b' def action_parser(user_log):'
470 html_tmpl = ('<span> %s '
471 html_tmpl = ('<span> %s '
471 '<a class="show_more" id="_%s" href="#more">%s</a> '
472 '<a class="show_more" id="_%s" href="#more">%s</a> '
472 '%s</span>')
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 % (len(revs) - revs_limit),
476 % (len(revs) - revs_limit),
475 _('revisions'))
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 cs_links += html_tmpl % (uniq_id, ', '.join([link_to(rev,
484 cs_links += html_tmpl % (uniq_id, ', '.join([link_to(rev,
479 url('changeset_home',
485 url('changeset_home',
480 repo_name=repo_name, revision=rev),
486 repo_name=repo_name, revision=rev),
@@ -489,7 +495,7 b' def action_parser(user_log):'
489 return _('fork name ') + str(link_to(action_params, url('summary_home',
495 return _('fork name ') + str(link_to(action_params, url('summary_home',
490 repo_name=repo_name,)))
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 'user_created_repo':(_('[created] repository'), None),
499 'user_created_repo':(_('[created] repository'), None),
494 'user_forked_repo':(_('[forked] repository'), get_fork_name),
500 'user_forked_repo':(_('[forked] repository'), get_fork_name),
495 'user_updated_repo':(_('[updated] repository'), None),
501 'user_updated_repo':(_('[updated] repository'), None),
@@ -503,8 +509,11 b' def action_parser(user_log):'
503 'stopped_following_repo':(_('[stopped following] repository'), None),
509 'stopped_following_repo':(_('[stopped following] repository'), None),
504 }
510 }
505
511
506 action_str = map.get(action, action)
512 action_str = action_map.get(action, action)
507 action = action_str[0].replace('[', '<span class="journal_highlight">')\
513 if feed:
514 action = action_str[0].replace('[', '').replace(']', '')
515 else:
516 action = action_str[0].replace('[', '<span class="journal_highlight">')\
508 .replace(']', '</span>')
517 .replace(']', '</span>')
509 action_params_func = lambda :""
518 action_params_func = lambda :""
510
519
@@ -588,6 +597,6 b' def changed_tooltip(nodes):'
588 suf = ''
597 suf = ''
589 if len(nodes) > 30:
598 if len(nodes) > 30:
590 suf = '<br/>' + _(' and %s more') % (len(nodes) - 30)
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 else:
601 else:
593 return ': ' + _('No Files')
602 return ': ' + _('No Files')
@@ -81,7 +81,7 b''
81 <span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span>
81 <span style="font-size:1.1em;font-weight: bold">${_('Files affected')}</span>
82 <div class="cs_files">
82 <div class="cs_files">
83 %for change,filenode,diff,cs1,cs2 in c.changes:
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 %endfor
85 %endfor
86 </div>
86 </div>
87 </div>
87 </div>
@@ -92,19 +92,19 b''
92 %if change !='removed':
92 %if change !='removed':
93 <div style="clear:both;height:10px"></div>
93 <div style="clear:both;height:10px"></div>
94 <div class="diffblock">
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 <div class="changeset_header">
96 <div class="changeset_header">
97 <span class="changeset_file">
97 <span class="changeset_file">
98 ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
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))}
99 revision=filenode.changeset.raw_id,f_path=filenode.path.decode('utf-8')))}
100 </span>
100 </span>
101 %if 1:
101 %if 1:
102 &raquo; <span>${h.link_to(_('diff'),
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 &raquo; <span>${h.link_to(_('raw diff'),
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 &raquo; <span>${h.link_to(_('download diff'),
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 %endif
108 %endif
109 </div>
109 </div>
110 </div>
110 </div>
@@ -54,7 +54,7 b''
54 %for cs in c.cs_ranges:
54 %for cs in c.cs_ranges:
55 <div class="cur_cs">r${cs}</div>
55 <div class="cur_cs">r${cs}</div>
56 %for change,filenode,diff,cs1,cs2 in c.changes[cs.raw_id]:
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 %endfor
58 %endfor
59 %endfor
59 %endfor
60 </div>
60 </div>
@@ -66,19 +66,19 b''
66 %if change !='removed':
66 %if change !='removed':
67 <div style="clear:both;height:10px"></div>
67 <div style="clear:both;height:10px"></div>
68 <div class="diffblock">
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 <div class="changeset_header">
70 <div class="changeset_header">
71 <span class="changeset_file">
71 <span class="changeset_file">
72 ${h.link_to_if(change!='removed',filenode.path,h.url('files_home',repo_name=c.repo_name,
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))}
73 revision=filenode.changeset.raw_id,f_path=filenode.path.decode('utf-8')))}
74 </span>
74 </span>
75 %if 1:
75 %if 1:
76 &raquo; <span>${h.link_to(_('diff'),
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 &raquo; <span>${h.link_to(_('raw diff'),
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 &raquo; <span>${h.link_to(_('download diff'),
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 %endif
82 %endif
83 </div>
83 </div>
84 </div>
84 </div>
@@ -15,6 +15,16 b''
15 <!-- box / title -->
15 <!-- box / title -->
16 <div class="title">
16 <div class="title">
17 <h5>${_('Public Journal')}</h5>
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 </div>
28 </div>
19 <script type="text/javascript">
29 <script type="text/javascript">
20 function show_more_event(){
30 function show_more_event(){
@@ -241,7 +241,7 b' def test_push_new_file(commits=15):'
241 test_clone(no_errors=True)
241 test_clone(no_errors=True)
242
242
243 cwd = path = jn(TESTS_TMP_PATH, HG_REPO)
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 Command(cwd).execute('touch %s' % added_file)
246 Command(cwd).execute('touch %s' % added_file)
247
247
@@ -325,7 +325,7 b" if __name__ == '__main__':"
325 #test_clone_wrong_credentials()
325 #test_clone_wrong_credentials()
326
326
327 #test_pull()
327 #test_pull()
328 test_push_new_file(commits=2)
328 test_push_new_file(commits=15)
329 #test_push_wrong_path()
329 #test_push_wrong_path()
330 #test_push_wrong_credentials()
330 #test_push_wrong_credentials()
331
331
General Comments 0
You need to be logged in to leave comments. Login now