# HG changeset patch # User Marcin Kuzminski # Date 1291514408 -3600 # Node ID 1af15d66838f4ac9c049c329fad66c302c9ea1ef # Parent e8c9ff1da9baf393fa6ffaf268769cd8098c35f9 added icons to journal, extend show more to actually show more pushed revisions, diff -r e8c9ff1da9ba -r 1af15d66838f rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py Sun Dec 05 00:52:11 2010 +0100 +++ b/rhodecode/lib/helpers.py Sun Dec 05 03:00:08 2010 +0100 @@ -431,10 +431,19 @@ repo_name=user_log.repository.repo_name, revision=rev)) for rev in revs[:revs_limit] ]) if len(revs) > revs_limit: - html_tmpl = ' %s ' - 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 = (' %s ' + '%s ' + '%s') + cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \ + % (len(revs) - revs_limit), + _('revisions')) + + html_tmpl = '' + 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 @@ } action_str = map.get(action, action) - return literal(action_str.replace('[', '').replace(']', '')) + return literal(action_str.replace('[', '')\ + .replace(']', '')) + +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 = """""" + 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)) #============================================================================== diff -r e8c9ff1da9ba -r 1af15d66838f rhodecode/templates/admin/admin_log.html --- a/rhodecode/templates/admin/admin_log.html Sun Dec 05 00:52:11 2010 +0100 +++ b/rhodecode/templates/admin/admin_log.html Sun Dec 05 03:00:08 2010 +0100 @@ -29,19 +29,34 @@
${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;""")}
%else: ${_('No actions yet')} diff -r e8c9ff1da9ba -r 1af15d66838f rhodecode/templates/journal.html --- a/rhodecode/templates/journal.html Sun Dec 05 00:52:11 2010 +0100 +++ b/rhodecode/templates/journal.html Sun Dec 05 03:00:08 2010 +0100 @@ -24,15 +24,19 @@ gravatar
${entry.user.name} ${entry.user.lastname}
-
${h.action_parser(entry)}
- +
${h.action_parser(entry)}
+
+ ${h.action_parser_icon(entry)} +
+
+ %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 - - ${h.age(entry.action_date)} + - ${h.age(entry.action_date)}
@@ -76,4 +80,13 @@ %endif + + +