diff --git a/server/public.go b/server/public.go index 89e0c1ca..a78b66c8 100644 --- a/server/public.go +++ b/server/public.go @@ -102,6 +102,7 @@ func parseTemplates() (txTpl, addressTpl *template.Template) { "formatUnixTime": formatUnixTime, "formatAmount": formatAmount, "setTxToTemplateData": setTxToTemplateData, + "stringInSlice": stringInSlice, } txTpl = template.Must(template.New("tx").Funcs(templateFuncMap).ParseFiles("./static/templates/tx.html", "./static/templates/txdetail.html", "./static/templates/base.html")) addressTpl = template.Must(template.New("address").Funcs(templateFuncMap).ParseFiles("./static/templates/address.html", "./static/templates/txdetail.html", "./static/templates/base.html")) diff --git a/static/templates/txdetail.html b/static/templates/txdetail.html index 8d8a577d..87ebd673 100644 --- a/static/templates/txdetail.html +++ b/static/templates/txdetail.html @@ -18,11 +18,10 @@ {{if $vin.Txid}} - {{if $vin.Addr}} - {{$vin.Addr}} - {{else}}Unparsed address{{end}} + {{if $vin.Addr}}{{if eq $vin.Addr $addr}}{{$vin.Addr}}{{else}} + {{$vin.Addr}}{{end}}{{else}}Unparsed address{{end}} - {{formatAmount $vin.Value}} {{$cs}} + {{formatAmount $vin.Value}} {{$cs}} {{else}}No Inputs (Newly Generated Coins){{end}} @@ -45,12 +44,13 @@ {{range $a := $vout.ScriptPubKey.Addresses}} - {{$a}} + {{if eq $a $addr}}{{$a}}{{else}} + {{$a}}{{end}} {{else}} Unparsed address {{end}} - {{formatAmount $vout.Value}} {{$cs}} + {{formatAmount $vout.Value}} {{$cs}} {{end}}