@cryptotaxi247 / kubo / commits / 053e531da

http/index: fix indention and remove unused field

License: MIT Signed-off-by: Henry <cryptix@riseup.net>

Henry committed Jun 20, 2015 at 15:41 UTC 053e531dac5d08fbec6f1937f0fb995fb103f99a
2 files changed +61 -63
core/corehttp/gateway_handler.go
+2 -4
@@ -3,7 +3,6 @@ package corehttp
3 import (
4 "errors"
5 "fmt"
6 - "html/template"
6 "io"
7 "net/http"
8 gopath "path"
@@ -30,9 +29,8 @@ const (
29 // gatewayHandler is a HTTP handler that serves IPFS objects (accessible by default at /ipfs/<path>)
30 // (it serves requests like GET /ipfs/QmVRzPKPzNtSrEzBFm2UZfxmPAgnaLke4DMcerbsGGSaFe/link)
31 type gatewayHandler struct {
33 - node *core.IpfsNode
34 - dirList *template.Template
35 - config GatewayConfig
32 + node *core.IpfsNode
33 + config GatewayConfig
34 }
35
36 func newGatewayHandler(node *core.IpfsNode, conf GatewayConfig) (*gatewayHandler, error) {
core/corehttp/gateway_indexPage.go
+59 -59
@@ -22,65 +22,65 @@ type directoryItem struct {
22 var listingTemplate = template.Must(template.New("dir").Funcs(template.FuncMap{"iconFromExt": iconFromExt}).Parse(`
23 <!DOCTYPE html>
24 <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>
84 </html>
85 `))
86