Both tree.html and blob.html now show '< Parent directory' on the same line as '< Back to commits', separated by '|'. In blob view, parent directory navigates to the containing directory tree. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
36 lines
1.1 KiB
HTML
36 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns:th="http://www.thymeleaf.org">
|
|
<head>
|
|
<title th:text="'Browse - ' + ${shortHash}">Browse</title>
|
|
</head>
|
|
<body>
|
|
<h2>Browse <span th:text="${shortHash}"></span></h2>
|
|
|
|
<p>
|
|
<a th:href="@{/repo/{name}/commits(name=${name})}">< Back to commits</a>
|
|
<span th:if="${!path.isEmpty()}">
|
|
| <a th:href="@{/repo/{name}/tree/{hash}(name=${name}, hash=${hash}, path=${parentPath})}">< Parent directory</a>
|
|
</span>
|
|
</p>
|
|
|
|
<p th:if="${!path.isEmpty()}">Path: <b th:text="${path}"></b></p>
|
|
|
|
<table border="1" cellpadding="4" cellspacing="0">
|
|
<tr>
|
|
<th>Type</th>
|
|
<th>Name</th>
|
|
</tr>
|
|
<tr th:each="f : ${files}">
|
|
<td th:text="${f.type}"></td>
|
|
<td>
|
|
<a th:if="${f.type == 'tree'}" th:href="@{/repo/{name}/tree/{hash}(name=${name}, hash=${hash}, path=${f.path})}" th:text="${f.path.contains('/') ? f.path.substring(f.path.lastIndexOf('/') + 1) : f.path}"></a>
|
|
<a th:if="${f.type == 'blob'}" th:href="@{'/repo/' + ${name} + '/blob/' + ${hash} + '/' + ${f.path}}" th:text="${f.path.contains('/') ? f.path.substring(f.path.lastIndexOf('/') + 1) : f.path}"></a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p th:if="${files.isEmpty()}">Empty directory.</p>
|
|
|
|
</body>
|
|
</html>
|