diff --git a/docs/changelog.rst b/docs/changelog.rst --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,9 +22,9 @@ news into clone url - fixed #90 whoosh indexer can index chooses repositories passed in command line -- added dynamic download links in summary. With quick branch/tag selection +- extended journal with day aggregates and paging - implemented #107 customizable code highlights on code sources - +- implemented #108 extended and more powerfull LDAP configuration fixes ----- diff --git a/rhodecode/controllers/journal.py b/rhodecode/controllers/journal.py --- a/rhodecode/controllers/journal.py +++ b/rhodecode/controllers/journal.py @@ -30,10 +30,11 @@ from sqlalchemy import or_ from pylons import request, response, session, tmpl_context as c, url +from webhelpers.paginate import Page + from rhodecode.lib.auth import LoginRequired, NotAnonymous from rhodecode.lib.base import BaseController, render from rhodecode.lib.helpers import get_token -from rhodecode.lib.utils import OrderedDict from rhodecode.model.db import UserLog, UserFollowing from rhodecode.model.scm import ScmModel @@ -65,13 +66,17 @@ class JournalController(BaseController): UserLog.repository_id.in_(repo_ids), UserLog.user_id.in_(user_ids), ))\ - .order_by(UserLog.action_date.desc())\ - .limit(30)\ - .all() + .order_by(UserLog.action_date.desc()) + - c.journal_day_aggreagate = self._get_daily_aggregate(journal) + p = int(request.params.get('page', 1)) + c.journal_pager = Page(journal, page=p, items_per_page=10) + c.journal_day_aggreagate = self._get_daily_aggregate(c.journal_pager) + c.journal_data = render('journal/journal_data.html') + if request.params.get('partial'): + return c.journal_data - return render('/journal.html') + return render('journal/journal.html') def _get_daily_aggregate(self, journal): diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -479,7 +479,7 @@ def action_parser(user_log): if len(revs) > revs_limit: uniq_id = revs[0] html_tmpl = (' %s ' - '%s ' + '%s ' '%s') cs_links += html_tmpl % (_('and'), uniq_id, _('%s more') \ % (len(revs) - revs_limit), 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 @@ -1405,6 +1405,35 @@ padding-top:4px; padding-bottom:4px; } +#journal .journal_day{ +font-size:20px; +padding:10px 0px; +border-bottom:2px solid #DDD; +margin-left:10px; +margin-right:10px; +} + +#journal .journal_action{ +padding-top:4px; +min-height:15px; +} + +#journal .journal_icon{ +float: left; +padding-top: 4px; +padding-left:12px; +} + +#journal .journal_repo{ +margin-left: 38px; +padding-top: 5px; +} + +#journal .journal_repo .journal_repo_name{ +font-weight: bold; +font-size: 1.1em; +} + .trending_language_tbl,.trending_language_tbl td { border:0 !important; margin:0 !important; diff --git a/rhodecode/templates/base/base.html b/rhodecode/templates/base/base.html --- a/rhodecode/templates/base/base.html +++ b/rhodecode/templates/base/base.html @@ -105,7 +105,12 @@

RhodeCode ${c.rhodecode_version} © 2010 by Marcin Kuzminski

- + diff --git a/rhodecode/templates/journal.html b/rhodecode/templates/journal/journal.html rename from rhodecode/templates/journal.html rename to rhodecode/templates/journal/journal.html --- a/rhodecode/templates/journal.html +++ b/rhodecode/templates/journal/journal.html @@ -1,5 +1,5 @@ ## -*- coding: utf-8 -*- -<%inherit file="base/base.html"/> +<%inherit file="/base/base.html"/> <%def name="title()"> ${_('Journal')} - ${c.rhodecode_name} @@ -16,38 +16,16 @@
${_('Journal')}
-
- %if c.journal_day_aggreagate: - %for day,items in c.journal_day_aggreagate: -
${day}
- % for entry in items: -
-
- gravatar -
-
${entry.user.name} ${entry.user.lastname}
-
${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)} -
-
-
- %endfor - %endfor - %else: - ${_('No entries yet')} - %endif -
+ +
${c.journal_data}
@@ -56,40 +34,31 @@
${_('Following')}
- %if c.following: - %for entry in c.following: -
- %if entry.follows_user_id: - ${_('user')} - ${entry.follows_user.full_contact} - %endif - - %if entry.follows_repo_id: - - %if entry.follows_repository.private: - ${_('private repository')} - %else: - ${_('public repository')} - %endif - - ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home', - repo_name=entry.follows_repository.repo_name))} - - %endif -
- %endfor - %else: - ${_('You are not following any users or repositories')} - %endif + %if c.following: + %for entry in c.following: +
+ %if entry.follows_user_id: + ${_('user')} + ${entry.follows_user.full_contact} + %endif + + %if entry.follows_repo_id: + + %if entry.follows_repository.private: + ${_('private repository')} + %else: + ${_('public repository')} + %endif + + ${h.link_to(entry.follows_repository.repo_name,h.url('summary_home', + repo_name=entry.follows_repository.repo_name))} + + %endif +
+ %endfor + %else: + ${_('You are not following any users or repositories')} + %endif
- - - - + diff --git a/rhodecode/templates/shortlog/shortlog_data.html b/rhodecode/templates/shortlog/shortlog_data.html --- a/rhodecode/templates/shortlog/shortlog_data.html +++ b/rhodecode/templates/shortlog/shortlog_data.html @@ -49,14 +49,15 @@ var data_div = 'shortlog_data'; 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');});}); + YAHOO.util.Dom.setStyle(data_div,'opacity','0.3');});});
${c.repo_changesets.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(){ +tooltip_activate(); +YUE.on(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;""")}