| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 1 | // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (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 |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| Jakub Vrana | bd9924f | 2017-09-29 12:14:48 -0700 | [diff] [blame] | 14 | {namespace gitiles} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 15 | |
| 16 | /** |
| 17 | * HTML page for /. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 18 | */ |
| Gerrit Code Review | 6cbcb0e | 2017-09-19 05:10:59 -0700 | [diff] [blame] | 19 | {template .hostIndex stricthtml="false"} |
| Jakub Vrana | c396233 | 2019-03-04 11:21:52 +0100 | [diff] [blame] | 20 | {@param hostName: ?} /** host name. */ |
| 21 | {@param? menuEntries: ?} /** menu entries. */ |
| 22 | {@param? customVariant: ?} /** variant name for custom styling. */ |
| 23 | {@param? prefix: ?} /** prefix path for matching repositories. */ |
| 24 | {@param? breadcrumbs: ?} /** map of breadcrumbs for header. */ |
| 25 | {@param repositories: ?} /** list of repository description maps with name, cloneUrl, and |
| 26 | optional description values. */ |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 27 | {call .header} |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 28 | {param title: $prefix ? $prefix : $hostName ? $hostName + ' Git repositories' : 'Git repositories' /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 29 | {param menuEntries: $menuEntries /} |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 30 | {param breadcrumbs: $breadcrumbs /} |
| Björn Pedersen | bc0eaaa | 2016-03-29 15:30:29 +0200 | [diff] [blame] | 31 | {param customVariant: $customVariant /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 32 | {/call} |
| 33 | |
| 34 | {if length($repositories)} |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 35 | {if not $breadcrumbs} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 36 | <h1> |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 37 | {msg desc="Git repositories available on the host"} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 38 | Git repositories on {$hostName} |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 39 | {/msg} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 40 | </h1> |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 41 | {/if} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 42 | |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 43 | <div class="RepoList"> |
| 44 | <div class="RepoList-item RepoList-item--header"> |
| 45 | <span class="RepoList-itemName"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 46 | {msg desc="column header for repository name"} |
| 47 | Name |
| 48 | {/msg} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 49 | </span> |
| 50 | <span class="RepoList-itemDescription"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 51 | {msg desc="column header for repository description"} |
| 52 | Description |
| 53 | {/msg} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 54 | </span> |
| 55 | </div> |
| Luke Sandberg | 9645f0f | 2017-12-22 11:08:35 -0800 | [diff] [blame] | 56 | {for $repo in $repositories} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 57 | <a class="RepoList-item" href="{$repo.url}"> |
| 58 | <span class="RepoList-itemName">{$repo.name}</span> |
| 59 | <span class="RepoList-itemDescription">{$repo.description}</span> |
| 60 | </a> |
| Luke Sandberg | 9645f0f | 2017-12-22 11:08:35 -0800 | [diff] [blame] | 61 | {/for} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 62 | </div> |
| 63 | {/if} |
| Björn Pedersen | bc0eaaa | 2016-03-29 15:30:29 +0200 | [diff] [blame] | 64 | |
| 65 | {call .footer} |
| 66 | {param customVariant: $customVariant /} |
| 67 | {/call} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 68 | {/template} |