Skip to content

Commit ad9c46b

Browse files
authored
Merge pull request #6 from codesoap/upload
Allow uploading without existing files
2 parents 4cee60b + b47c24f commit ad9c46b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ const directoryListingTemplateText = `
3636
</head>
3737
<body>
3838
<h1>{{ .Title }}</h1>
39-
{{ if .Files }}
39+
{{ if or .Files .AllowUpload }}
4040
<table>
4141
<thead>
4242
<th></th>
4343
<th colspan=2 class=number>Size (bytes)</th>
4444
</thead>
4545
<tbody>
46+
{{- if .Files }}
4647
<tr><td colspan=3><a href="{{ .TarGzURL }}">.tar.gz of all files</a></td></tr>
4748
<tr><td colspan=3><a href="{{ .ZipURL }}">.zip of all files</a></td></tr>
49+
{{- end }}
4850
{{- range .Files }}
4951
<tr>
5052
{{ if (not .IsDir) }}

0 commit comments

Comments
 (0)