clone

a self-hosted multitenant nostr relay with sites, file storage, git hosting, and inbox and outbox delivery

draw tree connectors with lines, format file times, wrap phone rows

Dami committed 2786028
commit
27860282a55e2c9c53e341df90dd2705b20803ef
parent
b3c9d323fea3d2a34872d90f214d36f659560318
author
Dami <dami.etoile@gmail.com>
3 files changed, +11 -6
Minternal/webui/browse.html2+-
Minternal/webui/repo.html4++--
Minternal/webui/style.css11++++++++---
M internal/webui/browse.html +1 -1
M internal/webui/repo.html +2 -2
@@ -32,8 +32,8 @@
3232 {{end}}{{end}}{{end}}3333 3434 {{define "repoTree"}}{{$repo := asMap .Event}}{{$entries := index $repo "entries"}}{{if .Tree}}{{$entries = .Tree}}{{end}}<ul>35-{{range $i, $e := $entries}}{{$entry := asMap $e}}{{$last := eq (add $i 1) (len $entries)}}<li><span>{{if $last}}└─ {{else}}├─ {{end}}</span>{{if eq (str (index $entry "type")) "tree"}}<a href="{{repoURL $.Query "tree" (str (index $entry "path"))}}">{{str (index $entry "name")}}/</a>{{else if eq (str (index $entry "type")) "commit"}}{{str (index $entry "name")}} <span>(submodule)</span>{{else}}<a href="{{repoURL $.Query "file" (str (index $entry "path"))}}"{{if eq (str (index $entry "path")) ($.Query.Get "path")}} aria-current="page"{{end}}>{{str (index $entry "name")}}</a>{{end}}</li>36-{{else}}<li><span> </span>no published files here</li>35+{{range $e := $entries}}{{$entry := asMap $e}}<li>{{if eq (str (index $entry "type")) "tree"}}<a href="{{repoURL $.Query "tree" (str (index $entry "path"))}}">{{str (index $entry "name")}}/</a>{{else if eq (str (index $entry "type")) "commit"}}{{str (index $entry "name")}} <span>(submodule)</span>{{else}}<a href="{{repoURL $.Query "file" (str (index $entry "path"))}}"{{if eq (str (index $entry "path")) ($.Query.Get "path")}} aria-current="page"{{end}}>{{str (index $entry "name")}}</a>{{end}}</li>36+{{else}}<li><span>no published files here</span></li>3737 {{end}}</ul>3838 <p id="pages">{{if .Query.Get "offset"}}<a href="{{repoURL .Query "tree" (.Query.Get "path")}}">first page</a> {{end}}{{if hasNextOffset (index $repo "next_offset")}}<a href="{{browsePageURL "/repo" .Query "offset" (index $repo "next_offset")}}">more</a>{{end}}</p>3939 {{end}}
M internal/webui/style.css +8 -3
@@ -70,6 +70,7 @@ img{max-width:100%}
7070 #rows td:last-child{width:170px;text-align:right;font:12px var(--mono);color:var(--muted)}7171 #rows tr:hover td{background:var(--hover)}7272 #rows th{text-align:left;font:12px var(--mono);color:var(--muted);font-weight:normal;padding:0 10px;height:28px;border-bottom:1px solid var(--line)}73+#rows th:last-child{text-align:right}7374 #rows td a{color:inherit}#rows td:first-child a{color:var(--accent)}7475 #pages{font:12px var(--mono)}7576
@@ -127,8 +128,12 @@ nostr-key{font-family:var(--mono);cursor:copy}
127128 #split>tbody>tr>td{vertical-align:top;padding:0;border:0}128129 #tree{width:300px;overflow:auto;border-right:1px solid var(--line);font:13px/24px var(--mono);padding:8px 0 20px}129130 #tree header{padding:0 12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#tree header small{float:right}130-#tree ul{list-style:none;margin:0;padding:0 0 0 12px}131-#tree li{white-space:nowrap}#tree li>span{color:var(--muted)}131+#tree ul{list-style:none;margin:0 0 0 16px;padding:0 0 0 14px;border-left:1px solid var(--muted)}132+#tree li{white-space:nowrap;position:relative}133+#tree li>a{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:top}134+#tree li::before{content:"";position:absolute;left:-14px;top:12px;width:10px;border-top:1px solid var(--muted)}135+#tree li:last-child::after{content:"";position:absolute;left:-15px;top:12px;bottom:0;width:1px;background:var(--rail)}136+#tree li>span{color:var(--muted)}132137 #tree a{color:var(--ink)}#tree a[aria-current=page]{background:var(--soft);padding:0 4px}133138 #preview{padding:0;overflow:hidden}134139 #preview header{padding:0 12px;height:36px;line-height:36px;border-bottom:1px solid var(--line);font:13px var(--mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@@ -176,6 +181,6 @@ html[data-menu=open] #layout>tbody>tr>td#rail{transform:none;box-shadow:8px 0 24
176181 #prompt{display:none}#footer td:last-child{text-align:left}177182 #split,#split>tbody,#split>tbody>tr,#split>tbody>tr>td{display:block;width:auto}178183 #tree{border-right:0;border-bottom:1px solid var(--line)}179-#rows td{white-space:normal;height:auto;padding:8px 6px;line-height:1.35}#rows td:first-child{width:90px}#rows td:last-child{width:80px}184+#rows{table-layout:fixed}#rows td{white-space:normal;overflow-wrap:anywhere;height:auto;padding:8px 6px;line-height:1.35}#rows td:first-child{width:90px}#rows td:last-child{width:80px}180185 #grid,#gridhead,h2:has(+#gridhead){display:none}181186 }