blob: 5a05304ae90900d21e72e6e40cdb818c1f7e1de7 [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.
Jakub Vranabd9924f2017-09-29 12:14:48 -070014{namespace gitiles}
Dave Borowitz9de65952012-08-13 16:09:45 -070015
16/**
17 * HTML page for /.
Dave Borowitz9de65952012-08-13 16:09:45 -070018 */
Gerrit Code Review6cbcb0e2017-09-19 05:10:59 -070019{template .hostIndex stricthtml="false"}
Jakub Vranac3962332019-03-04 11:21:52 +010020 {@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 Borowitz9de65952012-08-13 16:09:45 -070027{call .header}
Shawn Pearcec709c4c2015-08-28 15:30:42 -070028 {param title: $prefix ? $prefix : $hostName ? $hostName + ' Git repositories' : 'Git repositories' /}
Dave Borowitz9de65952012-08-13 16:09:45 -070029 {param menuEntries: $menuEntries /}
Shawn Pearcec709c4c2015-08-28 15:30:42 -070030 {param breadcrumbs: $breadcrumbs /}
Björn Pedersenbc0eaaa2016-03-29 15:30:29 +020031 {param customVariant: $customVariant /}
Dave Borowitz9de65952012-08-13 16:09:45 -070032{/call}
33
34{if length($repositories)}
Shawn Pearcec709c4c2015-08-28 15:30:42 -070035 {if not $breadcrumbs}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040036 <h1>
Shawn Pearcec709c4c2015-08-28 15:30:42 -070037 {msg desc="Git repositories available on the host"}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040038 Git repositories on {$hostName}
Shawn Pearcec709c4c2015-08-28 15:30:42 -070039 {/msg}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040040 </h1>
Shawn Pearcec709c4c2015-08-28 15:30:42 -070041 {/if}
Dave Borowitz9de65952012-08-13 16:09:45 -070042
Andrew Bonventreb33426e2015-09-09 18:28:28 -040043 <div class="RepoList">
44 <div class="RepoList-item RepoList-item--header">
45 <span class="RepoList-itemName">
Dave Borowitz9de65952012-08-13 16:09:45 -070046 {msg desc="column header for repository name"}
47 Name
48 {/msg}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040049 </span>
50 <span class="RepoList-itemDescription">
Dave Borowitz9de65952012-08-13 16:09:45 -070051 {msg desc="column header for repository description"}
52 Description
53 {/msg}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040054 </span>
55 </div>
Luke Sandberg9645f0f2017-12-22 11:08:35 -080056 {for $repo in $repositories}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040057 <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 Sandberg9645f0f2017-12-22 11:08:35 -080061 {/for}
Dave Borowitz9de65952012-08-13 16:09:45 -070062 </div>
63{/if}
Björn Pedersenbc0eaaa2016-03-29 15:30:29 +020064
65{call .footer}
66 {param customVariant: $customVariant /}
67{/call}
Dave Borowitz9de65952012-08-13 16:09:45 -070068{/template}