Commit 51e423e4 authored by Kevin Neaton's avatar Kevin Neaton

Add CID column

parent 8c03fc45
...@@ -33,6 +33,17 @@ ...@@ -33,6 +33,17 @@
.ml-auto { .ml-auto {
margin-left: 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;
}
</style> </style>
<title>{{ .Path }}</title> <title>{{ .Path }}</title>
...@@ -75,6 +86,7 @@ ...@@ -75,6 +86,7 @@
</div> </div>
{{ end }} {{ end }}
</div> </div>
<div class="table-responsive">
<table> <table>
<tr> <tr>
<td class="type-icon"> <td class="type-icon">
...@@ -84,6 +96,7 @@ ...@@ -84,6 +96,7 @@
<a href="{{.BackLink | urlEscape}}">..</a> <a href="{{.BackLink | urlEscape}}">..</a>
</td> </td>
<td></td> <td></td>
<td></td>
</tr> </tr>
{{ range .Listing }} {{ range .Listing }}
<tr> <tr>
...@@ -93,10 +106,19 @@ ...@@ -93,10 +106,19 @@
<td> <td>
<a href="{{ .Path | urlEscape }}">{{ .Name }}</a> <a href="{{ .Path | urlEscape }}">{{ .Name }}</a>
</td> </td>
<td>
{{ if .Hash }}
<a class="d-flex" style="width:33vw; max-width:30em; max-width: max-content" href="/ipfs/{{ .Hash | urlEscape }}">
<span class="text-truncate" style="min-width: 2.5em">{{ slice .Hash 0 40 }}</span>
<span class="no-linebreak">{{ slice .Hash 40 }}</span>
</a>
{{ end }}
</td>
<td class="no-linebreak">{{ .Size }}</td> <td class="no-linebreak">{{ .Size }}</td>
</tr> </tr>
{{ end }} {{ end }}
</table> </table>
</div>
</div> </div>
</body> </body>
</html> </html>
...@@ -24,6 +24,7 @@ type directoryItem struct { ...@@ -24,6 +24,7 @@ type directoryItem struct {
Size string Size string
Name string Name string
Path string Path string
Hash string
} }
type breadcrumb struct { type breadcrumb struct {
...@@ -37,10 +38,12 @@ var testData = listingTemplateData{ ...@@ -37,10 +38,12 @@ var testData = listingTemplateData{
Size: "25 MiB", Size: "25 MiB",
Name: "short-film.mov", Name: "short-film.mov",
Path: testPath + "/short-film.mov", Path: testPath + "/short-film.mov",
Hash: "QmQuxBarQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7",
}, { }, {
Size: "1 KiB", Size: "1 KiB",
Name: "this-piece-of-papers-got-47-words-37-sentences-58-words-we-wanna-know.txt", 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", Path: testPath + "/this-piece-of-papers-got-47-words-37-sentences-58-words-we-wanna-know.txt",
Hash: "QmquXbaRQXB2mzChmMeKY47C43LxUdg1NDJ5MWcKMKxDu7",
}}, }},
Size: "25 MiB", Size: "25 MiB",
Path: testPath, Path: testPath,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment