Skip to content

Commit

Permalink
use latest html/css/js libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Apr 24, 2021
1 parent dc56170 commit c652d6e
Show file tree
Hide file tree
Showing 36 changed files with 169 additions and 10,175 deletions.
2 changes: 2 additions & 0 deletions cmd/lweb/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ func parseAssetsWithFunc(funcMap template.FuncMap, filenames ...string) (*templa
// Not really a problem, but be consistent.
return nil, fmt.Errorf("html/template: no files named in call to ParseFiles")
}
filenames = append(filenames, "templates/template.common.html")
return template.New(path.Base(filenames[0])).Funcs(funcMap).ParseFS(contentTemplates, filenames...)
}

Expand All @@ -19,5 +20,6 @@ func parseAssets(filenames ...string) (*template.Template, error) {
// Not really a problem, but be consistent.
return nil, fmt.Errorf("html/template: no files named in call to ParseFiles")
}
filenames = append(filenames, "templates/template.common.html")
return template.New(path.Base(filenames[0])).ParseFS(contentTemplates, filenames...)
}
3 changes: 1 addition & 2 deletions cmd/lweb/handler_ledger.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package main

import (
"html/template"
"net/http"

"github.com/julienschmidt/httprouter"
)

func ledgerHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
t, err := template.ParseFS(contentTemplates, "templates/template.ledger.html", "templates/template.nav.html")
t, err := parseAssets("templates/template.ledger.html", "templates/template.nav.html")
if err != nil {
http.Error(w, err.Error(), 500)
return
Expand Down
2 changes: 1 addition & 1 deletion cmd/lweb/handler_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func reportHandler(w http.ResponseWriter, r *http.Request, params httprouter.Par
mf, _ := maxValue.Float64()
cf, _ := values[idx].Balance.Float64()
values[idx].Percentage = int((cf / mf) * 100.0)
if values[idx].Percentage > 9 {
if values[idx].Percentage > 5 {
maxIdx = idx
}
}
Expand Down
Loading

0 comments on commit c652d6e

Please sign in to comment.