##// END OF EJS Templates
added icons to journal, extend show more to actually show more pushed revisions,
marcink -
r808:1af15d66 beta
parent child Browse files
Show More
@@ -431,10 +431,19 def action_parser(user_log):
431 431 repo_name=user_log.repository.repo_name,
432 432 revision=rev)) for rev in revs[:revs_limit] ])
433 433 if len(revs) > revs_limit:
434 html_tmpl = '<span title="%s"> %s </span>'
435 cs_links += html_tmpl % (', '.join(r for r in revs[revs_limit:]),
436 _('and %s more revisions') \
437 % (len(revs) - revs_limit))
434 uniq_id = revs[0]
435 html_tmpl = ('<span> %s '
436 '<a class="show_more" id="_%s" href="#">%s</a> '
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 448 return cs_links
440 449 return ''
@@ -465,7 +474,32 def action_parser(user_log):
465 474 }
466 475
467 476 action_str = map.get(action, action)
468 return literal(action_str.replace('[', '<span class="journal_highlight">').replace(']', '</span>'))
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 30 <script type="text/javascript">
31 31 var data_div = 'user_log';
32 YAHOO.util.Event.onDOMReady(function(){
33 YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){
34 YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});});
32 YUE.onDOMReady(function(){
33 YUE.on(YUD.getElementsByClassName('pager_link'),"click",function(){
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 41 </script>
36 42
37 43
38 44 <div class="pagination-wh pagination-left">
39 45 ${c.users_log.pager('$link_previous ~2~ $link_next',
40 46 onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{
41 success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText;
42 YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){
43 YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');});
44 YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")}
47 success:function(o){
48 YUD.get(data_div).innerHTML=o.responseText;
49 YUE.on(YUD.getElementsByClassName('pager_link'),"click",function(){
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 60 </div>
46 61 %else:
47 62 ${_('No actions yet')}
@@ -24,15 +24,19
24 24 <img alt="gravatar" src="${h.gravatar_url(entry.user.email)}"/>
25 25 </div>
26 26 <div>${entry.user.name} ${entry.user.lastname}</div>
27 <div style="padding-left: 45px;padding-top:5px">${h.action_parser(entry)} <br/>
28 <b>
27 <div style="padding-left: 45px;padding-top:5px;min-height:20px">${h.action_parser(entry)}</div>
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 33 %if entry.repository:
30 34 ${h.link_to(entry.repository.repo_name,
31 35 h.url('summary_home',repo_name=entry.repository.repo_name))}
32 36 %else:
33 37 ${entry.repository_name}
34 38 %endif
35 </b> - <span title="${entry.action_date}">${h.age(entry.action_date)}</span>
39 </span> - <span title="${entry.action_date}">${h.age(entry.action_date)}</span>
36 40 </div>
37 41 </div>
38 42 <div style="clear:both;border-bottom:1px dashed #DDD;padding:3px 3px;margin:0px 10px 0px 10px"></div>
@@ -76,4 +80,13
76 80 %endif
77 81 </div>
78 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 92 </%def>
General Comments 0
You need to be logged in to leave comments. Login now