use table for tree view as it is more compatible with eg w3m and netsurf
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmPdrTcACgkQO3+8IhRO Y5ivJA/9FlkAKBHJQkV4ONYPnFMZXCEhfauQR5eVvc+1XDHJ+7NNGQd70faXrjP9 Vu3hOdYVdflZYsW28N43eqNwvD+zi48KLc8fgn4VHsfVK7SzO4YPoYcE1my+JRUG vH8UYX+AaIhAyBGBYKJxuXRIECIwocRDLrRiwVuKm//RfEh1p8GIGApy7uSDmPLw YU5tANFnuGSGOjLW92l3p26tThSfjJIXKSSYXSbSwUCmmOffs6IVfGI8ywSaYj+S 7fTxQpGIwunhhVJ1JMJC4RWx0ziy4UhJEuja5xpMORW8OFz1cIB7Ms6CrcNRiexP eKhMU7xbiwFiOdrkuGCTu+FPFuuuYEX0mSv9s7msWkOAPLfowBBxvQEIGKqaqEel MZs2XGVIBPwKGsxXo7+IjgZ4MvoQ1fSx+mIMNVV/JCiteKwDcJ4LH0n33DT/66H7 6sBMpxON0w6Vrk1H68NOpdAsU9pPMOuoSijuvsHRRtHZSdzCF+vsiWDnURAr1F1k cVZ3kUNfuTAGigwGikRiyguMtPxB6f6Uc/FEjXsU5k/uVBpXWT5NsmEWSNPunfz7 wjJbkq5DP35rCZH00s48TZRGhXeitG9z32BDYvi5bFzDneDOjxGY6DiyQcTZa1qJ SQsRspENnZ8HUnqy01EZwBxTsnxAlYdRcnUc1zUQGb+GcGSJiCg= =lEuC -----END PGP SIGNATURE-----
2 files changed,
38 insertions(+),
24 deletions(-)
M
static/style.css
→
static/style.css
@@ -123,14 +123,20 @@ color: var(--gray);
font-style: italic; } -.tree { - display: grid; - grid-template-columns: 10ch auto 1fr; - grid-row-gap: 0.5em; - grid-column-gap: 1em; - min-width: 0; +.tree td { + padding: 0.5em 0.5ch; + box-sizing: content-box; } +.mode, .size { + font-family: var(--mono-font); + width: 10ch; + white-space: nowrap; +} +.size { + text-align: right; + width: 15ch; +} .log { display: grid; grid-template-columns: 20rem minmax(0, 1fr);@@ -145,12 +151,7 @@ .log pre {
white-space: pre-wrap; } -.mode, .size { - font-family: var(--mono-font); -} -.size { - text-align: right; -} + .readme pre { white-space: pre-wrap;@@ -314,6 +315,7 @@ display: iniline-block;
width: 100%; } } + .diff-type { color: var(--gray); }@@ -351,3 +353,9 @@ pre {
font-size: 0.8rem; } } + +@media (max-width: 420px) { + .tree .size { + display: none; + } +}
M
templates/tree.html
→
templates/tree.html
@@ -15,36 +15,42 @@ {{ $repo := .name }}
{{ $ref := .ref }} {{ $parent := .parent }} - <div class="tree"> + <table class="tree"> {{ if $parent }} - <div></div> - <div></div> - <div><a href="/{{ $repo }}/tree/{{ $ref }}/{{ .dotdot }}">..</a></div> + <tr> + <td></td> + <td></td> + <td><a href="/{{ $repo }}/tree/{{ $ref }}/{{ .dotdot }}">..</a></td> + </tr> {{ end }} {{ range .files }} {{ if not .IsFile }} - <div class="mode">{{ .Mode }}</div> - <div class="size">{{ .Size }}</div> - <div> + <tr> + <td class="mode">{{ .Mode }}</td> + <td class="size">{{ .Size }}</td> + <td> {{ if $parent }} <a href="/{{ $repo }}/tree/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}/</a> {{ else }} <a href="/{{ $repo }}/tree/{{ $ref }}/{{ .Name }}">{{ .Name }}/</a> {{ end }} - </div> + </td> + </tr> {{ end }} {{ end }} {{ range .files }} {{ if .IsFile }} - <div class="mode">{{ .Mode }}</div> - <div class="size">{{ .Size }}</div> - <div> + <tr> + <td class="mode">{{ .Mode }}</td> + <td class="size">{{ .Size }}</td> + <td> {{ if $parent }} <a href="/{{ $repo }}/blob/{{ $ref }}/{{ $parent }}/{{ .Name }}">{{ .Name }}</a> {{ else }} <a href="/{{ $repo }}/blob/{{ $ref }}/{{ .Name }}">{{ .Name }}</a> {{ end }} - </div> + </td> + </tr> {{ end }} {{ end }} </div>