blob: 83b0304163bd75ada1dae3bba2d62bc3efbdad3f [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 Borowitz209d0aa2012-12-28 14:28:53 -080025 * @param branches list of branch objects with url and name keys.
26 * @param? moreBranchesUrl URL to show more branches, if necessary.
27 * @param tags list of tag objects with url and name keys.
28 * @param? moreTagsUrl URL to show more branches, if necessary.
29 * @param? nextUrl URL for the next page of log results.
30 * @param? previousUrl URL for the previous page of log results.
31 * @param entries list of log entries; see .logEntry.
Dave Borowitz9de65952012-08-13 16:09:45 -070032 */
33{template .repositoryIndex}
34{call .header}
35 {param title: $repositoryName /}
36 {param repositoryName: null /}
37 {param menuEntries: $menuEntries /}
38 {param breadcrumbs: $breadcrumbs /}
39{/call}
40
Shawn Pearce49b519b2012-12-21 21:15:45 -080041{if $description or $mirroredFromUrl}
42 <div class="repository-description">
43 {$description}
44 {if $mirroredFromUrl}
45 <div class="repository-mirrored-from">
46 {msg desc="Informational text describing source of repository"}
Shawn Pearcee39ce362012-12-26 17:14:16 -080047 mirrored from {$mirroredFromUrl}
Shawn Pearce49b519b2012-12-21 21:15:45 -080048 {/msg}
49 </div>
50 {/if}
51 </div>
Dave Borowitz9de65952012-08-13 16:09:45 -070052{/if}
53
54<textarea rows="1" cols="150" class="clone-line"
55 onclick="this.focus();this.select();"
56 readonly="readonly">
57 git clone {$cloneUrl}
58</textarea>
59
Dave Borowitz209d0aa2012-12-28 14:28:53 -080060{if length($entries) and (length($branches) or length($tags))}
61 <div class="repository-shortlog-wrapper">
62 <div class="repository-shortlog">
63 {call .logEntries data="all" /}
Dave Borowitz9de65952012-08-13 16:09:45 -070064 </div>
Dave Borowitz209d0aa2012-12-28 14:28:53 -080065 </div>
Dave Borowitz9de65952012-08-13 16:09:45 -070066
Dave Borowitz209d0aa2012-12-28 14:28:53 -080067 <div class="repository-refs">
68 {call .branches_ data="all" /}
69 {call .tags_ data="all" /}
70 </div>
71{elseif length($entries)}
72 {call .logEntries data="all" /}
73{elseif length($branches) or length($tags)}
74 {call .branches_ data="all" /}
75 {call .tags_ data="all" /}
76{/if}
77
Dave Borowitz9de65952012-08-13 16:09:45 -070078{call .footer /}
79{/template}
80
81/**
Dave Borowitz209d0aa2012-12-28 14:28:53 -080082 * List of branches.
Dave Borowitz9de65952012-08-13 16:09:45 -070083 *
Dave Borowitz209d0aa2012-12-28 14:28:53 -080084 * @param? branches list of branch objects with url and name keys.
85 * @param? moreBranchesUrl URL to show more branches, if necessary.
Dave Borowitz9de65952012-08-13 16:09:45 -070086 */
Dave Borowitz209d0aa2012-12-28 14:28:53 -080087{template .branches_ private="true"}
88 {if length($branches)}
89 {call .refList}
90 {param type: 'Branches' /}
91 {param refs: $branches /}
92 {/call}
93 {if $moreBranchesUrl}
94 <a href="{$moreBranchesUrl}">{msg desc="link to view more branches"}More...{/msg}</a>
95 {/if}
96 {/if}
97{/template}
98
99/**
100 * List of tags.
101 *
102 * @param? tags list of branch objects with url and name keys.
103 * @param? moreTagsUrl URL to show more tags, if necessary.
104 */
105{template .tags_ private="true"}
106 {if length($tags)}
107 {call .refList}
108 {param type: 'Tags' /}
109 {param refs: $tags /}
110 {/call}
111 {if $moreTagsUrl}
112 <a href="{$moreTagsUrl}">{msg desc="link to view more tags"}More...{/msg}</a>
113 {/if}
114 {/if}
Dave Borowitz9de65952012-08-13 16:09:45 -0700115{/template}