Changeset - 1af15d66838f
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 15 years ago 2010-12-05 03:00:08
marcin@python-works.com
added icons to journal, extend show more to actually show more pushed revisions,
3 files changed with 77 insertions and 15 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/helpers.py
Show inline comments
 
@@ -431,10 +431,19 @@ def action_parser(user_log):
 
                    repo_name=user_log.repository.repo_name,
 
                    revision=rev)) for rev in revs[:revs_limit] ])
 
            if len(revs) > revs_limit:
 
                html_tmpl = '<span title="%s"> %s </span>'
 
                cs_links += html_tmpl % (', '.join(r for r in revs[revs_limit:]),
 
                                         _('and %s more revisions') \
 
                                            % (len(revs) - revs_limit))
 
                uniq_id = revs[0]
 
                html_tmpl = ('<span> %s '
 
                '<a class="show_more" id="_%s" href="#">%s</a> '
 
                '%s</span>')
 
                cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \
 
                                            % (len(revs) - revs_limit),
 
                                            _('revisions'))
 

	
 
                html_tmpl = '<span id="%s" style="display:none"> %s </span>'
 
                cs_links += html_tmpl % (uniq_id, ', '.join([link(rev,
 
                    url('changeset_home',
 
                    repo_name=user_log.repository.repo_name,
 
                    revision=rev)) for rev in revs[:revs_limit] ]))
 

	
 
            return cs_links
 
        return ''
 
@@ -465,7 +474,32 @@ def action_parser(user_log):
 
            }
 

	
 
    action_str = map.get(action, action)
 
    return literal(action_str.replace('[', '<span class="journal_highlight">').replace(']', '</span>'))
 
    return literal(action_str.replace('[', '<span class="journal_highlight">')\
 
                   .replace(']', '</span>'))
 

	
 
def action_parser_icon(user_log):
 
    action = user_log.action
 
    action_params = None
 
    x = action.split(':')
 

	
 
    if len(x) > 1:
 
        action, action_params = x
 

	
 
    tmpl = """<img src="/images/icons/%s">"""
 
    map = {'user_deleted_repo':'database_delete.png',
 
           'user_created_repo':'database_add.png',
 
           'user_forked_repo':'arrow_divide.png',
 
           'user_updated_repo':'database_edit.png',
 
           'admin_deleted_repo':'database_delete.png',
 
           'admin_created_repo':'database_ddd.png',
 
           'admin_forked_repo':'arrow_divide.png',
 
           'admin_updated_repo':'database_edit.png',
 
           'push':'script_add.png',
 
           'pull':'down_16.png',
 
           'started_following_repo':'heart_add.png',
 
           'stopped_following_repo':'heart_delete.png',
 
            }
 
    return literal(tmpl % map.get(action, action))
 

	
 

	
 
#==============================================================================
rhodecode/templates/admin/admin_log.html
Show inline comments
 
@@ -29,19 +29,34 @@
 

	
 
<script type="text/javascript">
 
  var data_div = 'user_log';
 
  YAHOO.util.Event.onDOMReady(function(){
 
	YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){
 
			YAHOO.util.Dom.setStyle('shortlog_data','opacity','0.3');});});
 
  YUE.onDOMReady(function(){
 
	YUE.on(YUD.getElementsByClassName('pager_link'),"click",function(){
 
			YUD.setStyle(data_div,'opacity','0.3');});
 
	YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){
 
	      var el = e.target;
 
	      YUD.setStyle(YUD.get(el.id.substring(1)),'display','');
 
	      YUD.setStyle(el.parentNode,'display','none');
 
	  });
 
  });
 
</script>
 
		
 
		
 
<div class="pagination-wh pagination-left">
 
${c.users_log.pager('$link_previous ~2~ $link_next',
 
onclick="""YAHOO.util.Connect.asyncRequest('GET','$partial_url',{
 
success:function(o){YAHOO.util.Dom.get(data_div).innerHTML=o.responseText;
 
YAHOO.util.Event.addListener(YAHOO.util.Dom.getElementsByClassName('pager_link'),"click",function(){
 
		YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');});		
 
YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")}
 
success:function(o){
 
    YUD.get(data_div).innerHTML=o.responseText;
 
    YUE.on(YUD.getElementsByClassName('pager_link'),"click",function(){
 
        YUD.setStyle(data_div,'opacity','0.3');
 
    });		
 
    YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){
 
      var el = e.target;
 
      YUD.setStyle(YUD.get(el.id.substring(1)),'display','');
 
      YUD.setStyle(el.parentNode,'display','none');
 
    });
 
    YUD.setStyle(data_div,'opacity','1');}    
 

	
 
},null); return false;""")}
 
</div>
 
%else: 
 
	${_('No actions yet')} 
rhodecode/templates/journal.html
Show inline comments
 
@@ -24,15 +24,19 @@
 
                    <img alt="gravatar" src="${h.gravatar_url(entry.user.email)}"/>
 
                </div>
 
                <div>${entry.user.name} ${entry.user.lastname}</div>
 
                <div style="padding-left: 45px;padding-top:5px">${h.action_parser(entry)} <br/>
 
                <b>
 
                <div style="padding-left: 45px;padding-top:5px;min-height:20px">${h.action_parser(entry)}</div>
 
                <div style="float: left; padding-top: 8px;padding-left:18px">
 
                ${h.action_parser_icon(entry)}
 
                </div>
 
                <div style="margin-left: 45px;padding-top: 10px">
 
                <span style="font-weight: bold;font-size: 1.1em">
 
		        %if entry.repository:
 
		          ${h.link_to(entry.repository.repo_name,
 
		                      h.url('summary_home',repo_name=entry.repository.repo_name))}
 
		        %else:
 
		          ${entry.repository_name}
 
		        %endif             
 
                </b> - <span title="${entry.action_date}">${h.age(entry.action_date)}</span>
 
                </span> - <span title="${entry.action_date}">${h.age(entry.action_date)}</span>
 
                </div>
 
            </div>
 
            <div style="clear:both;border-bottom:1px dashed #DDD;padding:3px 3px;margin:0px 10px 0px 10px"></div>
 
@@ -76,4 +80,13 @@
 
        %endif               
 
        </div>
 
    </div>
 
    
 
    <script type="text/javascript">
 
    YUE.on(YUD.getElementsByClassName('show_more'),'click',function(e){
 
        var el = e.target;
 
        YUD.setStyle(YUD.get(el.id.substring(1)),'display','');
 
        YUD.setStyle(el.parentNode,'display','none');
 
    });    
 
    </script>
 
    
 
</%def>    
0 comments (0 inline, 0 general)