diff --git a/rhodecode/controllers/journal.py b/rhodecode/controllers/journal.py --- a/rhodecode/controllers/journal.py +++ b/rhodecode/controllers/journal.py @@ -24,13 +24,14 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. - import logging -from sqlalchemy import or_ -from pylons import request, response, session, tmpl_context as c, url +from sqlalchemy import or_ +from sqlalchemy.orm import joinedload, make_transient +from webhelpers.paginate import Page -from webhelpers.paginate import Page +from paste.httpexceptions import HTTPInternalServerError +from pylons import request, response, session, tmpl_context as c, url from rhodecode.lib.auth import LoginRequired, NotAnonymous from rhodecode.lib.base import BaseController, render @@ -38,9 +39,6 @@ from rhodecode.lib.helpers import get_to from rhodecode.model.db import UserLog, UserFollowing from rhodecode.model.scm import ScmModel -from paste.httpexceptions import HTTPInternalServerError -from sqlalchemy.orm import joinedload - log = logging.getLogger(__name__) class JournalController(BaseController): @@ -53,12 +51,12 @@ class JournalController(BaseController): def index(self): # Return a rendered template - c.following = self.sa.query(UserFollowing)\ .filter(UserFollowing.user_id == c.rhodecode_user.user_id)\ .options(joinedload(UserFollowing.follows_repository))\ .all() + repo_ids = [x.follows_repository.repo_id for x in c.following if x.follows_repository is not None] user_ids = [x.follows_user.user_id for x in c.following @@ -76,6 +74,8 @@ class JournalController(BaseController): if filtering_criterion is not None: journal = self.sa.query(UserLog)\ + .options(joinedload(UserLog.user))\ + .options(joinedload(UserLog.repository))\ .filter(filtering_criterion)\ .order_by(UserLog.action_date.desc()) else: @@ -95,7 +95,12 @@ class JournalController(BaseController): from itertools import groupby groups = [] for k, g in groupby(journal, lambda x:x.action_as_day): - groups.append((k, list(g),)) # Store group iterator as a list + user_group = [] + for k2, g2 in groupby(list(g), lambda x:x.user.email): + l = list(g2) + user_group.append((l[0].user, l)) + + groups.append((k, user_group,)) return groups diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -475,6 +475,7 @@ def action_parser(user_log): repo_name=repo_name, revision=rev), title=message(rev), class_='tooltip') for rev in revs[revs_limit:revs_top_limit]])) + cs_links += _(' into') if len(revs) > 1: cs_links += compare_view return cs_links @@ -489,18 +490,18 @@ def action_parser(user_log): repo_name=repo.name,), title=dbrepo.description) - map = {'user_deleted_repo':(_('User [deleted] repository'), None), - 'user_created_repo':(_('User [created] repository'), None), - 'user_forked_repo':(_('User [forked] repository as:'), get_fork_name), - 'user_updated_repo':(_('User [updated] repository'), None), - 'admin_deleted_repo':(_('Admin [delete] repository'), None), - 'admin_created_repo':(_('Admin [created] repository'), None), - 'admin_forked_repo':(_('Admin [forked] repository'), None), - 'admin_updated_repo':(_('Admin [updated] repository'), None), - 'push':(_('[Pushed]'), get_cs_links), - 'pull':(_('[Pulled]'), None), - 'started_following_repo':(_('User [started following] repository'), None), - 'stopped_following_repo':(_('User [stopped following] repository'), None), + map = {'user_deleted_repo':(_('[deleted] repository'), None), + 'user_created_repo':(_('[created] repository'), None), + 'user_forked_repo':(_('[forked] repository as:'), get_fork_name), + 'user_updated_repo':(_('[updated] repository'), None), + 'admin_deleted_repo':(_('[delete] repository'), None), + 'admin_created_repo':(_('[created] repository'), None), + 'admin_forked_repo':(_('[forked] repository'), None), + 'admin_updated_repo':(_('[updated] repository'), None), + 'push':(_('[pushed]'), get_cs_links), + 'pull':(_('[pulled]'), None), + 'started_following_repo':(_('[started following] repository'), None), + 'stopped_following_repo':(_('[stopped following] repository'), None), } action_str = map.get(action, action) diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css +++ b/rhodecode/public/css/style.css @@ -1413,20 +1413,28 @@ margin-left:10px; margin-right:10px; } -#journal .journal_action{ -padding-top:4px; -min-height:15px; +#journal .journal_user{ +color: #747474; +font-size: 14px; +font-weight: bold; +height: 30px; } - #journal .journal_icon{ float: left; padding-top: 4px; padding-left:12px; +padding-right: 4px; +clear: both; } - +#journal .journal_action{ +padding-top:4px; +min-height:2px; +float:left +} #journal .journal_repo{ -margin-left: 38px; -padding-top: 5px; +float: left; +margin-left: 6px; +padding-top: 3px; } #journal .journal_repo .journal_repo_name{ @@ -1434,9 +1442,14 @@ font-weight: bold; font-size: 1.1em; } #journal .compare_view{ -padding: 5px 0px 5px 38px; +padding: 5px 0px 5px 3px; width: 95px; } +.journal_highlight{ +font-weight: bold; +padding: 0 2px; +vertical-align: bottom; +} .trending_language_tbl,.trending_language_tbl td { border:0 !important; margin:0 !important; @@ -1901,11 +1914,6 @@ padding-left: 10px; padding-bottom:5px; } -.journal_highlight{ -font-weight: bold; -text-decoration: underline; -} - .add_icon { background:url("../images/icons/add.png") no-repeat scroll 3px; height:16px; diff --git a/rhodecode/templates/journal/journal_data.html b/rhodecode/templates/journal/journal_data.html --- a/rhodecode/templates/journal/journal_data.html +++ b/rhodecode/templates/journal/journal_data.html @@ -3,14 +3,15 @@ %if c.journal_day_aggreagate: %for day,items in c.journal_day_aggreagate: