diff --git a/server/template/files/script.html b/server/template/files/script.html
new file mode 100644
index 000000000..f8f2f7653
--- /dev/null
+++ b/server/template/files/script.html
@@ -0,0 +1,9 @@
+
+
diff --git a/server/template/template_gen.go b/server/template/template_gen.go
index 7c5d459c7..33e00672f 100644
--- a/server/template/template_gen.go
+++ b/server/template/template_gen.go
@@ -22,6 +22,9 @@ var files = []struct {
}, {
name: "logout.html",
data: logout,
+ }, {
+ name: "script.html",
+ data: script,
},
}
@@ -63,25 +66,39 @@ var error = `
// files/index.html
var index = `
-
+
-
-
-
- {{ if .csrf }}{{ end }}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
`
@@ -167,3 +184,15 @@ var login = `
// files/logout.html
var logout = `LOGOUT
`
+
+// files/script.html
+var script = `
+
+`
diff --git a/server/ui_local.go b/server/ui_local.go
index c9eca2650..9b79a69ee 100644
--- a/server/ui_local.go
+++ b/server/ui_local.go
@@ -1,7 +1,10 @@
package server
import (
+ "bytes"
+ "io/ioutil"
"net/http"
+ "path/filepath"
"github.com/drone/drone/model"
"github.com/drone/drone/server/template"
@@ -49,7 +52,15 @@ func (w *local) Page(rw http.ResponseWriter, r *http.Request, u *model.User) {
"csrf": csrf,
}
- template.T.ExecuteTemplate(rw, "index_polymer.html", params)
+ index, err := ioutil.ReadFile(filepath.Join(w.dir, "index.html"))
+ if err != nil {
+ rw.WriteHeader(404)
+ return
+ }
+ var buf bytes.Buffer
+ template.T.ExecuteTemplate(&buf, "script.html", params)
+ index = bytes.Replace(index, []byte(""), buf.Bytes(), 1)
+ rw.Write(index)
}
}
@@ -64,5 +75,6 @@ func (w *local) Routes() []string {
"/favicon-16x16.png",
"/src/*filepath",
"/bower_components/*filepath",
+ "/static/*filepath",
}
}