| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package frontend | 5 package frontend |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "github.com/luci/luci-go/server/router" | 8 "github.com/luci/luci-go/server/router" |
| 9 "github.com/luci/luci-go/server/templates" | 9 "github.com/luci/luci-go/server/templates" |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 return err | 25 return err |
| 26 } | 26 } |
| 27 ch <- func() (err error) { | 27 ch <- func() (err error) { |
| 28 mBuildbucket, err = buildbucket.GetAllBuilders(c.Context
) | 28 mBuildbucket, err = buildbucket.GetAllBuilders(c.Context
) |
| 29 return err | 29 return err |
| 30 } | 30 } |
| 31 }) | 31 }) |
| 32 | 32 |
| 33 fp.CIServices = append(fp.CIServices, *mBuildbucket) | 33 fp.CIServices = append(fp.CIServices, *mBuildbucket) |
| 34 fp.CIServices = append(fp.CIServices, *mBuildbot) | 34 fp.CIServices = append(fp.CIServices, *mBuildbot) |
| 35 errMsg := "" |
| 36 if err != nil { |
| 37 errMsg = err.Error() |
| 38 } |
| 35 templates.MustRender(c.Context, c.Writer, "pages/frontpage.html", templa
tes.Args{ | 39 templates.MustRender(c.Context, c.Writer, "pages/frontpage.html", templa
tes.Args{ |
| 36 "frontpage": fp, | 40 "frontpage": fp, |
| 37 » » "error": err.Error(), | 41 » » "error": errMsg, |
| 38 }) | 42 }) |
| 39 } | 43 } |
| 40 | 44 |
| 41 func frontpageTestData() []common.TestBundle { | 45 func frontpageTestData() []common.TestBundle { |
| 42 data := &templates.Args{ | 46 data := &templates.Args{ |
| 43 "frontpage": resp.FrontPage{ | 47 "frontpage": resp.FrontPage{ |
| 44 CIServices: []resp.CIService{ | 48 CIServices: []resp.CIService{ |
| 45 { | 49 { |
| 46 Name: "Module 1", | 50 Name: "Module 1", |
| 47 BuilderGroups: []resp.BuilderGroup{ | 51 BuilderGroups: []resp.BuilderGroup{ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 64 }, | 68 }, |
| 65 "error": "couldn't find ice cream", | 69 "error": "couldn't find ice cream", |
| 66 } | 70 } |
| 67 return []common.TestBundle{ | 71 return []common.TestBundle{ |
| 68 { | 72 { |
| 69 Description: "Basic frontpage", | 73 Description: "Basic frontpage", |
| 70 Data: *data, | 74 Data: *data, |
| 71 }, | 75 }, |
| 72 } | 76 } |
| 73 } | 77 } |
| OLD | NEW |