diff options
author | bnewbold <bnewbold@robocracy.org> | 2012-09-21 13:03:46 +0200 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2012-09-21 13:03:46 +0200 |
commit | 575dd002be18f170917a98f8bca891b4bd615f78 (patch) | |
tree | 5db7245e184110fd0a403b052191fe6d5b3205d4 /serve.go | |
parent | b0ecc94ef69d489dcc775038a0c6f65c1c960c8e (diff) | |
download | bommom-575dd002be18f170917a98f8bca891b4bd615f78.tar.gz bommom-575dd002be18f170917a98f8bca891b4bd615f78.zip |
basic octopart pricing functionality
Diffstat (limited to 'serve.go')
-rw-r--r-- | serve.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -146,6 +146,7 @@ func bomController(w http.ResponseWriter, r *http.Request, user, name string) (e http.Error(w, "invalid bom name: "+name, 400) return } + context := make(map[string]interface{}) context["BomMeta"], context["Bom"], err = bomstore.GetHead(ShortName(user), ShortName(name)) context["Session"] = session.Values @@ -153,6 +154,10 @@ func bomController(w http.ResponseWriter, r *http.Request, user, name string) (e http.Error(w, "404 couldn't open bom: "+user+"/"+name, 404) return nil } + err = pricingSource.AttachMarketInfoBom(context["Bom"].(*Bom)) + if err != nil { + log.Println("error attaching market info: " + err.Error()) + } err = tmplBomView.Execute(w, context) return } @@ -275,6 +280,7 @@ func serveCmd() { openBomStore() openAuthStore() + openPricingSource() // serve template static assets (images, CSS, JS) http.Handle("/static/", http.FileServer(http.Dir(*templatePath+"/"))) |