Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Unified Diff: milo/frontend/view_builder.go

Issue 2977863002: [milo] Refactor all html knowledge out of backends. (Closed)
Patch Set: now with case insensitivity Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/frontend/view_build.go ('k') | milo/frontend/view_config.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/frontend/view_builder.go
diff --git a/milo/frontend/view_builder.go b/milo/frontend/view_builder.go
new file mode 100644
index 0000000000000000000000000000000000000000..901bbeebe2c4a5c9829cecd85fdb862eb06f69e3
--- /dev/null
+++ b/milo/frontend/view_builder.go
@@ -0,0 +1,27 @@
+// Copyright 2017 The LUCI Authors. All rights reserved.
+// Use of this source code is governed under the Apache License, Version 2.0
+// that can be found in the LICENSE file.
+
+package frontend
+
+import (
+ "github.com/luci/luci-go/milo/buildsource"
+ "github.com/luci/luci-go/server/router"
+ "github.com/luci/luci-go/server/templates"
+)
+
+// BuilderHandler is responsible for taking a universal builder ID and rendering
+// the builder page (defined in ./appengine/templates/pages/builder.html).
+func BuilderHandler(c *router.Context, builderID buildsource.BuilderID) {
+ builder, err := builderID.Get(c.Context, c.Params.ByName("limit"), c.Params.ByName("cursor"))
+ // TODO(iannucci, hinoka): make MiloBuild refer to annotation stream by
+ // host/prefix/path instead of by directly pulling it. Do all annotation
+ // stream rendering in the frontend.
+ if err != nil {
+ ErrorHandler(c, err)
+ } else {
+ templates.MustRender(c.Context, c.Writer, "pages/builder.html", templates.Args{
+ "Builder": builder,
+ })
+ }
+}
« no previous file with comments | « milo/frontend/view_build.go ('k') | milo/frontend/view_config.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698