| OLD | NEW |
| 1 // Copyright 2017 The LUCI Authors. | 1 // Copyright 2017 The LUCI Authors. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 depth := 0 | 122 depth := 0 |
| 123 for i, b := range c.BuilderRef { | 123 for i, b := range c.BuilderRef { |
| 124 cat[i] = b.Category | 124 cat[i] = b.Category |
| 125 if len(cat[i]) > depth { | 125 if len(cat[i]) > depth { |
| 126 depth = len(cat[i]) | 126 depth = len(cat[i]) |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 result := "" | 130 result := "" |
| 131 for row := 0; row < depth; row++ { | 131 for row := 0; row < depth; row++ { |
| 132 » » result += "<tr><th></th>" | 132 » » result += "<tr><th></th><th></th>" |
| 133 » » // "" is the first node, " " is an empty node. | 133 » » // "" is the first two nodes, " " is an empty node. |
| 134 current := "" | 134 current := "" |
| 135 colspan := 0 | 135 colspan := 0 |
| 136 for _, br := range cat { | 136 for _, br := range cat { |
| 137 colspan++ | 137 colspan++ |
| 138 var s string | 138 var s string |
| 139 if row >= len(br) { | 139 if row >= len(br) { |
| 140 s = " " | 140 s = " " |
| 141 } else { | 141 } else { |
| 142 s = br[row] | 142 s = br[row] |
| 143 } | 143 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 | 194 |
| 195 // ConsoleMainHandler is a redirect handler that redirects the user to the main | 195 // ConsoleMainHandler is a redirect handler that redirects the user to the main |
| 196 // console for a particular project. | 196 // console for a particular project. |
| 197 func ConsoleMainHandler(ctx *router.Context) { | 197 func ConsoleMainHandler(ctx *router.Context) { |
| 198 w, r, p := ctx.Writer, ctx.Request, ctx.Params | 198 w, r, p := ctx.Writer, ctx.Request, ctx.Params |
| 199 proj := p.ByName("project") | 199 proj := p.ByName("project") |
| 200 http.Redirect(w, r, fmt.Sprintf("/console/%s/main", proj), http.StatusMo
vedPermanently) | 200 http.Redirect(w, r, fmt.Sprintf("/console/%s/main", proj), http.StatusMo
vedPermanently) |
| 201 return | 201 return |
| 202 } | 202 } |
| OLD | NEW |