# HG changeset patch # User Sean Farley # Date 1414789764 25200 # Node ID 48d9f65d3b77438aecd3120ac534d3398f687261 # Parent 36de86c1087f6be837ab145abd9c73e22bbde63f files_browser: add file_url def for use with both submodule and regular files diff -r 36de86c1087f -r 48d9f65d3b77 kallithea/templates/files/files_browser.html --- a/kallithea/templates/files/files_browser.html Fri Oct 31 14:03:49 2014 -0700 +++ b/kallithea/templates/files/files_browser.html Fri Oct 31 14:09:24 2014 -0700 @@ -7,6 +7,13 @@ <%return "browser-dir"%> %endif +<%def name="file_url(node, c)"> + %if node.is_submodule(): + <%return node.url or '#'%> + %else: + <%return h.url('files_home', repo_name=c.repo_name, revision=c.changeset.raw_id, f_path=h.safe_unicode(node.path))%> + %endif +
@@ -67,9 +74,9 @@ %if node.is_submodule(): - ${h.link_to(node.name,node.url or '#',class_=file_class(node)+" ypjax-link")} + ${h.link_to(node.name,file_url(node,c),class_=file_class(node)+" ypjax-link")} %else: - ${h.link_to(node.name, h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id,f_path=h.safe_unicode(node.path)),class_=file_class(node)+" ypjax-link")} + ${h.link_to(node.name,file_url(node,c),class_=file_class(node)+" ypjax-link")} %endif: