| 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. |
| Dave Borowitz | e16e486 | 2014-06-26 12:23:18 -0700 | [diff] [blame] | 14 | {namespace gitiles autoescape="strict"} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 15 | |
| 16 | /** |
| 17 | * HTML page for /. |
| 18 | * |
| 19 | * @param hostName host name. |
| 20 | * @param? menuEntries menu entries. |
| Björn Pedersen | bc0eaaa | 2016-03-29 15:30:29 +0200 | [diff] [blame^] | 21 | * @param? customVariant variant name for custom styling. |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 22 | * @param? prefix prefix path for matching repositories. |
| 23 | * @param? breadcrumbs map of breadcrumbs for header. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 24 | * @param repositories list of repository description maps with name, cloneUrl, |
| 25 | * and optional description values. |
| 26 | */ |
| 27 | {template .hostIndex} |
| 28 | {call .header} |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 29 | {param title: $prefix ? $prefix : $hostName ? $hostName + ' Git repositories' : 'Git repositories' /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 30 | {param menuEntries: $menuEntries /} |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 31 | {param breadcrumbs: $breadcrumbs /} |
| Björn Pedersen | bc0eaaa | 2016-03-29 15:30:29 +0200 | [diff] [blame^] | 32 | {param customVariant: $customVariant /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 33 | {/call} |
| 34 | |
| 35 | {if length($repositories)} |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 36 | {if not $breadcrumbs} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 37 | <h1> |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 38 | {msg desc="Git repositories available on the host"} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 39 | Git repositories on {$hostName} |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 40 | {/msg} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 41 | </h1> |
| Shawn Pearce | c709c4c | 2015-08-28 15:30:42 -0700 | [diff] [blame] | 42 | {/if} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 43 | |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 44 | <div class="RepoList"> |
| 45 | <div class="RepoList-item RepoList-item--header"> |
| 46 | <span class="RepoList-itemName"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 47 | {msg desc="column header for repository name"} |
| 48 | Name |
| 49 | {/msg} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 50 | </span> |
| 51 | <span class="RepoList-itemDescription"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 52 | {msg desc="column header for repository description"} |
| 53 | Description |
| 54 | {/msg} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 55 | </span> |
| 56 | </div> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 57 | {foreach $repo in $repositories} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 58 | <a class="RepoList-item" href="{$repo.url}"> |
| 59 | <span class="RepoList-itemName">{$repo.name}</span> |
| 60 | <span class="RepoList-itemDescription">{$repo.description}</span> |
| 61 | </a> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 62 | {/foreach} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 63 | </div> |
| 64 | {/if} |
| Björn Pedersen | bc0eaaa | 2016-03-29 15:30:29 +0200 | [diff] [blame^] | 65 | |
| 66 | {call .footer} |
| 67 | {param customVariant: $customVariant /} |
| 68 | {/call} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 69 | {/template} |