Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eaec858

Browse files
committedJun 20, 2015
http/index: fix indention and remove unused field
License: MIT Signed-off-by: Henry <cryptix@riseup.net>
1 parent 6f3bc89 commit eaec858

File tree

2 files changed

+61
-63
lines changed

2 files changed

+61
-63
lines changed
 

‎core/corehttp/gateway_handler.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package corehttp
33
import (
44
"errors"
55
"fmt"
6-
"html/template"
76
"io"
87
"net/http"
98
gopath "path"
@@ -30,9 +29,8 @@ const (
3029
// gatewayHandler is a HTTP handler that serves IPFS objects (accessible by default at /ipfs/<path>)
3130
// (it serves requests like GET /ipfs/QmVRzPKPzNtSrEzBFm2UZfxmPAgnaLke4DMcerbsGGSaFe/link)
3231
type gatewayHandler struct {
33-
node *core.IpfsNode
34-
dirList *template.Template
35-
config GatewayConfig
32+
node *core.IpfsNode
33+
config GatewayConfig
3634
}
3735

3836
func newGatewayHandler(node *core.IpfsNode, conf GatewayConfig) (*gatewayHandler, error) {

‎core/corehttp/gateway_indexPage.go

+59-59
Original file line numberDiff line numberDiff line change
@@ -22,65 +22,65 @@ type directoryItem struct {
2222
var listingTemplate = template.Must(template.New("dir").Funcs(template.FuncMap{"iconFromExt": iconFromExt}).Parse(`
2323
<!DOCTYPE html>
2424
<html>
25-
<head>
26-
<meta charset="utf-8" />
27-
<!-- TODO: seed these - maybe like the starter ex or the webui? -->
28-
<link rel="stylesheet" href="/ipfs/QmXB7PLRWH6bCiwrGh2MrBBjNkLv3mY3JdYXCikYZSwLED/bootstrap.min.css"/>
29-
<!-- helper to construct this is here: https://github.com/cryptix/exp/blob/master/imgesToCSSData/convert.go -->
30-
<link rel="stylesheet" href="/ipfs/QmXB7PLRWH6bCiwrGh2MrBBjNkLv3mY3JdYXCikYZSwLED/icons.css">
31-
<style>
32-
.narrow {width: 0px;}
33-
.padding { margin: 100px;}
34-
#header {
35-
background: #000;
36-
}
37-
#logo {
38-
height: 25px;
39-
margin: 10px;
40-
}
41-
.ipfs-icon {
42-
width:16px;
43-
}
44-
</style>
45-
<title>{{ .Path }}</title>
46-
</head>
47-
<body>
48-
<div id="header" class="row">
49-
<div class="col-xs-2">
50-
<div id="logo" class="ipfs-logo">&nbsp;</div>
51-
</div>
52-
</div>
53-
<br/>
54-
<div class="col-xs-12">
55-
<div class="panel panel-default">
56-
<div class="panel-heading">
57-
<strong>Index of {{ .Path }}</strong>
58-
</div>
59-
<table class="table table-striped">
60-
<tr>
61-
<td class="narrow">
62-
<div class="ipfs-icon ipfs-_blank">&nbsp;</div>
63-
</td>
64-
<td class="padding">
65-
<a href="{{.BackLink}}">..</a>
66-
</td>
67-
<td></td>
68-
</tr>
69-
{{ range .Listing }}
70-
<tr>
71-
<td>
72-
<div class="ipfs-icon {{iconFromExt .Name}}">&nbsp;</div>
73-
</td>
74-
<td>
75-
<a href="{{ .Path }}">{{ .Name }}</a>
76-
</td>
77-
<td>{{ .Size }} bytes</td>
78-
</tr>
79-
{{ end }}
80-
</table>
81-
</div>
82-
</div>
83-
</body>
25+
<head>
26+
<meta charset="utf-8" />
27+
<!-- TODO: seed these - maybe like the starter ex or the webui? -->
28+
<link rel="stylesheet" href="/ipfs/QmXB7PLRWH6bCiwrGh2MrBBjNkLv3mY3JdYXCikYZSwLED/bootstrap.min.css"/>
29+
<!-- helper to construct this is here: https://github.com/cryptix/exp/blob/master/imgesToCSSData/convert.go -->
30+
<link rel="stylesheet" href="/ipfs/QmXB7PLRWH6bCiwrGh2MrBBjNkLv3mY3JdYXCikYZSwLED/icons.css">
31+
<style>
32+
.narrow {width: 0px;}
33+
.padding { margin: 100px;}
34+
#header {
35+
background: #000;
36+
}
37+
#logo {
38+
height: 25px;
39+
margin: 10px;
40+
}
41+
.ipfs-icon {
42+
width:16px;
43+
}
44+
</style>
45+
<title>{{ .Path }}</title>
46+
</head>
47+
<body>
48+
<div id="header" class="row">
49+
<div class="col-xs-2">
50+
<div id="logo" class="ipfs-logo">&nbsp;</div>
51+
</div>
52+
</div>
53+
<br/>
54+
<div class="col-xs-12">
55+
<div class="panel panel-default">
56+
<div class="panel-heading">
57+
<strong>Index of {{ .Path }}</strong>
58+
</div>
59+
<table class="table table-striped">
60+
<tr>
61+
<td class="narrow">
62+
<div class="ipfs-icon ipfs-_blank">&nbsp;</div>
63+
</td>
64+
<td class="padding">
65+
<a href="{{.BackLink}}">..</a>
66+
</td>
67+
<td></td>
68+
</tr>
69+
{{ range .Listing }}
70+
<tr>
71+
<td>
72+
<div class="ipfs-icon {{iconFromExt .Name}}">&nbsp;</div>
73+
</td>
74+
<td>
75+
<a href="{{ .Path }}">{{ .Name }}</a>
76+
</td>
77+
<td>{{ .Size }} bytes</td>
78+
</tr>
79+
{{ end }}
80+
</table>
81+
</div>
82+
</div>
83+
</body>
8484
</html>
8585
`))
8686

0 commit comments

Comments
 (0)
Please sign in to comment.