Show More
@@ -431,10 +431,19 def action_parser(user_log): | |||||
431 | repo_name=user_log.repository.repo_name, |
|
431 | repo_name=user_log.repository.repo_name, | |
432 | revision=rev)) for rev in revs[:revs_limit] ]) |
|
432 | revision=rev)) for rev in revs[:revs_limit] ]) | |
433 | if len(revs) > revs_limit: |
|
433 | if len(revs) > revs_limit: | |
434 | html_tmpl = '<span title="%s"> %s </span>' |
|
434 | uniq_id = revs[0] | |
435 | cs_links += html_tmpl % (', '.join(r for r in revs[revs_limit:]), |
|
435 | html_tmpl = ('<span> %s ' | |
436 | _('and %s more revisions') \ |
|
436 | '<a class="show_more" id="_%s" href="#">%s</a> ' | |
437 | % (len(revs) - revs_limit)) |
|
437 | '%s</span>') | |
|
438 | cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \ | |||
|
439 | % (len(revs) - revs_limit), | |||
|
440 | _('revisions')) | |||
|
441 | ||||
|
442 | html_tmpl = '<span id="%s" style="display:none"> %s </span>' | |||
|
443 | cs_links += html_tmpl % (uniq_id, ', '.join([link(rev, | |||
|
444 | url('changeset_home', | |||
|
445 | repo_name=user_log.repository.repo_name, | |||
|
446 | revision=rev)) for rev in revs[:revs_limit] ])) | |||
438 |
|
447 | |||
439 | return cs_links |
|
448 | return cs_links | |
440 | return '' |
|
449 | return '' | |
@@ -465,7 +474,32 def action_parser(user_log): | |||||
465 | } |
|
474 | } | |
466 |
|
475 | |||
467 | action_str = map.get(action, action) |
|
476 | action_str = map.get(action, action) | |
468 |
return literal(action_str.replace('[', '<span class="journal_highlight">') |
|
477 | return literal(action_str.replace('[', '<span class="journal_highlight">')\ | |
|
478 | .replace(']', '</span>')) | |||
|
479 | ||||
|
480 | def action_parser_icon(user_log): | |||
|
481 | action = user_log.action | |||
|
482 | action_params = None | |||
|
483 | x = action.split(':') | |||
|
484 | ||||
|
485 | if len(x) > 1: | |||
|
486 | action, action_params = x | |||
|
487 | ||||
|
488 | tmpl = """<img src="/images/icons/%s">""" | |||
|
489 | map = {'user_deleted_repo':'database_delete.png', | |||
|
490 | 'user_created_repo':'database_add.png', | |||
|
491 | 'user_forked_repo':'arrow_divide.png', | |||
|
492 | 'user_updated_repo':'database_edit.png', | |||
|
493 | 'admin_deleted_repo':'database_delete.png', | |||
|
494 | 'admin_created_repo':'database_ddd.png', | |||
|
495 | 'admin_forked_repo':'arrow_divide.png', | |||
|
496 | 'admin_updated_repo':'database_edit.png', | |||
|
497 | 'push':'script_add.png', | |||
|
498 | 'pull':'down_16.png', | |||
|
499 | 'started_following_repo':'heart_add.png', | |||
|
500 | 'stopped_following_repo':'heart_delete.png', | |||
|
501 | } | |||
|
502 | return literal(tmpl % map.get(action, action)) | |||
469 |
|
503 | |||
470 |
|
504 | |||
471 | #============================================================================== |
|
505 | #============================================================================== |
@@ -29,19 +29,34 | |||||
29 |
|
29 | |||
30 | <script type="text/javascript"> |
|
30 | <script type="text/javascript"> | |
31 | var data_div = 'user_log'; |
|
31 | var data_div = 'user_log'; | |
32 |
Y |
|
32 | YUE.onDOMReady(function(){ | |
33 |
Y |
|
33 | YUE.on(YUD.getElementsByClassName('pager_link'),"click",function(){ | |
34 |
Y |
|
34 | YUD.setStyle(data_div,'opacity','0.3');}); | |
|
35 | YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){ | |||
|
36 | var el = e.target; | |||
|
37 | YUD.setStyle(YUD.get(el.id.substring(1)),'display',''); | |||
|
38 | YUD.setStyle(el.parentNode,'display','none'); | |||
|
39 | }); | |||
|
40 | }); | |||
35 | </script> |
|
41 | </script> | |
36 |
|
42 | |||
37 |
|
43 | |||
38 | <div class="pagination-wh pagination-left"> |
|
44 | <div class="pagination-wh pagination-left"> | |
39 | ${c.users_log.pager('$link_previous ~2~ $link_next', |
|
45 | ${c.users_log.pager('$link_previous ~2~ $link_next', | |
40 | onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{ |
|
46 | onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{ | |
41 | success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText; |
|
47 | success:function(o){ | |
42 | YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){ |
|
48 | YUD.get(data_div).innerHTML=o.responseText; | |
43 | YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');}); |
|
49 | YUE.on(YUD.getElementsByClassName('pager_link'),"click",function(){ | |
44 | YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")} |
|
50 | YUD.setStyle(data_div,'opacity','0.3'); | |
|
51 | }); | |||
|
52 | YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){ | |||
|
53 | var el = e.target; | |||
|
54 | YUD.setStyle(YUD.get(el.id.substring(1)),'display',''); | |||
|
55 | YUD.setStyle(el.parentNode,'display','none'); | |||
|
56 | }); | |||
|
57 | YUD.setStyle(data_div,'opacity','1');} | |||
|
58 | ||||
|
59 | },null); return false;""")} | |||
45 | </div> |
|
60 | </div> | |
46 | %else: |
|
61 | %else: | |
47 | ${_('No actions yet')} |
|
62 | ${_('No actions yet')} |
@@ -24,15 +24,19 | |||||
24 | <img alt="gravatar" src="${h.gravatar_url(entry.user.email)}"/> |
|
24 | <img alt="gravatar" src="${h.gravatar_url(entry.user.email)}"/> | |
25 | </div> |
|
25 | </div> | |
26 | <div>${entry.user.name} ${entry.user.lastname}</div> |
|
26 | <div>${entry.user.name} ${entry.user.lastname}</div> | |
27 |
<div style="padding-left: 45px;padding-top:5px">${h.action_parser(entry)} |
|
27 | <div style="padding-left: 45px;padding-top:5px;min-height:20px">${h.action_parser(entry)}</div> | |
28 | <b> |
|
28 | <div style="float: left; padding-top: 8px;padding-left:18px"> | |
|
29 | ${h.action_parser_icon(entry)} | |||
|
30 | </div> | |||
|
31 | <div style="margin-left: 45px;padding-top: 10px"> | |||
|
32 | <span style="font-weight: bold;font-size: 1.1em"> | |||
29 | %if entry.repository: |
|
33 | %if entry.repository: | |
30 | ${h.link_to(entry.repository.repo_name, |
|
34 | ${h.link_to(entry.repository.repo_name, | |
31 | h.url('summary_home',repo_name=entry.repository.repo_name))} |
|
35 | h.url('summary_home',repo_name=entry.repository.repo_name))} | |
32 | %else: |
|
36 | %else: | |
33 | ${entry.repository_name} |
|
37 | ${entry.repository_name} | |
34 | %endif |
|
38 | %endif | |
35 |
</ |
|
39 | </span> - <span title="${entry.action_date}">${h.age(entry.action_date)}</span> | |
36 | </div> |
|
40 | </div> | |
37 | </div> |
|
41 | </div> | |
38 | <div style="clear:both;border-bottom:1px dashed #DDD;padding:3px 3px;margin:0px 10px 0px 10px"></div> |
|
42 | <div style="clear:both;border-bottom:1px dashed #DDD;padding:3px 3px;margin:0px 10px 0px 10px"></div> | |
@@ -76,4 +80,13 | |||||
76 | %endif |
|
80 | %endif | |
77 | </div> |
|
81 | </div> | |
78 | </div> |
|
82 | </div> | |
|
83 | ||||
|
84 | <script type="text/javascript"> | |||
|
85 | YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){ | |||
|
86 | var el = e.target; | |||
|
87 | YUD.setStyle(YUD.get(el.id.substring(1)),'display',''); | |||
|
88 | YUD.setStyle(el.parentNode,'display','none'); | |||
|
89 | }); | |||
|
90 | </script> | |||
|
91 | ||||
79 | </%def> |
|
92 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now