arche / internal/ui/templates/tree.html

commit 154431fd
 1{{ template "base.html" . }} {{ define "title" }}tree {{.ShortHex}}{{ if .TreePath }}/{{.TreePath}}{{ end }} — arche{{ end }} {{define
 2"content"}}
 3<h2>
 4    tree / {{ range .PathParts }}<a href="{{.Link}}">{{.Name}}</a> / {{ end }} &nbsp;<span class="hash">{{.ShortHex}}</span>
 5</h2>
 6{{ if .Entries }}
 7<div style="border: 1px solid #252525;
 8            border-radius: 3px;
 9            overflow: hidden;
10            margin-top: 10px">
11    {{ range .Entries }}
12    <div class="tree-entry">
13        {{ if .IsDir }}
14        <span style="color: #555">dir</span>
15        <a href="{{.Link}}" class="tree-dir">
16            <svg class="folder-icon"
17                 xmlns="http://www.w3.org/2000/svg"
18                 width="14"
19                 height="14"
20                 viewBox="0 0 24 24"
21                 style="vertical-align:-2px;
22                        margin-right:4px">
23                <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" />
24            </svg>
25            <svg class="folder-icon-open"
26                 xmlns="http://www.w3.org/2000/svg"
27                 width="14"
28                 height="14"
29                 viewBox="0 0 24 24"
30                 style="vertical-align:-2px;
31                        margin-right:4px">
32                <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" />
33            </svg>
34        {{.Name}}/</a>
35    {{ else }}
36        <span style="color: #555">{{.Mode}}</span>
37        <a href="{{.Link}}" class="tree-file">{{.Name}}</a>
38        {{ end }}
39    </div>
40    {{ end }}
41</div>
42{{ else }}
43<p class="empty">empty tree</p>
44{{ end }} {{ end }}