blob: ab3b18c8431e47c4045b038e6727aef5ce562b60 [file] [log] [blame]
Dave Borowitz9de65952012-08-13 16:09:45 -07001// 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 Borowitze16e4862014-06-26 12:23:18 -070014{namespace gitiles autoescape="strict"}
Dave Borowitz9de65952012-08-13 16:09:45 -070015
16/**
17 * HTML page for /.
18 *
19 * @param hostName host name.
20 * @param? menuEntries menu entries.
Björn Pedersenbc0eaaa2016-03-29 15:30:29 +020021 * @param? customVariant variant name for custom styling.
Shawn Pearcec709c4c2015-08-28 15:30:42 -070022 * @param? prefix prefix path for matching repositories.
23 * @param? breadcrumbs map of breadcrumbs for header.
Dave Borowitz9de65952012-08-13 16:09:45 -070024 * @param repositories list of repository description maps with name, cloneUrl,
25 * and optional description values.
26 */
27{template .hostIndex}
28{call .header}
Shawn Pearcec709c4c2015-08-28 15:30:42 -070029 {param title: $prefix ? $prefix : $hostName ? $hostName + ' Git repositories' : 'Git repositories' /}
Dave Borowitz9de65952012-08-13 16:09:45 -070030 {param menuEntries: $menuEntries /}
Shawn Pearcec709c4c2015-08-28 15:30:42 -070031 {param breadcrumbs: $breadcrumbs /}
Björn Pedersenbc0eaaa2016-03-29 15:30:29 +020032 {param customVariant: $customVariant /}
Dave Borowitz9de65952012-08-13 16:09:45 -070033{/call}
34
35{if length($repositories)}
Shawn Pearcec709c4c2015-08-28 15:30:42 -070036 {if not $breadcrumbs}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040037 <h1>
Shawn Pearcec709c4c2015-08-28 15:30:42 -070038 {msg desc="Git repositories available on the host"}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040039 Git repositories on {$hostName}
Shawn Pearcec709c4c2015-08-28 15:30:42 -070040 {/msg}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040041 </h1>
Shawn Pearcec709c4c2015-08-28 15:30:42 -070042 {/if}
Dave Borowitz9de65952012-08-13 16:09:45 -070043
Andrew Bonventreb33426e2015-09-09 18:28:28 -040044 <div class="RepoList">
45 <div class="RepoList-item RepoList-item--header">
46 <span class="RepoList-itemName">
Dave Borowitz9de65952012-08-13 16:09:45 -070047 {msg desc="column header for repository name"}
48 Name
49 {/msg}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040050 </span>
51 <span class="RepoList-itemDescription">
Dave Borowitz9de65952012-08-13 16:09:45 -070052 {msg desc="column header for repository description"}
53 Description
54 {/msg}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040055 </span>
56 </div>
Dave Borowitz9de65952012-08-13 16:09:45 -070057 {foreach $repo in $repositories}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040058 <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 Borowitz9de65952012-08-13 16:09:45 -070062 {/foreach}
Dave Borowitz9de65952012-08-13 16:09:45 -070063 </div>
64{/if}
Björn Pedersenbc0eaaa2016-03-29 15:30:29 +020065
66{call .footer}
67 {param customVariant: $customVariant /}
68{/call}
Dave Borowitz9de65952012-08-13 16:09:45 -070069{/template}