diff --git a/rhodecode/apps/_base/__init__.py b/rhodecode/apps/_base/__init__.py --- a/rhodecode/apps/_base/__init__.py +++ b/rhodecode/apps/_base/__init__.py @@ -242,6 +242,22 @@ class RepoAppView(BaseAppView): 'Requirements are missing for repository %s: %s', self.db_repo_name, safe_unicode(error)) + def _prepare_and_set_clone_url(self, c): + username = '' + if self._rhodecode_user.username != User.DEFAULT_USER: + username = self._rhodecode_user.username + + _def_clone_uri = c.clone_uri_tmpl + _def_clone_uri_id = c.clone_uri_id_tmpl + _def_clone_uri_ssh = c.clone_uri_ssh_tmpl + + c.clone_repo_url = self.db_repo.clone_url( + user=username, uri_tmpl=_def_clone_uri) + c.clone_repo_url_id = self.db_repo.clone_url( + user=username, uri_tmpl=_def_clone_uri_id) + c.clone_repo_url_ssh = self.db_repo.clone_url( + uri_tmpl=_def_clone_uri_ssh, ssh=True) + def _get_local_tmpl_context(self, include_app_defaults=True): _ = self.request.translate c = super(RepoAppView, self)._get_local_tmpl_context( @@ -359,6 +375,7 @@ class RepoAppView(BaseAppView): 'repo_files', repo_name=_repo_name, commit_id=commit.raw_id, f_path=readme_node.path), } + readme_data = self._render_readme_or_none(commit, readme_node, relative_urls) readme_filename = readme_node.unicode_path @@ -366,6 +383,7 @@ class RepoAppView(BaseAppView): readme_data, readme_filename = generate_repo_readme( db_repo.repo_id, landing_commit_id, db_repo.repo_name, path, renderer_type,) + compute_time = time.time() - start log.debug('Repo README for path %s generated and computed in %.4fs', path, compute_time) diff --git a/rhodecode/apps/repository/views/repo_bookmarks.py b/rhodecode/apps/repository/views/repo_bookmarks.py --- a/rhodecode/apps/repository/views/repo_bookmarks.py +++ b/rhodecode/apps/repository/views/repo_bookmarks.py @@ -25,7 +25,7 @@ from rhodecode.apps._base import BaseRef from rhodecode.lib import ext_json from rhodecode.lib import helpers as h from rhodecode.lib.auth import (LoginRequired, HasRepoPermissionAnyDecorator) - +from rhodecode.model.scm import ScmModel log = logging.getLogger(__name__) @@ -37,6 +37,9 @@ class RepoBookmarksView(BaseReferencesVi 'repository.read', 'repository.write', 'repository.admin') def bookmarks(self): c = self.load_default_context() + self._prepare_and_set_clone_url(c) + c.rhodecode_repo = self.rhodecode_vcs_repo + c.repository_forks = ScmModel().get_forks(self.db_repo) if not h.is_hg(self.db_repo): raise HTTPNotFound() diff --git a/rhodecode/apps/repository/views/repo_branches.py b/rhodecode/apps/repository/views/repo_branches.py --- a/rhodecode/apps/repository/views/repo_branches.py +++ b/rhodecode/apps/repository/views/repo_branches.py @@ -24,7 +24,7 @@ import logging from rhodecode.apps._base import BaseReferencesView from rhodecode.lib import ext_json from rhodecode.lib.auth import (LoginRequired, HasRepoPermissionAnyDecorator) - +from rhodecode.model.scm import ScmModel log = logging.getLogger(__name__) @@ -36,6 +36,9 @@ class RepoBranchesView(BaseReferencesVie 'repository.read', 'repository.write', 'repository.admin') def branches(self): c = self.load_default_context() + self._prepare_and_set_clone_url(c) + c.rhodecode_repo = self.rhodecode_vcs_repo + c.repository_forks = ScmModel().get_forks(self.db_repo) ref_items = self.rhodecode_vcs_repo.branches_all.items() data = self.load_refs_context( diff --git a/rhodecode/apps/repository/views/repo_summary.py b/rhodecode/apps/repository/views/repo_summary.py --- a/rhodecode/apps/repository/views/repo_summary.py +++ b/rhodecode/apps/repository/views/repo_summary.py @@ -79,22 +79,6 @@ class RepoSummaryView(RepoAppView): c.comments = self.db_repo.get_comments(page_ids) c.statuses = self.db_repo.statuses(page_ids) - def _prepare_and_set_clone_url(self, c): - username = '' - if self._rhodecode_user.username != User.DEFAULT_USER: - username = safe_str(self._rhodecode_user.username) - - _def_clone_uri = c.clone_uri_tmpl - _def_clone_uri_id = c.clone_uri_id_tmpl - _def_clone_uri_ssh = c.clone_uri_ssh_tmpl - - c.clone_repo_url = self.db_repo.clone_url( - user=username, uri_tmpl=_def_clone_uri) - c.clone_repo_url_id = self.db_repo.clone_url( - user=username, uri_tmpl=_def_clone_uri_id) - c.clone_repo_url_ssh = self.db_repo.clone_url( - uri_tmpl=_def_clone_uri_ssh, ssh=True) - @LoginRequired() @HasRepoPermissionAnyDecorator( 'repository.read', 'repository.write', 'repository.admin') diff --git a/rhodecode/apps/repository/views/repo_tags.py b/rhodecode/apps/repository/views/repo_tags.py --- a/rhodecode/apps/repository/views/repo_tags.py +++ b/rhodecode/apps/repository/views/repo_tags.py @@ -23,6 +23,7 @@ import logging from rhodecode.apps._base import BaseReferencesView from rhodecode.lib import ext_json from rhodecode.lib.auth import (LoginRequired, HasRepoPermissionAnyDecorator) +from rhodecode.model.scm import ScmModel log = logging.getLogger(__name__) @@ -34,6 +35,9 @@ class RepoTagsView(BaseReferencesView): 'repository.read', 'repository.write', 'repository.admin') def tags(self): c = self.load_default_context() + self._prepare_and_set_clone_url(c) + c.rhodecode_repo = self.rhodecode_vcs_repo + c.repository_forks = ScmModel().get_forks(self.db_repo) ref_items = self.rhodecode_vcs_repo.tags.items() data = self.load_refs_context( diff --git a/rhodecode/templates/admin/my_account/my_account_bookmarks.mako b/rhodecode/templates/admin/my_account/my_account_bookmarks.mako --- a/rhodecode/templates/admin/my_account/my_account_bookmarks.mako +++ b/rhodecode/templates/admin/my_account/my_account_bookmarks.mako @@ -43,7 +43,7 @@ % if repo: - ${dt.repo_name(name=repo.repo_name, rtype=repo.repo_type,rstate=None,private=None,archived=False,fork_of=False)} + ${dt.repo_name(name=repo.repo_name, rtype=repo.repo_type,rstate=None,private=None,archived=False, fork_repo_name=None)} ${h.hidden('bookmark_repo', repo.repo_id)} % elif repo_group: ${dt.repo_group_name(repo_group.group_name)} diff --git a/rhodecode/templates/bookmarks/bookmarks.mako b/rhodecode/templates/bookmarks/bookmarks.mako --- a/rhodecode/templates/bookmarks/bookmarks.mako +++ b/rhodecode/templates/bookmarks/bookmarks.mako @@ -1,8 +1,9 @@ ## -*- coding: utf-8 -*- <%inherit file="/base/base.mako"/> +<%namespace name="components" file="/summary/components.mako"/> <%def name="title()"> - ${_('%s Bookmarks') % c.repo_name} + ${_('{} Bookmarks').format(c.repo_name)} %if c.rhodecode_name: · ${h.branding(c.rhodecode_name)} %endif @@ -19,6 +20,10 @@ %def> <%def name="main()"> +