files: ported repository files controllers to pyramid views.
This commit is contained in:
parent
5184f34ead
commit
53611d6f94
39 changed files with 1833 additions and 1592 deletions
|
|
@ -250,12 +250,21 @@ class BaseReferencesView(RepoAppView):
|
|||
|
||||
# TODO: johbo: Unify generation of reference links
|
||||
use_commit_id = '/' in ref_name or is_svn
|
||||
files_url = h.url(
|
||||
'files_home',
|
||||
repo_name=self.db_repo_name,
|
||||
f_path=ref_name if is_svn else '',
|
||||
revision=commit_id if use_commit_id else ref_name,
|
||||
at=ref_name)
|
||||
|
||||
if use_commit_id:
|
||||
files_url = h.route_path(
|
||||
'repo_files',
|
||||
repo_name=self.db_repo_name,
|
||||
f_path=ref_name if is_svn else '',
|
||||
commit_id=commit_id)
|
||||
|
||||
else:
|
||||
files_url = h.route_path(
|
||||
'repo_files',
|
||||
repo_name=self.db_repo_name,
|
||||
f_path=ref_name if is_svn else '',
|
||||
commit_id=ref_name,
|
||||
_query=dict(at=ref_name))
|
||||
|
||||
data.append({
|
||||
"name": _render('name', ref_name, files_url, closed),
|
||||
|
|
|
|||
|
|
@ -37,6 +37,95 @@ def includeme(config):
|
|||
name='repo_commit',
|
||||
pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True)
|
||||
|
||||
# repo files
|
||||
config.add_route(
|
||||
name='repo_archivefile',
|
||||
pattern='/{repo_name:.*?[^/]}/archive/{fname}', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_files_diff',
|
||||
pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True)
|
||||
config.add_route( # legacy route to make old links work
|
||||
name='repo_files_diff_2way_redirect',
|
||||
pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_files',
|
||||
pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_files:default_path',
|
||||
pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_files:default_commit',
|
||||
pattern='/{repo_name:.*?[^/]}/files', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_files:rendered',
|
||||
pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_files:annotated',
|
||||
pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_files:annotated_previous',
|
||||
pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_nodetree_full',
|
||||
pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_nodetree_full:default_path',
|
||||
pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_files_nodelist',
|
||||
pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_file_raw',
|
||||
pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_file_download',
|
||||
pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
config.add_route( # backward compat to keep old links working
|
||||
name='repo_file_download:legacy',
|
||||
pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}',
|
||||
repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_file_history',
|
||||
pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_file_authors',
|
||||
pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True)
|
||||
|
||||
config.add_route(
|
||||
name='repo_files_remove_file',
|
||||
pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}',
|
||||
repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_files_delete_file',
|
||||
pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}',
|
||||
repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_files_edit_file',
|
||||
pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}',
|
||||
repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_files_update_file',
|
||||
pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}',
|
||||
repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_files_add_file',
|
||||
pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}',
|
||||
repo_route=True)
|
||||
config.add_route(
|
||||
name='repo_files_create_file',
|
||||
pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}',
|
||||
repo_route=True)
|
||||
|
||||
# refs data
|
||||
config.add_route(
|
||||
name='repo_refs_data',
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -384,7 +384,7 @@ class TestCreateReferenceData(object):
|
|||
|
||||
class TestCreateFilesUrl(object):
|
||||
|
||||
def test_creates_non_svn_url(self, summary_view):
|
||||
def test_creates_non_svn_url(self, app, summary_view):
|
||||
repo = mock.Mock()
|
||||
repo.name = 'abcde'
|
||||
full_repo_name = 'test-repo-group/' + repo.name
|
||||
|
|
@ -392,15 +392,15 @@ class TestCreateFilesUrl(object):
|
|||
raw_id = 'deadbeef0123456789'
|
||||
is_svn = False
|
||||
|
||||
with mock.patch('rhodecode.lib.helpers.url') as url_mock:
|
||||
with mock.patch('rhodecode.lib.helpers.route_path') as url_mock:
|
||||
result = summary_view._create_files_url(
|
||||
repo, full_repo_name, ref_name, raw_id, is_svn)
|
||||
url_mock.assert_called_once_with(
|
||||
'files_home', repo_name=full_repo_name, f_path='',
|
||||
revision=ref_name, at=ref_name)
|
||||
'repo_files', repo_name=full_repo_name, commit_id=ref_name,
|
||||
f_path='', _query=dict(at=ref_name))
|
||||
assert result == url_mock.return_value
|
||||
|
||||
def test_creates_svn_url(self, summary_view):
|
||||
def test_creates_svn_url(self, app, summary_view):
|
||||
repo = mock.Mock()
|
||||
repo.name = 'abcde'
|
||||
full_repo_name = 'test-repo-group/' + repo.name
|
||||
|
|
@ -408,15 +408,15 @@ class TestCreateFilesUrl(object):
|
|||
raw_id = 'deadbeef0123456789'
|
||||
is_svn = True
|
||||
|
||||
with mock.patch('rhodecode.lib.helpers.url') as url_mock:
|
||||
with mock.patch('rhodecode.lib.helpers.route_path') as url_mock:
|
||||
result = summary_view._create_files_url(
|
||||
repo, full_repo_name, ref_name, raw_id, is_svn)
|
||||
url_mock.assert_called_once_with(
|
||||
'files_home', repo_name=full_repo_name, f_path=ref_name,
|
||||
revision=raw_id, at=ref_name)
|
||||
'repo_files', repo_name=full_repo_name, f_path=ref_name,
|
||||
commit_id=raw_id, _query=dict(at=ref_name))
|
||||
assert result == url_mock.return_value
|
||||
|
||||
def test_name_has_slashes(self, summary_view):
|
||||
def test_name_has_slashes(self, app, summary_view):
|
||||
repo = mock.Mock()
|
||||
repo.name = 'abcde'
|
||||
full_repo_name = 'test-repo-group/' + repo.name
|
||||
|
|
@ -424,12 +424,12 @@ class TestCreateFilesUrl(object):
|
|||
raw_id = 'deadbeef0123456789'
|
||||
is_svn = False
|
||||
|
||||
with mock.patch('rhodecode.lib.helpers.url') as url_mock:
|
||||
with mock.patch('rhodecode.lib.helpers.route_path') as url_mock:
|
||||
result = summary_view._create_files_url(
|
||||
repo, full_repo_name, ref_name, raw_id, is_svn)
|
||||
url_mock.assert_called_once_with(
|
||||
'files_home', repo_name=full_repo_name, f_path='', revision=raw_id,
|
||||
at=ref_name)
|
||||
'repo_files', repo_name=full_repo_name, commit_id=raw_id,
|
||||
f_path='', _query=dict(at=ref_name))
|
||||
assert result == url_mock.return_value
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -74,10 +74,9 @@ class RepoSummaryView(RepoAppView):
|
|||
log.debug("Searching for a README file.")
|
||||
readme_node = ReadmeFinder(default_renderer).search(commit)
|
||||
if readme_node:
|
||||
relative_url = h.url('files_raw_home',
|
||||
repo_name=repo_name,
|
||||
revision=commit.raw_id,
|
||||
f_path=readme_node.path)
|
||||
relative_url = h.route_path(
|
||||
'repo_file_raw', 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_url)
|
||||
readme_filename = readme_node.path
|
||||
|
|
@ -360,9 +359,9 @@ class RepoSummaryView(RepoAppView):
|
|||
|
||||
def _create_files_url(self, repo, full_repo_name, ref_name, raw_id, is_svn):
|
||||
use_commit_id = '/' in ref_name or is_svn
|
||||
return h.url(
|
||||
'files_home',
|
||||
return h.route_path(
|
||||
'repo_files',
|
||||
repo_name=full_repo_name,
|
||||
f_path=ref_name if is_svn else '',
|
||||
revision=raw_id if use_commit_id else ref_name,
|
||||
at=ref_name)
|
||||
commit_id=raw_id if use_commit_id else ref_name,
|
||||
_query=dict(at=ref_name))
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ def make_pyramid_app(global_config, **settings):
|
|||
|
||||
includeme_first(config)
|
||||
includeme(config)
|
||||
|
||||
pyramid_app = config.make_wsgi_app()
|
||||
pyramid_app = wrap_app_in_wsgi_middlewares(pyramid_app, config)
|
||||
pyramid_app.config = config
|
||||
|
|
|
|||
|
|
@ -726,132 +726,6 @@ def make_map(config):
|
|||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('files_home', '/{repo_name}/files/{revision}/{f_path}',
|
||||
controller='files', revision='tip', f_path='',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('files_home_simple_catchrev',
|
||||
'/{repo_name}/files/{revision}',
|
||||
controller='files', revision='tip', f_path='',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_home_simple_catchall',
|
||||
'/{repo_name}/files',
|
||||
controller='files', revision='tip', f_path='',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_history_home',
|
||||
'/{repo_name}/history/{revision}/{f_path}',
|
||||
controller='files', action='history', revision='tip', f_path='',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('files_authors_home',
|
||||
'/{repo_name}/authors/{revision}/{f_path}',
|
||||
controller='files', action='authors', revision='tip', f_path='',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('files_diff_home', '/{repo_name}/diff/{f_path}',
|
||||
controller='files', action='diff', f_path='',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_diff_2way_home',
|
||||
'/{repo_name}/diff-2way/{f_path}',
|
||||
controller='files', action='diff_2way', f_path='',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_rawfile_home',
|
||||
'/{repo_name}/rawfile/{revision}/{f_path}',
|
||||
controller='files', action='rawfile', revision='tip',
|
||||
f_path='', conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_raw_home',
|
||||
'/{repo_name}/raw/{revision}/{f_path}',
|
||||
controller='files', action='raw', revision='tip', f_path='',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_render_home',
|
||||
'/{repo_name}/render/{revision}/{f_path}',
|
||||
controller='files', action='index', revision='tip', f_path='',
|
||||
rendered=True, conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_annotate_home',
|
||||
'/{repo_name}/annotate/{revision}/{f_path}',
|
||||
controller='files', action='index', revision='tip',
|
||||
f_path='', annotate=True, conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('files_annotate_previous',
|
||||
'/{repo_name}/annotate-previous/{revision}/{f_path}',
|
||||
controller='files', action='annotate_previous', revision='tip',
|
||||
f_path='', annotate=True, conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('files_edit',
|
||||
'/{repo_name}/edit/{revision}/{f_path}',
|
||||
controller='files', action='edit', revision='tip',
|
||||
f_path='',
|
||||
conditions={'function': check_repo, 'method': ['POST']},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_edit_home',
|
||||
'/{repo_name}/edit/{revision}/{f_path}',
|
||||
controller='files', action='edit_home', revision='tip',
|
||||
f_path='', conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_add',
|
||||
'/{repo_name}/add/{revision}/{f_path}',
|
||||
controller='files', action='add', revision='tip',
|
||||
f_path='',
|
||||
conditions={'function': check_repo, 'method': ['POST']},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_add_home',
|
||||
'/{repo_name}/add/{revision}/{f_path}',
|
||||
controller='files', action='add_home', revision='tip',
|
||||
f_path='', conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_delete',
|
||||
'/{repo_name}/delete/{revision}/{f_path}',
|
||||
controller='files', action='delete', revision='tip',
|
||||
f_path='',
|
||||
conditions={'function': check_repo, 'method': ['POST']},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_delete_home',
|
||||
'/{repo_name}/delete/{revision}/{f_path}',
|
||||
controller='files', action='delete_home', revision='tip',
|
||||
f_path='', conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS)
|
||||
|
||||
rmap.connect('files_archive_home', '/{repo_name}/archive/{fname}',
|
||||
controller='files', action='archivefile',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('files_nodelist_home',
|
||||
'/{repo_name}/nodelist/{revision}/{f_path}',
|
||||
controller='files', action='nodelist',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('files_nodetree_full',
|
||||
'/{repo_name}/nodetree_full/{commit_id}/{f_path}',
|
||||
controller='files', action='nodetree_full',
|
||||
conditions={'function': check_repo},
|
||||
requirements=URL_NAME_REQUIREMENTS, jsroute=True)
|
||||
|
||||
rmap.connect('repo_fork_create_home', '/{repo_name}/fork',
|
||||
controller='forks', action='fork_create',
|
||||
conditions={'function': check_repo, 'method': ['POST']},
|
||||
|
|
|
|||
|
|
@ -258,9 +258,10 @@ def files_breadcrumbs(repo_name, commit_id, file_path):
|
|||
url_segments = [
|
||||
link_to(
|
||||
repo_name_html,
|
||||
url('files_home',
|
||||
route_path(
|
||||
'repo_files',
|
||||
repo_name=repo_name,
|
||||
revision=commit_id,
|
||||
commit_id=commit_id,
|
||||
f_path=''),
|
||||
class_='pjax-link')]
|
||||
|
||||
|
|
@ -274,9 +275,10 @@ def files_breadcrumbs(repo_name, commit_id, file_path):
|
|||
url_segments.append(
|
||||
link_to(
|
||||
segment_html,
|
||||
url('files_home',
|
||||
route_path(
|
||||
'repo_files',
|
||||
repo_name=repo_name,
|
||||
revision=commit_id,
|
||||
commit_id=commit_id,
|
||||
f_path='/'.join(path_segments[:cnt + 1])),
|
||||
class_='pjax-link'))
|
||||
else:
|
||||
|
|
@ -1541,6 +1543,9 @@ def format_byte_size_binary(file_size):
|
|||
"""
|
||||
Formats file/folder sizes to standard.
|
||||
"""
|
||||
if file_size is None:
|
||||
file_size = 0
|
||||
|
||||
formatted_size = format_byte_size(file_size, binary=True)
|
||||
return formatted_size
|
||||
|
||||
|
|
@ -1740,8 +1745,9 @@ def render_binary(repo_name, file_obj):
|
|||
for ext in ['*.png', '*.jpg', '*.ico', '*.gif']:
|
||||
if fnmatch.fnmatch(filename, pat=ext):
|
||||
alt = filename
|
||||
src = url('files_raw_home', repo_name=repo_name,
|
||||
revision=file_obj.commit.raw_id, f_path=file_obj.path)
|
||||
src = route_path(
|
||||
'repo_file_raw', repo_name=repo_name,
|
||||
commit_id=file_obj.commit.raw_id, f_path=file_obj.path)
|
||||
return literal('<img class="rendered-binary" alt="{}" src="{}">'.format(alt, src))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -70,20 +70,20 @@ function setRCMouseBindings(repoName, repoLandingRev) {
|
|||
});
|
||||
Mousetrap.bind(['g F'], function(e) {
|
||||
window.location = pyroutes.url(
|
||||
'files_home',
|
||||
'repo_files',
|
||||
{
|
||||
'repo_name': repoName,
|
||||
'revision': repoLandingRev,
|
||||
'commit_id': repoLandingRev,
|
||||
'f_path': '',
|
||||
'search': '1'
|
||||
});
|
||||
});
|
||||
Mousetrap.bind(['g f'], function(e) {
|
||||
window.location = pyroutes.url(
|
||||
'files_home',
|
||||
'repo_files',
|
||||
{
|
||||
'repo_name': repoName,
|
||||
'revision': repoLandingRev,
|
||||
'commit_id': repoLandingRev,
|
||||
'f_path': ''
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -33,14 +33,6 @@ function registerRCRoutes() {
|
|||
pyroutes.register('changelog_home', '/%(repo_name)s/changelog', ['repo_name']);
|
||||
pyroutes.register('changelog_file_home', '/%(repo_name)s/changelog/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
|
||||
pyroutes.register('changelog_elements', '/%(repo_name)s/changelog_details', ['repo_name']);
|
||||
pyroutes.register('files_home', '/%(repo_name)s/files/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
|
||||
pyroutes.register('files_history_home', '/%(repo_name)s/history/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
|
||||
pyroutes.register('files_authors_home', '/%(repo_name)s/authors/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
|
||||
pyroutes.register('files_annotate_home', '/%(repo_name)s/annotate/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
|
||||
pyroutes.register('files_annotate_previous', '/%(repo_name)s/annotate-previous/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
|
||||
pyroutes.register('files_archive_home', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']);
|
||||
pyroutes.register('files_nodelist_home', '/%(repo_name)s/nodelist/%(revision)s/%(f_path)s', ['repo_name', 'revision', 'f_path']);
|
||||
pyroutes.register('files_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('favicon', '/favicon.ico', []);
|
||||
pyroutes.register('robots', '/robots.txt', []);
|
||||
pyroutes.register('auth_home', '/_admin/auth*traverse', []);
|
||||
|
|
@ -106,6 +98,29 @@ function registerRCRoutes() {
|
|||
pyroutes.register('repo_summary_explicit', '/%(repo_name)s/summary', ['repo_name']);
|
||||
pyroutes.register('repo_summary_commits', '/%(repo_name)s/summary-commits', ['repo_name']);
|
||||
pyroutes.register('repo_commit', '/%(repo_name)s/changeset/%(commit_id)s', ['repo_name', 'commit_id']);
|
||||
pyroutes.register('repo_archivefile', '/%(repo_name)s/archive/%(fname)s', ['repo_name', 'fname']);
|
||||
pyroutes.register('repo_files_diff', '/%(repo_name)s/diff/%(f_path)s', ['repo_name', 'f_path']);
|
||||
pyroutes.register('repo_files_diff_2way_redirect', '/%(repo_name)s/diff-2way/%(f_path)s', ['repo_name', 'f_path']);
|
||||
pyroutes.register('repo_files', '/%(repo_name)s/files/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files:default_path', '/%(repo_name)s/files/%(commit_id)s/', ['repo_name', 'commit_id']);
|
||||
pyroutes.register('repo_files:default_commit', '/%(repo_name)s/files', ['repo_name']);
|
||||
pyroutes.register('repo_files:rendered', '/%(repo_name)s/render/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files:annotated', '/%(repo_name)s/annotate/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files:annotated_previous', '/%(repo_name)s/annotate-previous/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_nodetree_full', '/%(repo_name)s/nodetree_full/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_nodetree_full:default_path', '/%(repo_name)s/nodetree_full/%(commit_id)s/', ['repo_name', 'commit_id']);
|
||||
pyroutes.register('repo_files_nodelist', '/%(repo_name)s/nodelist/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_file_raw', '/%(repo_name)s/raw/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_file_download', '/%(repo_name)s/download/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_file_download:legacy', '/%(repo_name)s/rawfile/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_file_history', '/%(repo_name)s/history/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_file_authors', '/%(repo_name)s/authors/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files_remove_file', '/%(repo_name)s/remove_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files_delete_file', '/%(repo_name)s/delete_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files_edit_file', '/%(repo_name)s/edit_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files_update_file', '/%(repo_name)s/update_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files_add_file', '/%(repo_name)s/add_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_files_create_file', '/%(repo_name)s/create_file/%(commit_id)s/%(f_path)s', ['repo_name', 'commit_id', 'f_path']);
|
||||
pyroutes.register('repo_refs_data', '/%(repo_name)s/refs-data', ['repo_name']);
|
||||
pyroutes.register('repo_refs_changelog_data', '/%(repo_name)s/refs-data-changelog', ['repo_name']);
|
||||
pyroutes.register('repo_stats', '/%(repo_name)s/repo_stats/%(commit_id)s', ['repo_name', 'commit_id']);
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ var select2RefSwitcher = function(targetElement, initialData) {
|
|||
};
|
||||
|
||||
var select2FileHistorySwitcher = function(targetElement, initialData, state) {
|
||||
var loadUrl = pyroutes.url('files_history_home',
|
||||
{'repo_name': templateContext.repo_name, 'revision': state.rev,
|
||||
var loadUrl = pyroutes.url('repo_file_history',
|
||||
{'repo_name': templateContext.repo_name, 'commit_id': state.rev,
|
||||
'f_path': state.f_path});
|
||||
select2RefBaseSwitcher(targetElement, loadUrl, initialData);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@
|
|||
<ul id="context-pages" class="horizontal-list navigation">
|
||||
<li class="${is_active('summary')}"><a class="menulink" href="${h.route_path('repo_summary', repo_name=c.repo_name)}"><div class="menulabel">${_('Summary')}</div></a></li>
|
||||
<li class="${is_active('changelog')}"><a class="menulink" href="${h.url('changelog_home', repo_name=c.repo_name)}"><div class="menulabel">${_('Changelog')}</div></a></li>
|
||||
<li class="${is_active('files')}"><a class="menulink" href="${h.url('files_home', repo_name=c.repo_name, revision=c.rhodecode_db_repo.landing_rev[1])}"><div class="menulabel">${_('Files')}</div></a></li>
|
||||
<li class="${is_active('files')}"><a class="menulink" href="${h.route_path('repo_files', repo_name=c.repo_name, commit_id=c.rhodecode_db_repo.landing_rev[1], f_path='')}"><div class="menulabel">${_('Files')}</div></a></li>
|
||||
<li class="${is_active('compare')}">
|
||||
<a class="menulink" href="${h.url('compare_home',repo_name=c.repo_name)}"><div class="menulabel">${_('Compare')}</div></a>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,6 @@
|
|||
|
||||
<%def name="commit(message, commit_id, commit_idx)">
|
||||
<div>
|
||||
<pre><a title="${h.tooltip(message)}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre>
|
||||
<pre><a title="${h.tooltip(message)}" href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre>
|
||||
</div>
|
||||
</%def>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,6 @@
|
|||
|
||||
<%def name="commit(message, commit_id, commit_idx)">
|
||||
<div>
|
||||
<pre><a title="${h.tooltip(message)}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre>
|
||||
<pre><a title="${h.tooltip(message)}" href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre>
|
||||
</div>
|
||||
</%def>
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@
|
|||
%if h.is_hg(c.rhodecode_repo):
|
||||
%for book in commit.bookmarks:
|
||||
<span class="tag booktag" title="${h.tooltip(_('Bookmark %s') % book)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
|
||||
</span>
|
||||
%endfor
|
||||
%endif
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
## tags
|
||||
%for tag in commit.tags:
|
||||
<span class="tag tagtag" title="${h.tooltip(_('Tag %s') % tag)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
|
||||
</span>
|
||||
%endfor
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
</code>
|
||||
</td>
|
||||
<td class="td-actions">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,f_path=c.changelog_for_path,revision=cs.raw_id)}">
|
||||
<a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=cs.raw_id,f_path=c.changelog_for_path)}">
|
||||
${_('Show File')}
|
||||
</a>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -110,20 +110,20 @@
|
|||
%if h.is_hg(c.rhodecode_repo):
|
||||
%for book in c.commit.bookmarks:
|
||||
<span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
|
||||
</span>
|
||||
%endfor
|
||||
%endif
|
||||
|
||||
%for tag in c.commit.tags:
|
||||
<span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-tag"></i>${tag}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=tag))}"><i class="icon-tag"></i>${tag}</a>
|
||||
</span>
|
||||
%endfor
|
||||
|
||||
%if c.commit.branch:
|
||||
<span class="branchtag tag" title="${h.tooltip(_('Branch %s') % c.commit.branch)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id)}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=c.commit.raw_id,_query=dict(at=c.commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(c.commit.branch)}</a>
|
||||
</span>
|
||||
%endif
|
||||
</div>
|
||||
|
|
@ -339,7 +339,7 @@
|
|||
|
||||
// browse tree @ revision
|
||||
$('#files_link').on('click', function(e){
|
||||
window.location = '${h.url('files_home',repo_name=c.repo_name, revision=c.commit.raw_id, f_path='')}';
|
||||
window.location = '${h.route_path('repo_files:default_path',repo_name=c.repo_name, commit_id=c.commit.raw_id)}';
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ collapse_all = len(diffset.files) > collapse_when_files_over
|
|||
<div class="diffset-heading ${diffset.limited_diff and 'diffset-heading-warning' or ''}">
|
||||
%if commit:
|
||||
<div class="pull-right">
|
||||
<a class="btn tooltip" title="${h.tooltip(_('Browse Files at revision {}').format(commit.raw_id))}" href="${h.url('files_home',repo_name=diffset.repo_name, revision=commit.raw_id, f_path='')}">
|
||||
<a class="btn tooltip" title="${h.tooltip(_('Browse Files at revision {}').format(commit.raw_id))}" href="${h.route_path('repo_files',repo_name=diffset.repo_name, commit_id=commit.raw_id, f_path='')}">
|
||||
${_('Browse Files')}
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -410,7 +410,7 @@ from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
|
|||
%if filediff.operation in ['D', 'M']:
|
||||
<a
|
||||
class="tooltip"
|
||||
href="${h.url('files_home',repo_name=filediff.diffset.repo_name,f_path=filediff.source_file_path,revision=filediff.diffset.source_ref)}"
|
||||
href="${h.route_path('repo_files',repo_name=filediff.diffset.repo_name,commit_id=filediff.diffset.source_ref,f_path=filediff.source_file_path)}"
|
||||
title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.source_ref[:12]})}"
|
||||
>
|
||||
${_('Show file before')}
|
||||
|
|
@ -426,7 +426,7 @@ from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
|
|||
%if filediff.operation in ['A', 'M']:
|
||||
<a
|
||||
class="tooltip"
|
||||
href="${h.url('files_home',repo_name=filediff.diffset.source_repo_name,f_path=filediff.target_file_path,revision=filediff.diffset.target_ref)}"
|
||||
href="${h.route_path('repo_files',repo_name=filediff.diffset.source_repo_name,commit_id=filediff.diffset.target_ref,f_path=filediff.target_file_path)}"
|
||||
title="${h.tooltip(_('Show file at commit: %(commit_id)s') % {'commit_id': filediff.diffset.target_ref[:12]})}"
|
||||
>
|
||||
${_('Show file after')}
|
||||
|
|
@ -442,14 +442,14 @@ from rhodecode.lib.diffs import NEW_FILENODE, DEL_FILENODE, \
|
|||
<a
|
||||
class="tooltip"
|
||||
title="${h.tooltip(_('Raw diff'))}"
|
||||
href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw')}"
|
||||
href="${h.route_path('repo_files_diff',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path, _query=dict(diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='raw'))}"
|
||||
>
|
||||
${_('Raw diff')}
|
||||
</a> |
|
||||
<a
|
||||
class="tooltip"
|
||||
title="${h.tooltip(_('Download diff'))}"
|
||||
href="${h.url('files_diff_home',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path,diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download')}"
|
||||
href="${h.route_path('repo_files_diff',repo_name=filediff.diffset.repo_name,f_path=filediff.target_file_path, _query=dict(diff2=filediff.diffset.target_ref,diff1=filediff.diffset.source_ref,diff='download'))}"
|
||||
>
|
||||
${_('Download diff')}
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<div class="cb-annotate-message truncate-wrap">${h.chop_at_smart(annotation.message, '\n', suffix_if_chopped='...')}</div>
|
||||
</td>
|
||||
<td class="cb-annotate-message-spacer">
|
||||
<a class="tooltip" href="#show-previous-annotation" onclick="return annotationController.previousAnnotation('${annotation.raw_id}', '${c.f_path}')" title="${tooltip(_('view annotation from before this change'))}">
|
||||
<a class="tooltip" href="#show-previous-annotation" onclick="return annotationController.previousAnnotation('${annotation.raw_id}', '${c.f_path}', ${line_num})" title="${tooltip(_('view annotation from before this change'))}">
|
||||
<i class="icon-left"></i>
|
||||
</a>
|
||||
</td>
|
||||
|
|
@ -76,13 +76,14 @@
|
|||
var AnnotationController = function() {
|
||||
var self = this;
|
||||
|
||||
this.previousAnnotation = function(commitId, fPath) {
|
||||
this.previousAnnotation = function(commitId, fPath, lineNo) {
|
||||
var params = {
|
||||
'repo_name': templateContext.repo_name,
|
||||
'revision': commitId,
|
||||
'f_path': fPath
|
||||
'commit_id': commitId,
|
||||
'f_path': fPath,
|
||||
'line_anchor': lineNo
|
||||
};
|
||||
window.location = pyroutes.url('files_annotate_previous', params);
|
||||
window.location = pyroutes.url('repo_files:annotated_previous', params);
|
||||
return false;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a title="${_('Files')}" href="${h.url('files_home',repo_name=repo_name)}">
|
||||
<a title="${_('Files')}" href="${h.route_path('repo_files:default_commit',repo_name=repo_name)}">
|
||||
<span>${_('Files')}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -8,20 +8,20 @@
|
|||
%if h.is_hg(c.rhodecode_repo):
|
||||
%for book in commit.bookmarks:
|
||||
<span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id,_query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
|
||||
</span>
|
||||
%endfor
|
||||
%endif
|
||||
|
||||
%for tag in commit.tags:
|
||||
<span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-tag"></i>${tag}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id,_query=dict(at=tag))}"><i class="icon-tag"></i>${tag}</a>
|
||||
</span>
|
||||
%endfor
|
||||
|
||||
%if commit.branch:
|
||||
<span class="branchtag tag" title="${h.tooltip(_('Branch %s') % commit.branch)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=commit.raw_id)}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit.raw_id,_query=dict(at=commit.branch))}"><i class="icon-code-fork"></i>${h.shorter(commit.branch)}</a>
|
||||
</span>
|
||||
%endif
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
% if c.file_author:
|
||||
${_('Last Author')}
|
||||
% else:
|
||||
${h.literal(ungettext(u'File Author (%s)',u'File Authors (%s)',len(c.authors)) % ('<b>%s</b>' % len(c.authors))) }
|
||||
${h.literal(_ungettext(u'File Author (%s)',u'File Authors (%s)',len(c.authors)) % ('<b>%s</b>' % len(c.authors))) }
|
||||
% endif
|
||||
</h4>
|
||||
<a href="#" id="show_authors" class="action_link">${_('Show All')}</a>
|
||||
|
|
@ -13,17 +13,29 @@
|
|||
|
||||
% if c.authors:
|
||||
<ul class="sidebar-right-content">
|
||||
% for email, user in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]):
|
||||
% for email, user, commits in sorted(c.authors, key=lambda e: c.file_last_commit.author_email!=e[0]):
|
||||
<li class="file_author">
|
||||
<div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}">
|
||||
<div class="tooltip" title="${h.tooltip(h.author_string(email))}">
|
||||
${base.gravatar(email, 16)}
|
||||
<span class="user">${h.link_to_user(user)}</span>
|
||||
<div class="user">${h.link_to_user(user)}</div>
|
||||
|
||||
% if c.file_author:
|
||||
<span>- ${h.age_component(c.file_last_commit.date)}</span>
|
||||
% elif c.file_last_commit.author_email==email:
|
||||
<span> (${_('last author')})</span>
|
||||
% endif
|
||||
|
||||
% if not c.file_author:
|
||||
<span>
|
||||
% if commits == 1:
|
||||
${commits} ${_('Commit')}
|
||||
% else:
|
||||
${commits} ${_('Commits')}
|
||||
% endif
|
||||
</span>
|
||||
% endif
|
||||
|
||||
</div>
|
||||
% if c.file_author:
|
||||
<div class="user-inline-data">- ${h.age_component(c.file_last_commit.date)}</div>
|
||||
% elif c.file_last_commit.author_email==email:
|
||||
<div class="user-inline-data"> (${_('last author')})</div>
|
||||
% endif
|
||||
</li>
|
||||
% endfor
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@
|
|||
|
||||
var getState = function(context) {
|
||||
var url = $(location).attr('href');
|
||||
var _base_url = '${h.url("files_home",repo_name=c.repo_name,revision='',f_path='')}';
|
||||
var _annotate_url = '${h.url("files_annotate_home",repo_name=c.repo_name,revision='',f_path='')}';
|
||||
var _base_url = '${h.route_path("repo_files",repo_name=c.repo_name,commit_id='',f_path='')}';
|
||||
var _annotate_url = '${h.route_path("repo_files:annotated",repo_name=c.repo_name,commit_id='',f_path='')}';
|
||||
_base_url = _base_url.replace('//', '/');
|
||||
_annotate_url = _annotate_url.replace('//', '/');
|
||||
|
||||
|
|
@ -67,12 +67,12 @@
|
|||
var f_path = parts2.join('/');
|
||||
}
|
||||
|
||||
var _node_list_url = pyroutes.url('files_nodelist_home',
|
||||
var _node_list_url = pyroutes.url('repo_files_nodelist',
|
||||
{repo_name: templateContext.repo_name,
|
||||
revision: rev, f_path: f_path});
|
||||
var _url_base = pyroutes.url('files_home',
|
||||
commit_id: rev, f_path: f_path});
|
||||
var _url_base = pyroutes.url('repo_files',
|
||||
{repo_name: templateContext.repo_name,
|
||||
revision: rev, f_path:'__FPATH__'});
|
||||
commit_id: rev, f_path:'__FPATH__'});
|
||||
return {
|
||||
url: url,
|
||||
f_path: f_path,
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
'f_path': state.f_path
|
||||
};
|
||||
|
||||
var url = pyroutes.url('files_nodetree_full', url_data);
|
||||
var url = pyroutes.url('repo_nodetree_full', url_data);
|
||||
|
||||
metadataRequest = $.ajax({url: url});
|
||||
|
||||
|
|
@ -182,13 +182,13 @@
|
|||
|
||||
var annotate = $('#annotate').val();
|
||||
if (annotate === "True") {
|
||||
var url = pyroutes.url('files_annotate_home',
|
||||
var url = pyroutes.url('repo_files:annotated',
|
||||
{'repo_name': templateContext.repo_name,
|
||||
'revision': diff1, 'f_path': state.f_path});
|
||||
'commit_id': diff1, 'f_path': state.f_path});
|
||||
} else {
|
||||
var url = pyroutes.url('files_home',
|
||||
var url = pyroutes.url('repo_files',
|
||||
{'repo_name': templateContext.repo_name,
|
||||
'revision': diff1, 'f_path': state.f_path});
|
||||
'commit_id': diff1, 'f_path': state.f_path});
|
||||
}
|
||||
window.location = url;
|
||||
|
||||
|
|
@ -197,9 +197,9 @@
|
|||
// show more authors
|
||||
$('#show_authors').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var url = pyroutes.url('files_authors_home',
|
||||
var url = pyroutes.url('repo_file_authors',
|
||||
{'repo_name': templateContext.repo_name,
|
||||
'revision': state.rev, 'f_path': state.f_path});
|
||||
'commit_id': state.rev, 'f_path': state.f_path});
|
||||
|
||||
$.pjax({
|
||||
url: url,
|
||||
|
|
@ -264,9 +264,9 @@
|
|||
var rev = $('#at_rev').val();
|
||||
// explicit reload page here. with pjax entering bad input
|
||||
// produces not so nice results
|
||||
window.location = pyroutes.url('files_home',
|
||||
window.location = pyroutes.url('repo_files',
|
||||
{'repo_name': templateContext.repo_name,
|
||||
'revision': rev, 'f_path': state.f_path});
|
||||
'commit_id': rev, 'f_path': state.f_path});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="edit-file-title">
|
||||
${self.breadcrumbs()}
|
||||
</div>
|
||||
${h.secure_form(h.url.current(),method='post',id='eform',enctype="multipart/form-data", class_="form-horizontal")}
|
||||
${h.secure_form(h.route_path('repo_files_create_file', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path), id='eform', method='POST', enctype="multipart/form-data", class_="form-horizontal")}
|
||||
<div class="edit-file-fieldset">
|
||||
<div class="fieldset">
|
||||
<div id="destination-label" class="left-label">
|
||||
|
|
@ -169,7 +169,7 @@
|
|||
hide_upload();
|
||||
|
||||
var renderer = "";
|
||||
var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path)}";
|
||||
var reset_url = "${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}";
|
||||
var myCodeMirror = initCodeMirror('editor', reset_url, false);
|
||||
|
||||
var modes_select = $('#set_mode');
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
% if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
|
||||
<div title="${_('Add New File')}" class="btn btn-primary new-file">
|
||||
<a href="${h.url('files_add_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path, anchor='edit')}">
|
||||
<a href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _anchor='edit')}">
|
||||
${_('Add File')}</a>
|
||||
</div>
|
||||
% endif
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
</div>
|
||||
## file tree is computed from caches, and filled in
|
||||
<div id="file-tree">
|
||||
${c.file_tree}
|
||||
${c.file_tree |n}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
%if c.file.parent:
|
||||
<tr class="parity0">
|
||||
<td class="td-componentname">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.file.parent.path)}" class="pjax-link">
|
||||
<a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.file.parent.path)}" class="pjax-link">
|
||||
<i class="icon-folder"></i>..
|
||||
</a>
|
||||
</td>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
% endif
|
||||
</span>
|
||||
% else:
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=h.safe_unicode(node.path))}" class="pjax-link">
|
||||
<a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=h.safe_unicode(node.path))}" class="pjax-link">
|
||||
<i class="${'icon-file browser-file' if node.is_file() else 'icon-folder browser-dir'}"></i>${node.name}
|
||||
</a>
|
||||
% endif
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="edit-file-title">
|
||||
${self.breadcrumbs()}
|
||||
</div>
|
||||
${h.secure_form(h.url.current(),method='post',class_="form-horizontal")}
|
||||
${h.secure_form(h.route_path('repo_files_delete_file', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path), id='eform', method='POST', class_="form-horizontal")}
|
||||
<div class="edit-file-fieldset">
|
||||
<div class="fieldset">
|
||||
<div id="destination-label" class="left-label">
|
||||
|
|
@ -44,11 +44,11 @@
|
|||
%if c.file.is_binary:
|
||||
${_('Binary file (%s)') % c.file.mimetype}
|
||||
%else:
|
||||
%if c.file.size < c.cut_off_limit:
|
||||
%if c.file.size < c.visual.cut_off_limit_file:
|
||||
${h.pygmentize(c.file,linenos=True,anchorlinenos=False,cssclass="code-highlight")}
|
||||
%else:
|
||||
${_('File is too big to display')} ${h.link_to(_('Show as raw'),
|
||||
h.url('files_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path))}
|
||||
${_('File size {} is bigger then allowed limit {}. ').format(h.format_byte_size_binary(c.file.size), h.format_byte_size_binary(c.visual.cut_off_limit_file))} ${h.link_to(_('Show as raw'),
|
||||
h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
|
||||
%endif
|
||||
%endif
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
|
||||
<div class="table">
|
||||
${h.secure_form(h.url.current(),method='post',id='eform')}
|
||||
${h.secure_form(h.route_path('repo_files_update_file', repo_name=c.repo_name, commit_id=c.commit.raw_id, f_path=c.f_path), id='eform', method='POST')}
|
||||
<div id="codeblock" class="codeblock" >
|
||||
<div class="code-header">
|
||||
<div class="stats">
|
||||
|
|
@ -58,12 +58,15 @@
|
|||
% if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
|
||||
% if not c.file.is_binary:
|
||||
%if True:
|
||||
${h.link_to(_('source'), h.url('files_home', repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path),class_="btn btn-mini")}
|
||||
${h.link_to(_('source'), h.route_path('repo_files', repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path),class_="btn btn-mini")}
|
||||
%else:
|
||||
${h.link_to(_('annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path),class_="btn btn-mini")}
|
||||
${h.link_to(_('annotation'),h.route_path('repo_files:annotated',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path),class_="btn btn-mini")}
|
||||
%endif
|
||||
${h.link_to(_('raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path),class_="btn btn-mini")}
|
||||
<a class="btn btn-mini" href="${h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path)}">
|
||||
|
||||
<a class="btn btn-mini" href="${h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">
|
||||
${_('raw')}
|
||||
</a>
|
||||
<a class="btn btn-mini" href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">
|
||||
<i class="icon-archive"></i> ${_('download')}
|
||||
</a>
|
||||
% endif
|
||||
|
|
@ -112,7 +115,7 @@
|
|||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var renderer = "${renderer}";
|
||||
var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.file.path)}";
|
||||
var reset_url = "${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.file.path)}";
|
||||
var myCodeMirror = initCodeMirror('editor', reset_url);
|
||||
|
||||
var modes_select = $('#set_mode');
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
% if c.lf_node:
|
||||
<span title="${_('This file is a pointer to large binary file')}"> | ${_('LargeFile')} ${h.format_byte_size_binary(c.lf_node.size)} </span>
|
||||
% endif
|
||||
<span> | ${c.file.lines()[0]} ${ungettext('line', 'lines', c.file.lines()[0])}</span>
|
||||
<span> | ${c.file.lines()[0]} ${_ungettext('line', 'lines', c.file.lines()[0])}</span>
|
||||
<span> | ${h.format_byte_size_binary(c.file.size)}</span>
|
||||
<span> | ${c.file.mimetype} </span>
|
||||
<span class="item last"> | ${h.get_lexer_for_filenode(c.file).__class__.__name__}</span>
|
||||
|
|
@ -20,18 +20,18 @@
|
|||
${_('Show Full History')}
|
||||
</a> |
|
||||
%if c.annotate:
|
||||
${h.link_to(_('Source'), h.url('files_home', repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path))}
|
||||
${h.link_to(_('Source'), h.route_path('repo_files', repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
|
||||
%else:
|
||||
${h.link_to(_('Annotation'), h.url('files_annotate_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path))}
|
||||
${h.link_to(_('Annotation'), h.route_path('repo_files:annotated',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
|
||||
%endif
|
||||
| ${h.link_to(_('Raw'), h.url('files_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path))}
|
||||
| ${h.link_to(_('Raw'), h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
|
||||
|
|
||||
% if c.lf_node:
|
||||
<a href="${h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path, lf=1)}">
|
||||
<a href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path, _query=dict(lf=1))}">
|
||||
${_('Download largefile')}
|
||||
</a>
|
||||
% else:
|
||||
<a href="${h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path)}">
|
||||
<a href="${h.route_path('repo_file_download',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path)}">
|
||||
${_('Download')}
|
||||
</a>
|
||||
% endif
|
||||
|
|
@ -39,14 +39,14 @@
|
|||
%if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
|
||||
|
|
||||
%if c.on_branch_head and c.branch_or_raw_id and not c.file.is_binary:
|
||||
<a href="${h.url('files_edit_home',repo_name=c.repo_name,revision=c.branch_or_raw_id,f_path=c.f_path, anchor='edit')}">
|
||||
${_('Edit on Branch:%s') % c.branch_name}
|
||||
<a href="${h.route_path('repo_files_edit_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit')}">
|
||||
${_('Edit on Branch:{}').format(c.branch_name)}
|
||||
</a>
|
||||
| <a class="btn-danger btn-link" href="${h.url('files_delete_home',repo_name=c.repo_name,revision=c.branch_or_raw_id,f_path=c.f_path, anchor='edit')}">${_('Delete')}
|
||||
| <a class="btn-danger btn-link" href="${h.route_path('repo_files_remove_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit')}">${_('Delete')}
|
||||
</a>
|
||||
%elif c.on_branch_head and c.branch_or_raw_id and c.file.is_binary:
|
||||
${h.link_to(_('Edit'), '#', class_="btn btn-link disabled tooltip", title=_('Editing binary files not allowed'))}
|
||||
| ${h.link_to(_('Delete'), h.url('files_delete_home',repo_name=c.repo_name,revision=c.branch_or_raw_id,f_path=c.f_path, anchor='edit'),class_="btn-danger btn-link")}
|
||||
| ${h.link_to(_('Delete'), h.route_path('repo_files_remove_file',repo_name=c.repo_name,commit_id=c.branch_or_raw_id,f_path=c.f_path, _anchor='edit'),class_="btn-danger btn-link")}
|
||||
%else:
|
||||
${h.link_to(_('Edit'), '#', class_="btn btn-link disabled tooltip", title=_('Editing files allowed only when on branch head commit'))}
|
||||
| ${h.link_to(_('Delete'), '#', class_="btn btn-danger btn-link disabled tooltip", title=_('Deleting files allowed only when on branch head commit'))}
|
||||
|
|
@ -66,9 +66,9 @@
|
|||
</div>
|
||||
% endif
|
||||
%else:
|
||||
% if c.file.size < c.cut_off_limit:
|
||||
% if c.file.size < c.visual.cut_off_limit_file:
|
||||
%if c.renderer and not c.annotate:
|
||||
${h.render(c.file.content, renderer=c.renderer, relative_url=h.url('files_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path))}
|
||||
${h.render(c.file.content, renderer=c.renderer, relative_url=h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
|
||||
%else:
|
||||
<table class="cb codehilite">
|
||||
%if c.annotate:
|
||||
|
|
@ -84,8 +84,8 @@
|
|||
</table>
|
||||
%endif
|
||||
%else:
|
||||
${_('File is too big to display')} ${h.link_to(_('Show as raw'),
|
||||
h.url('files_raw_home',repo_name=c.repo_name,revision=c.commit.raw_id,f_path=c.f_path))}
|
||||
${_('File size {} is bigger then allowed limit {}. ').format(h.format_byte_size_binary(c.file.size), h.format_byte_size_binary(c.visual.cut_off_limit_file))} ${h.link_to(_('Show as raw'),
|
||||
h.route_path('repo_file_raw',repo_name=c.repo_name,commit_id=c.commit.raw_id,f_path=c.f_path))}
|
||||
%endif
|
||||
%endif
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ ${h.code_highlight(
|
|||
query_terms=terms,
|
||||
only_line_numbers=lines_of_interest
|
||||
))|n}
|
||||
|
||||
%if len(matching_lines) > shown_matching_lines:
|
||||
<a href="${url}">
|
||||
${len(matching_lines) - shown_matching_lines} ${_('more matches in this file')}
|
||||
|
|
@ -52,7 +53,7 @@ ${h.code_highlight(
|
|||
${h.link_to(entry['repository'], h.route_path('repo_summary',repo_name=entry['repository']))}
|
||||
</h2>
|
||||
<div class="stats">
|
||||
${h.link_to(h.literal(entry['f_path']), h.url('files_home',repo_name=entry['repository'],revision=entry.get('commit_id', 'tip'),f_path=entry['f_path']))}
|
||||
${h.link_to(h.literal(entry['f_path']), h.route_path('repo_files',repo_name=entry['repository'],commit_id=entry.get('commit_id', 'tip'),f_path=entry['f_path']))}
|
||||
%if entry.get('lines'):
|
||||
| ${entry.get('lines', 0.)} ${_ungettext('line', 'lines', entry.get('lines', 0.))}
|
||||
%endif
|
||||
|
|
@ -66,17 +67,15 @@ ${h.code_highlight(
|
|||
<div class="buttons">
|
||||
<a id="file_history_overview_full" href="${h.url('changelog_file_home',repo_name=entry.get('repository',''),revision=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
|
||||
${_('Show Full History')}
|
||||
</a> |
|
||||
${h.link_to(_('Annotation'), h.url('files_annotate_home', repo_name=entry.get('repository',''),revision=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
|
||||
| ${h.link_to(_('Raw'), h.url('files_raw_home', repo_name=entry.get('repository',''),revision=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
|
||||
| <a href="${h.url('files_rawfile_home',repo_name=entry.get('repository',''),revision=entry.get('commit_id', 'tip'),f_path=entry.get('f_path',''))}">
|
||||
${_('Download')}
|
||||
</a>
|
||||
</a>
|
||||
| ${h.link_to(_('Annotation'), h.route_path('repo_files:annotated', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
|
||||
| ${h.link_to(_('Raw'), h.route_path('repo_file_raw', repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
|
||||
| ${h.link_to(_('Download'), h.route_path('repo_file_download',repo_name=entry.get('repository',''),commit_id=entry.get('commit_id', 'tip'),f_path=entry.get('f_path','')))}
|
||||
</div>
|
||||
</div>
|
||||
<div class="code-body search-code-body">
|
||||
${highlight_text_file(c.cur_query, entry['content'],
|
||||
url=h.url('files_home',repo_name=entry['repository'],revision=entry.get('commit_id', 'tip'),f_path=entry['f_path']),
|
||||
url=h.route_path('repo_files',repo_name=entry['repository'],commit_id=entry.get('commit_id', 'tip'),f_path=entry['f_path']),
|
||||
mimetype=entry.get('mimetype'), filepath=entry.get('path'))}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
</td>
|
||||
<td class="td-componentname">
|
||||
${h.link_to(h.literal(entry['f_path']),
|
||||
h.url('files_home',repo_name=entry['repository'],revision='tip',f_path=entry['f_path']))}
|
||||
h.route_path('repo_files',repo_name=entry['repository'],commit_id='tip',f_path=entry['f_path']))}
|
||||
</td>
|
||||
</tr>
|
||||
% endif
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@
|
|||
% endif
|
||||
% else:
|
||||
<span class="enabled">
|
||||
<a id="archive_link" class="btn btn-small" href="${h.url('files_archive_home',repo_name=c.rhodecode_db_repo.repo_name,fname='tip.zip')}">
|
||||
<a id="archive_link" class="btn btn-small" href="${h.route_path('repo_archivefile',repo_name=c.rhodecode_db_repo.repo_name,fname='tip.zip')}">
|
||||
<i class="icon-archive"></i> tip.zip
|
||||
## replaced by some JS on select
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
<div class="box" >
|
||||
<div class="title" title="${h.tooltip(_('Readme file from commit %s:%s') % (c.rhodecode_db_repo.landing_rev[0], c.rhodecode_db_repo.landing_rev[1]))}">
|
||||
<h3 class="breadcrumbs">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a>
|
||||
<a href="${h.route_path('repo_files',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.landing_rev[1],f_path=c.readme_file)}">${c.readme_file}</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="readme codeblock">
|
||||
|
|
@ -96,7 +96,7 @@ $(document).ready(function(){
|
|||
// format of Object {text: "v0.0.3", type: "tag", id: "rev"}
|
||||
var selected_cs = e.added;
|
||||
var fname= e.added.raw_id + ".zip";
|
||||
var href = pyroutes.url('files_archive_home', {'repo_name': templateContext.repo_name, 'fname':fname});
|
||||
var href = pyroutes.url('repo_archivefile', {'repo_name': templateContext.repo_name, 'fname':fname});
|
||||
// set new label
|
||||
$('#archive_link').html('<i class="icon-archive"></i> '+ e.added.text+".zip");
|
||||
|
||||
|
|
|
|||
|
|
@ -60,14 +60,14 @@
|
|||
%if h.is_hg(c.rhodecode_repo):
|
||||
%for book in cs.bookmarks:
|
||||
<span class="booktag tag" title="${h.tooltip(_('Bookmark %s') % book)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=book))}"><i class="icon-bookmark"></i>${h.shorter(book)}</a>
|
||||
</span>
|
||||
%endfor
|
||||
%endif
|
||||
## tags
|
||||
%for tag in cs.tags:
|
||||
<span class="tagtag tag" title="${h.tooltip(_('Tag %s') % tag)}">
|
||||
<a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
|
||||
<a href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=cs.raw_id, _query=dict(at=tag))}"><i class="icon-tag"></i>${h.shorter(tag)}</a>
|
||||
</span>
|
||||
%endfor
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ ${c.repo_commits.pager('$link_previous ~2~ $link_next')}
|
|||
<div class="left-label">${_('Add or upload files directly via RhodeCode:')}</div>
|
||||
<div class="right-content">
|
||||
<div id="add_node_id" class="add_node">
|
||||
<a href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='', anchor='edit')}" class="btn btn-default">${_('Add New File')}</a>
|
||||
<a href="${h.route_path('repo_files_add_file',repo_name=c.repo_name,commit_id=0, f_path='', _anchor='edit')}" class="btn btn-default">${_('Add New File')}</a>
|
||||
</div>
|
||||
</div>
|
||||
%endif
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@
|
|||
|
||||
<%def name="commit(message, commit_id, commit_idx)">
|
||||
<div>
|
||||
<pre><a title="${h.tooltip(message)}" href="${h.url('files_home',repo_name=c.repo_name,revision=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre>
|
||||
<pre><a title="${h.tooltip(message)}" href="${h.route_path('repo_files:default_path',repo_name=c.repo_name,commit_id=commit_id)}">r${commit_idx}:${h.short_id(commit_id)}</a></pre>
|
||||
</div>
|
||||
</%def>
|
||||
|
|
|
|||
|
|
@ -18,23 +18,10 @@
|
|||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
import os
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from rhodecode.controllers.files import FilesController
|
||||
from rhodecode.lib import helpers as h
|
||||
from rhodecode.lib.compat import OrderedDict
|
||||
from rhodecode.lib.ext_json import json
|
||||
from rhodecode.lib.vcs import nodes
|
||||
from rhodecode.lib.vcs.backends.base import EmptyCommit
|
||||
from rhodecode.lib.vcs.conf import settings
|
||||
from rhodecode.lib.vcs.nodes import FileNode
|
||||
from rhodecode.model.db import Repository
|
||||
from rhodecode.model.scm import ScmModel
|
||||
from rhodecode.tests import (
|
||||
url, TEST_USER_ADMIN_LOGIN, assert_session_flash, assert_not_in_session_flash)
|
||||
from rhodecode.tests import url
|
||||
from rhodecode.tests.fixture import Fixture
|
||||
from rhodecode.tests.utils import commit_change
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ def test_urlify_text(url, expected_url):
|
|||
'</a>/bX"X'),
|
||||
], ids=['simple', 'one_segment', 'empty_path', 'simple_quote'])
|
||||
def test_files_breadcrumbs_xss(
|
||||
repo_name, commit_id, path, pylonsapp, expected_result):
|
||||
repo_name, commit_id, path, app, expected_result):
|
||||
result = helpers.files_breadcrumbs(repo_name, commit_id, path)
|
||||
# Expect it to encode all path fragments properly. This is important
|
||||
# because it returns an instance of `literal`.
|
||||
|
|
|
|||
|
|
@ -409,7 +409,6 @@ def commit_change(
|
|||
def add_test_routes(config):
|
||||
"""
|
||||
Adds test routing that can be used in different functional tests
|
||||
|
||||
"""
|
||||
config.add_route(name='home', pattern='/')
|
||||
config.add_route(name='repo_summary', pattern='/{repo_name}')
|
||||
|
|
@ -422,3 +421,6 @@ def add_test_routes(config):
|
|||
pattern='/pull-request/{pull_request_id}')
|
||||
config.add_route(name='repo_commit',
|
||||
pattern='/{repo_name}/changeset/{commit_id}')
|
||||
|
||||
config.add_route(name='repo_files',
|
||||
pattern='/{repo_name}/files/{commit_id}/{f_path}')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue