Changeset - 44827c84dc66
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2012-12-06 01:49:18
marcin@python-works.com
added handling of deleted users in journal data
3 files changed with 17 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/journal.py
Show inline comments
 
@@ -105,25 +105,26 @@ class JournalController(BaseController):
 
        Produce an rss feed via feedgenerator module
 
        """
 
        following = self.sa.query(UserFollowing)\
 
            .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\
 
            .options(joinedload(UserFollowing.follows_repository))\
 
            .all()
 
        return self._rss_feed(following, public=False)
 

	
 
    def _get_daily_aggregate(self, journal):
 
        groups = []
 
        for k, g in groupby(journal, lambda x: x.action_as_day):
 
            user_group = []
 
            for k2, g2 in groupby(list(g), lambda x: x.user.email):
 
            #groupby username if it's a present value, else fallback to journal username
 
            for _, g2 in groupby(list(g), lambda x: x.user.username if x.user else x.username):
 
                l = list(g2)
 
                user_group.append((l[0].user, l))
 

	
 
            groups.append((k, user_group,))
 

	
 
        return groups
 

	
 
    def _get_journal_data(self, following_repos):
 
        repo_ids = [x.follows_repository.repo_id for x in following_repos
 
                    if x.follows_repository is not None]
 
        user_ids = [x.follows_user.user_id for x in following_repos
 
                    if x.follows_user is not None]
rhodecode/public/css/style.css
Show inline comments
 
@@ -2318,24 +2318,33 @@ a.metatag[tag="license"]:hover {
 
 
#journal .journal_action_container {
 
	padding-left: 38px;
 
}
 
 
#journal .journal_user {
 
	color: #747474;
 
	font-size: 14px;
 
	font-weight: bold;
 
	height: 30px;
 
}
 
 
#journal .journal_user.deleted {
 
    color: #747474;
 
    font-size: 14px;
 
    font-weight: normal;
 
    height: 30px;
 
    font-style: italic;
 
}
 
 
 
#journal .journal_icon {
 
	clear: both;
 
	float: left;
 
	padding-right: 4px;
 
	padding-top: 3px;
 
}
 
 
#journal .journal_action {
 
	padding-top: 4px;
 
	min-height: 2px;
 
	float: left
 
}
rhodecode/templates/journal/journal_data.html
Show inline comments
 
## -*- coding: utf-8 -*-
 

	
 
%if c.journal_day_aggreagate:
 
    %for day,items in c.journal_day_aggreagate:
 
    <div class="journal_day">${day}</div>
 
        % for user,entries in items:
 
	        <div class="journal_container">
 
	            <div class="gravatar">
 
	                <img alt="gravatar" src="${h.gravatar_url(user.email,24)}"/>
 
	                <img alt="gravatar" src="${h.gravatar_url(user.email if user else 'anonymous@rhodecode.org',24)}"/>
 
	            </div>
 
	            <div class="journal_user">${user.name} ${user.lastname}</div>
 
                %if user:
 
	               <div class="journal_user">${user.name} ${user.lastname}</div>
 
                %else:
 
                    <div class="journal_user deleted">${entries[0].username}</div>
 
                %endif
 
	            <div class="journal_action_container">
 
	            % for entry in entries:
 
		            <div class="journal_icon"> ${h.action_parser(entry)[2]()}</div>
 
		            <div class="journal_action">${h.action_parser(entry)[0]()}</div>
 
		            <div class="journal_repo">
 
		                <span class="journal_repo_name">
 
		                %if entry.repository is not None:
 
		                  ${h.link_to(entry.repository.repo_name,
 
		                              h.url('summary_home',repo_name=entry.repository.repo_name))}
 
		                %else:
 
		                  ${entry.repository_name}
 
		                %endif
0 comments (0 inline, 0 general)