Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
dir-index-html
Commits
51e423e4
Commit
51e423e4
authored
Jul 03, 2020
by
Kevin Neaton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CID column
parent
8c03fc45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
dir-index.html
dir-index.html
+22
-0
test/main.go
test/main.go
+3
-0
No files found.
dir-index.html
View file @
51e423e4
...
...
@@ -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
;
}
</style>
<title>
{{ .Path }}
</title>
...
...
@@ -75,6 +86,7 @@
</div>
{{ end }}
</div>
<div
class=
"table-responsive"
>
<table>
<tr>
<td
class=
"type-icon"
>
...
...
@@ -84,6 +96,7 @@
<a
href=
"{{.BackLink | urlEscape}}"
>
..
</a>
</td>
<td></td>
<td></td>
</tr>
{{ range .Listing }}
<tr>
...
...
@@ -93,10 +106,19 @@
<td>
<a
href=
"{{ .Path | urlEscape }}"
>
{{ .Name }}
</a>
</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>
</tr>
{{ end }}
</table>
</div>
</div>
</body>
</html>
test/main.go
View file @
51e423e4
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment