diff --git a/dir-index.html b/dir-index.html index 7f2ce117699d8ba624a6de2c7401b4b88bd3860b..75ec45020688adadf30fcebf2bba1eaddc25abcb 100644 --- a/dir-index.html +++ b/dir-index.html @@ -33,6 +33,17 @@ .ml-auto { margin-left: auto; } + .text-truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .table-responsive { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch; + } {{ .Path }} @@ -75,6 +86,7 @@ {{ end }} +
+ {{ range .Listing }} @@ -93,10 +106,19 @@ + {{ end }}
@@ -84,6 +96,7 @@ ..
{{ .Name }} + {{ if .Hash }} + + {{ slice .Hash 0 40 }} + {{ slice .Hash 40 }} + + {{ end }} + {{ .Size }}
+
diff --git a/test/main.go b/test/main.go index 6c851aeb595e6c547880e0fca9eefdc50494bfa1..208b2ad54e11769618e7d922026ffea9f690643c 100644 --- a/test/main.go +++ b/test/main.go @@ -24,6 +24,7 @@ type directoryItem struct { Size string Name string Path string + Hash string } type breadcrumb struct { @@ -37,10 +38,12 @@ var testData = listingTemplateData{ Size: "25 MiB", Name: "short-film.mov", Path: testPath + "/short-film.mov", + Hash: "QmQuxBarQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7", }, { Size: "1 KiB", Name: "this-piece-of-papers-got-47-words-37-sentences-58-words-we-wanna-know.txt", Path: testPath + "/this-piece-of-papers-got-47-words-37-sentences-58-words-we-wanna-know.txt", + Hash: "QmquXbaRQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7", }}, Size: "25 MiB", Path: testPath,