files: fixed case of partial url in generating files metadata
This commit is contained in:
parent
11f9a80447
commit
ab8162dcb1
2 changed files with 13 additions and 1 deletions
|
|
@ -272,6 +272,18 @@ def files_breadcrumbs(repo_name, commit_id, file_path, at_ref=None, limit_items=
|
|||
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``.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
metadataRequest = null;
|
||||
|
||||
// global metadata about URL
|
||||
filesUrlData = ${h.json.dumps(request.matchdict)|n};
|
||||
filesUrlData = ${h.files_url_data(request)|n};
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue