OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. |
| 4 |
| 5 package frontend |
| 6 |
| 7 import ( |
| 8 "github.com/luci/luci-go/milo/buildsource" |
| 9 "github.com/luci/luci-go/server/router" |
| 10 "github.com/luci/luci-go/server/templates" |
| 11 ) |
| 12 |
| 13 // BuildHandler is responsible for taking a universal build ID and rendering the |
| 14 // build page (defined in ./appengine/templates/pages/build.html). |
| 15 func BuildHandler(c *router.Context, buildID buildsource.ID) { |
| 16 build, err := buildID.Get(c.Context) |
| 17 // TODO(iannucci, hinoka): make MiloBuild refer to annotation stream by |
| 18 // host/prefix/path instead of by directly pulling it. Do all annotation |
| 19 // stream rendering in the frontend. |
| 20 if err != nil { |
| 21 ErrorHandler(c, err) |
| 22 } else { |
| 23 templates.MustRender(c.Context, c.Writer, "pages/build.html", te
mplates.Args{ |
| 24 "Build": build, |
| 25 }) |
| 26 } |
| 27 } |
OLD | NEW |