diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -272,6 +272,18 @@ def files_breadcrumbs(repo_name, commit_ return literal(' / '.join(url_segments) + icon) +def files_url_data(request): + matchdict = request.matchdict + + if 'f_path' not in matchdict: + matchdict['f_path'] = '' + + if 'commit_id' not in matchdict: + matchdict['commit_id'] = 'tip' + + return json.dumps(matchdict) + + def code_highlight(code, lexer, formatter, use_hl_filter=False): """ Lex ``code`` with ``lexer`` and format it with the formatter ``formatter``. diff --git a/rhodecode/templates/files/files.mako b/rhodecode/templates/files/files.mako --- a/rhodecode/templates/files/files.mako +++ b/rhodecode/templates/files/files.mako @@ -35,7 +35,7 @@ metadataRequest = null; // global metadata about URL - filesUrlData = ${h.json.dumps(request.matchdict)|n}; + filesUrlData = ${h.files_url_data(request)|n};