93b161c23e
Git branch names can be hierarchical (for example, "wip/parser/fix"), however, git-arr does not take this into account when formulating URLs on branch, tree, and blobs pages. These URLs are dysfunctional because it is assumed incorrectly that a single "../" is sufficient to climb over the branch name when computing relative paths to resources higher in the hierarchy. This problem manifests as failure to load static resources (stylesheet, etc.), broken links to commits on branch pages, and malfunctioning breadcrumb trails. Fix this problem by computing the the proper number of "../" based upon the branch name, rather than assuming that a single "../" will work unconditionally. (This is analogous to the treatment already given to hierarchical pathnames in tree and blob views.) Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
58 lines
1.6 KiB
HTML
58 lines
1.6 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
|
|
% if not dirname.raw:
|
|
% reltree = './'
|
|
% else:
|
|
% reltree = '../' * (len(dirname.split('/')) - 1)
|
|
% end
|
|
% relroot = reltree + '../' * (len(repo.branch.split('/')) - 1)
|
|
|
|
<title>git » {{repo.name}} »
|
|
{{repo.branch}} » {{dirname.unicode}}</title>
|
|
<link rel="stylesheet" type="text/css"
|
|
href="{{relroot}}../../../../../static/git-arr.css"/>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
|
</head>
|
|
|
|
<body class="tree">
|
|
<h1><a href="{{relroot}}../../../../../">git</a> »
|
|
<a href="{{relroot}}../../../">{{repo.name}}</a> »
|
|
<a href="{{reltree}}../">{{repo.branch}}</a> »
|
|
<a href="{{reltree}}">tree</a>
|
|
</h1>
|
|
|
|
<h3>
|
|
<a href="{{reltree}}">[{{repo.branch}}]</a> /
|
|
% base = smstr(reltree)
|
|
% for c in dirname.split('/'):
|
|
% if not c.raw:
|
|
% continue
|
|
% end
|
|
<a href="{{base.url}}{{c.url}}/">{{c.unicode}}</a> /
|
|
% base += c + '/'
|
|
% end
|
|
</h3>
|
|
|
|
<table class="nice ls">
|
|
% key_func = lambda (t, n, s): (t != 'tree', n.raw)
|
|
% for type, name, size in sorted(tree.ls(dirname.raw), key = key_func):
|
|
<tr class="{{type}}">
|
|
% if type == "blob":
|
|
<td class="name"><a href="./f={{name.url}}.html">
|
|
{{!name.html}}</a></td>
|
|
<td class="size">{{size}}</td>
|
|
% elif type == "tree":
|
|
<td class="name">
|
|
<a class="explicit" href="./{{name.url}}/">
|
|
{{!name.html}}/</a></td>
|
|
% end
|
|
</tr>
|
|
% end
|
|
</table>
|
|
|
|
</body>
|
|
</html>
|