arche / internal/archesrv/templates/srv_repo_tree.html

commit 154431fd
 1{{ define "title" }}{{.Repo}} — tree{{ end }}
 2{{ define "navextra" }}<a href="/{{.Repo}}">{{.Repo}}</a> <a href="/{{.Repo}}/log">log</a> <a href="/{{.Repo}}/tree">tree</a> <a href="/{{.Repo}}/issues">issues</a> <a href="/{{.Repo}}/stacks">stacks</a> <a href="/{{.Repo}}/wiki">wiki</a>{{ end }}
 3{{ define "srv_repo_tree.html" }}{{ template "head" . }}
 4<style>
 5.entry-dir a .folder-icon-open { display: none; }
 6.entry-dir a:hover .folder-icon { display: none; }
 7.entry-dir a:hover .folder-icon-open { display: inline; }
 8</style>
 9<div class="container">
10    <h1 class="repo-name">{{.Repo}} / tree</h1>
11    <div class="repo-meta">
12        commit
13        <a href="/{{.Repo}}/commit?id={{.CommitHex}}"><code>{{.ShortHex}}</code></a>
14    </div>
15    <div class="tree-path">
16        <a href="/{{.Repo}}/tree?id={{.CommitHex}}">/</a>
17        {{ range .PathParts }} / <a href="{{.Link}}">{{.Name}}</a>{{ end }}
18    </div>
19    <table>
20        <thead>
21            <tr>
22                <th>Name</th>
23                <th>Type</th>
24            </tr>
25        </thead>
26        <tbody>
27            {{ range .Entries }}
28        <tr class="{{ if .IsDir }}entry-dir{{ else }}entry-file{{ end }}">
29            <td>
30                <a href="{{.Link}}">{{ if .IsDir }}
31                    <svg class="folder-icon"
32                         xmlns="http://www.w3.org/2000/svg"
33                         width="14"
34                         height="14"
35                         viewBox="0 0 24 24"
36                         style="vertical-align:-2px;
37                                margin-right:4px">
38                        <path fill="currentColor" d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h6l2 2h8q.825 0 1.413.588T22 8v10q0 .825-.587 1.413T20 20zm0-2h16V8h-8.825l-2-2H4zm0 0V6z" />
39                    </svg>
40                    <svg class="folder-icon-open"
41                         xmlns="http://www.w3.org/2000/svg"
42                         width="14"
43                         height="14"
44                         viewBox="0 0 24 24"
45                         style="vertical-align:-2px;
46                                margin-right:4px;
47                                display:none">
48                        <path fill="currentColor" d="M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h6l2 2h8q.825 0 1.413.588T22 8H11.175l-2-2H4v12l2.4-8h17.1l-2.575 8.575q-.2.65-.737 1.038T19 20zm2.1-2H19l1.8-6H7.9zm0 0l1.8-6zM4 8V6z" />
49                    </svg>
50                {{ end }}{{.Name}}</a>
51            </td>
52            <td style="color: #888; font-size: 12px">{{ if .IsDir }}dir{{ else }}{{.Mode}}{{ end }}</td>
53        </tr>
54        {{ end }}
55    </tbody>
56</table>
57</div>
58{{ template "foot" . }}
59{{ end }}