Mercurial > kallithea
changeset 637:b04d5214fd3c beta
removed shortlog from main menu, as duplicated functionality of changelog,
moved shortlog as ajax pagin in summary
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 26 Oct 2010 04:01:38 +0200 |
parents | ffd07396d315 |
children | 19494bbd0aa1 |
files | rhodecode/controllers/summary.py rhodecode/templates/base/base.html rhodecode/templates/summary/summary.html |
diffstat | 3 files changed, 42 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/controllers/summary.py Tue Oct 26 03:20:32 2010 +0200 +++ b/rhodecode/controllers/summary.py Tue Oct 26 04:01:38 2010 +0200 @@ -43,19 +43,24 @@ log = logging.getLogger(__name__) class SummaryController(BaseController): - + @LoginRequired() @HasRepoPermissionAnyDecorator('repository.read', 'repository.write', - 'repository.admin') + 'repository.admin') def __before__(self): super(SummaryController, self).__before__() - + def index(self): hg_model = HgModel() c.repo_info = hg_model.get_repo(c.repo_name) - c.repo_changesets = Page(list(c.repo_info[:10]), page=1, items_per_page=20) + def url_generator(**kw): + return url('shortlog_home', repo_name=c.repo_name, **kw) + + c.repo_changesets = Page(c.repo_info, page=1, items_per_page=10, + url=url_generator) + e = request.environ - + uri = u'%(protocol)s://%(user)s@%(host)s%(prefix)s/%(repo_name)s' % { 'protocol': e.get('wsgi.url_scheme'), 'user':str(c.rhodecode_user.username), @@ -66,30 +71,30 @@ c.repo_tags = OrderedDict() for name, hash in c.repo_info.tags.items()[:10]: c.repo_tags[name] = c.repo_info.get_changeset(hash) - + c.repo_branches = OrderedDict() for name, hash in c.repo_info.branches.items()[:10]: c.repo_branches[name] = c.repo_info.get_changeset(hash) - - td = datetime.today() + timedelta(days=1) + + td = datetime.today() + timedelta(days=1) y, m, d = td.year, td.month, td.day - + ts_min_y = mktime((y - 1, (td - timedelta(days=calendar.mdays[m])).month, d, 0, 0, 0, 0, 0, 0,)) ts_min_m = mktime((y, (td - timedelta(days=calendar.mdays[m])).month, d, 0, 0, 0, 0, 0, 0,)) - + ts_max_y = mktime((y, m, d, 0, 0, 0, 0, 0, 0,)) - + run_task(get_commits_stats, c.repo_info.name, ts_min_y, ts_max_y) c.ts_min = ts_min_m c.ts_max = ts_max_y - + stats = self.sa.query(Statistics)\ .filter(Statistics.repository == c.repo_info.dbrepo)\ .scalar() - - + + if stats and stats.languages: lang_stats = json.loads(stats.languages) c.commit_data = stats.commit_activity @@ -103,6 +108,6 @@ c.commit_data = json.dumps({}) c.overview_data = json.dumps([[ts_min_y, 0], [ts_max_y, 0] ]) c.trending_languages = json.dumps({}) - + return render('summary/summary.html')
--- a/rhodecode/templates/base/base.html Tue Oct 26 03:20:32 2010 +0200 +++ b/rhodecode/templates/base/base.html Tue Oct 26 04:01:38 2010 +0200 @@ -116,14 +116,14 @@ <span>${_('Summary')}</span> </a> </li> - <li ${is_current('shortlog')}> - <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}"> - <span class="icon"> - <img src="/images/icons/application_view_list.png" alt="${_('Shortlog')}" /> - </span> - <span>${_('Shortlog')}</span> - </a> - </li> + ##<li ${is_current('shortlog')}> + ## <a title="${_('Shortlog')}" href="${h.url('shortlog_home',repo_name=c.repo_name)}"> + ## <span class="icon"> + ## <img src="/images/icons/application_view_list.png" alt="${_('Shortlog')}" /> + ## </span> + ## <span>${_('Shortlog')}</span> + ## </a> + ##</li> <li ${is_current('changelog')}> <a title="${_('Changelog')}" href="${h.url('changelog_home',repo_name=c.repo_name)}"> <span class="icon"> @@ -142,7 +142,7 @@ </a> <ul> <li> - ${h.link_to(_('branches'),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')} + ${h.link_to('%s (%s)' % (_('branches'),len(c.repository_branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')} <ul> %if c.repository_branches.values(): %for cnt,branch in enumerate(c.repository_branches.items()): @@ -154,7 +154,7 @@ </ul> </li> <li> - ${h.link_to(_('tags'),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')} + ${h.link_to('%s (%s)' % (_('tags'),len(c.repository_tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')} <ul> %if c.repository_tags.values(): %for cnt,tag in enumerate(c.repository_tags.items()):
--- a/rhodecode/templates/summary/summary.html Tue Oct 26 03:20:32 2010 +0200 +++ b/rhodecode/templates/summary/summary.html Tue Oct 26 04:01:38 2010 +0200 @@ -42,14 +42,12 @@ <label>${_('Name')}:</label> </div> <div class="input-short"> - - %if c.repo_info.dbrepo.repo_type =='hg': - <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/> - %elif c.repo_info.dbrepo.repo_type =='git': - <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/> - %else: - - %endif + %if c.repo_info.dbrepo.repo_type =='hg': + <img style="margin-bottom:2px" class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="/images/icons/hgicon.png"/> + %endif + %if c.repo_info.dbrepo.repo_type =='git': + <img style="margin-bottom:2px" class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="/images/icons/giticon.png"/> + %endif %if c.repo_info.dbrepo.private: <img style="margin-bottom:2px" class="icon" title="${_('private repository')}" alt="${_('private repository')}" src="/images/icons/lock.png"/> @@ -561,10 +559,12 @@ <div class="breadcrumbs">${h.link_to(_('Last ten changes'),h.url('changelog_home',repo_name=c.repo_name))}</div> </div> <div class="table"> - <%include file='../shortlog/shortlog_data.html'/> - %if c.repo_changesets: - ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))} - %endif + <div id="shortlog_data"> + <%include file='../shortlog/shortlog_data.html'/> + </div> + ##%if c.repo_changesets: + ## ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))} + ##%endif </div> </div> <div class="box">