home · login to get plonkin'

@tangled.sh/core treeview template simplification

@uncenter.dev · 30d ago · plaintext · 42 loc · raw · 0 comments

1diff --git i/appview/pages/templates/repo/tree.html w/appview/pages/templates/repo/tree.html2index 0434a80..c093251 1006443--- i/appview/pages/templates/repo/tree.html4+++ w/appview/pages/templates/repo/tree.html5@@ -36,34 +36,17 @@6     </div>7 8     {{ range .Files }}9-    {{ if not .IsFile }}10     <div class="{{ $containerstyle }}">11         <div class="flex justify-between items-center">12-            <a href="/{{ $.BaseTreeLink }}/{{ .Name }}" class="{{ $linkstyle }}">13+            <a href="/{{ if .IsFile }}{{ $.BaseBlobLink }}{{ else }}{{ $.BaseTreeLink }}{{ end }}/{{ .Name }}" class="{{ $linkstyle }}">14                 <div class="flex items-center gap-2">15-                    <i class="w-3 h-3 fill-current" data-lucide="folder"></i>{{ .Name }}16+                    <i {{ if .IsFile }}class="w-3 h-3" data-lucide="file"{{ else }}class="w-3 h-3 fill-current" data-lucide="folder"{{ end }}></i>{{ .Name }}17                 </div>18             </a>19             <time class="text-xs text-gray-500">{{ timeFmt .LastCommit.Author.When }}</time>20         </div>21     </div>22     {{ end }}23-    {{ end }}24-25-    {{ range .Files }}26-    {{ if .IsFile }}27-    <div class="{{ $containerstyle }}">28-        <div class="flex justify-between items-center">29-            <a href="/{{ $.BaseBlobLink }}/{{ .Name }}" class="{{ $linkstyle }}">30-                <div class="flex items-center gap-2">31-                    <i class="w-3 h-3" data-lucide="file"></i>{{ .Name }}32-                </div>33-            </a>34-            <time class="text-xs text-gray-500">{{ timeFmt .LastCommit.Author.When }}</time>35-        </div>36-    </div>37-    {{ end }}38-    {{ end }}39   </div>40 </main>41 {{end}}42

login to post a comment