diff --git a/server/public.go b/server/public.go index af2c16d1..84ce4873 100644 --- a/server/public.go +++ b/server/public.go @@ -80,6 +80,7 @@ func NewPublicServer(binding string, certFiles string, db *db.RocksDB, chain bch serveMux.HandleFunc(path+"address/", s.addressRedirect) // explorer serveMux.HandleFunc(path+"explorer/tx/", s.explorerTx) + serveMux.Handle(path+"static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static/")))) // API calls serveMux.HandleFunc(path+"api/block-index/", s.apiBlockIndex) serveMux.HandleFunc(path+"api/tx/", s.apiTx) @@ -169,11 +170,15 @@ func (s *PublicServer) explorerTx(w http.ResponseWriter, r *http.Request) { } } w.Header().Set("Content-Type", "text/html; charset=utf-8") + // temporarily reread the template on each request + // to reflect changes during development + txTpl := template.Must(template.New("tx").ParseFiles("./static/templates/tx.html", "./static/templates/base.html")) + data := struct { CoinName string - Tx *api.Tx + Specific *api.Tx }{s.is.Coin, tx} - if err := s.txTpl.ExecuteTemplate(w, "base.html", data); err != nil { + if err := txTpl.ExecuteTemplate(w, "base.html", data); err != nil { glog.Error(err) } } diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 00000000..66aa2aa7 --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,75 @@ +html, body { + height: 100%; +} + +body { + display: inline-block; + width: 100%; + min-width: 727px; + min-height: 100%; + background-color: #ffffff; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif; + font-size: 14px; +} + +@media (min-width: 768px) { + .container { + width: 750px; + } +} + +@media (min-width: 992px) { + .container { + width: 970px; + } +} + +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} + +#header { + position: absolute; + top: 0; + left: 0; + height: 53px; + width: 100%; + margin: 0; + padding-bottom: 0; + padding-top: 0; + background-color: #212121; + border: 0; +} + +.bg-trezor { + background-color: #212121!important; + height: 53px; +} + +.bg-trezor .navbar-text { + color: rgba(255, 255, 255); + font-weight: bold; + font-size: 19px; + padding-left: 35px; +} + +.trezor-logo-svg-white svg { + fill: #FFFFFF; + margin-top: 6px; +} + +#wrap { + min-height: 100%; + height: auto; + padding: 75px 0; + margin: 0 auto -51px; +} + +#footer { + background-color: #212121; + color: #fff; + height: 51px; + overflow: hidden; +} \ No newline at end of file diff --git a/static/templates/base.html b/static/templates/base.html index 28ec49fa..ad1fe9be 100644 --- a/static/templates/base.html +++ b/static/templates/base.html @@ -2,16 +2,75 @@ + - + + TREZOR {{.CoinName}} Explorer - {{template "tx" .Tx}} + +
+
+ {{template "specific" .Specific}} +
+
+ \ No newline at end of file