blob: 9dfe34221d04d29a3ed806d713c4e2d073a6fef4 [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.
14{namespace gitiles autoescape="contextual"}
15
16/**
17 * Index page for a repository.
18 *
19 * @param repositoryName name of this repository.
20 * @param? menuEntries menu entries.
21 * @param breadcrumbs breadcrumbs for this page.
22 * @param cloneUrl clone URL for this repository.
23 * @param description description text of the repository.
Shawn Pearce49b519b2012-12-21 21:15:45 -080024 * @param? mirroredFromUrl URL this repository is mirrored from.
Dave Borowitz9de65952012-08-13 16:09:45 -070025 * @param? branches list of branch objects with url and name keys.
26 * @param? tags list of tag objects with url and name keys.
27 */
28{template .repositoryIndex}
29{call .header}
30 {param title: $repositoryName /}
31 {param repositoryName: null /}
32 {param menuEntries: $menuEntries /}
33 {param breadcrumbs: $breadcrumbs /}
34{/call}
35
Shawn Pearce49b519b2012-12-21 21:15:45 -080036{if $description or $mirroredFromUrl}
37 <div class="repository-description">
38 {$description}
39 {if $mirroredFromUrl}
40 <div class="repository-mirrored-from">
41 {msg desc="Informational text describing source of repository"}
Shawn Pearcee39ce362012-12-26 17:14:16 -080042 mirrored from {$mirroredFromUrl}
Shawn Pearce49b519b2012-12-21 21:15:45 -080043 {/msg}
44 </div>
45 {/if}
46 </div>
Dave Borowitz9de65952012-08-13 16:09:45 -070047{/if}
48
49<textarea rows="1" cols="150" class="clone-line"
50 onclick="this.focus();this.select();"
51 readonly="readonly">
52 git clone {$cloneUrl}
53</textarea>
54
55<div class="repository-refs">
56 {if $branches and length($branches)}
57 <div class="repository-branches">
58 <h3>Branches</h3>
59 <ul class="branch-list">
60 {foreach $branch in $branches}
61 {call .ref_ data="$branch" /}
62 {/foreach}
63 </ul>
64 </div>
65 {/if}
66
67 {if $tags and length($tags)}
68 <div class="repository-tags">
69 <h3>Tags</h3>
70 <ul class="branch-list">
71 {foreach $tag in $tags}
72 {call .ref_ data="$tag" /}
73 {/foreach}
74 </ul>
75 </div>
76 {/if}
77</div>
78{call .footer /}
79{/template}
80
81/**
82 * Detail for a single ref.
83 *
84 * @param url URL for ref detail page.
85 * @param name ref name.
86 */
87{template .ref_}
88<li><a href="{$url}">{$name}</a></li>
89{/template}