blob: cdd5005cd4eef763f9f3154368f48e9b2fbd1648 [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.
Dave Borowitz76bbefd2014-03-11 16:57:45 -070021 * @param? headerVariant variant name for custom header.
Dave Borowitz9de65952012-08-13 16:09:45 -070022 * @param breadcrumbs breadcrumbs for this page.
23 * @param cloneUrl clone URL for this repository.
24 * @param description description text of the repository.
Shawn Pearce49b519b2012-12-21 21:15:45 -080025 * @param? mirroredFromUrl URL this repository is mirrored from.
Dave Borowitze5fead02013-01-07 13:12:59 -080026 * @param branches list of branch objects with url, name, and isHead keys.
Dave Borowitz209d0aa2012-12-28 14:28:53 -080027 * @param? moreBranchesUrl URL to show more branches, if necessary.
28 * @param tags list of tag objects with url and name keys.
29 * @param? moreTagsUrl URL to show more branches, if necessary.
30 * @param? nextUrl URL for the next page of log results.
31 * @param? previousUrl URL for the previous page of log results.
Stefan Zagerd2187432014-02-28 02:23:02 -080032 * @param? logEntryVariant variant name for log entry template.
Dave Borowitz209d0aa2012-12-28 14:28:53 -080033 * @param entries list of log entries; see .logEntry.
Dave Borowitz9de65952012-08-13 16:09:45 -070034 */
35{template .repositoryIndex}
36{call .header}
37 {param title: $repositoryName /}
38 {param repositoryName: null /}
39 {param menuEntries: $menuEntries /}
Dave Borowitz76bbefd2014-03-11 16:57:45 -070040 {param headerVariant: $headerVariant /}
Dave Borowitz9de65952012-08-13 16:09:45 -070041 {param breadcrumbs: $breadcrumbs /}
42{/call}
43
Shawn Pearce49b519b2012-12-21 21:15:45 -080044{if $description or $mirroredFromUrl}
45 <div class="repository-description">
46 {$description}
47 {if $mirroredFromUrl}
48 <div class="repository-mirrored-from">
49 {msg desc="Informational text describing source of repository"}
Shawn Pearcee39ce362012-12-26 17:14:16 -080050 mirrored from {$mirroredFromUrl}
Shawn Pearce49b519b2012-12-21 21:15:45 -080051 {/msg}
52 </div>
53 {/if}
54 </div>
Dave Borowitz9de65952012-08-13 16:09:45 -070055{/if}
56
57<textarea rows="1" cols="150" class="clone-line"
58 onclick="this.focus();this.select();"
59 readonly="readonly">
60 git clone {$cloneUrl}
61</textarea>
62
Dave Borowitz209d0aa2012-12-28 14:28:53 -080063{if length($entries) and (length($branches) or length($tags))}
64 <div class="repository-shortlog-wrapper">
65 <div class="repository-shortlog">
66 {call .logEntries data="all" /}
Dave Borowitz9de65952012-08-13 16:09:45 -070067 </div>
Dave Borowitz209d0aa2012-12-28 14:28:53 -080068 </div>
Dave Borowitz9de65952012-08-13 16:09:45 -070069
Dave Borowitz209d0aa2012-12-28 14:28:53 -080070 <div class="repository-refs">
71 {call .branches_ data="all" /}
72 {call .tags_ data="all" /}
73 </div>
74{elseif length($entries)}
75 {call .logEntries data="all" /}
76{elseif length($branches) or length($tags)}
77 {call .branches_ data="all" /}
78 {call .tags_ data="all" /}
79{/if}
80
Dave Borowitz9de65952012-08-13 16:09:45 -070081{call .footer /}
82{/template}
83
84/**
Dave Borowitz209d0aa2012-12-28 14:28:53 -080085 * List of branches.
Dave Borowitz9de65952012-08-13 16:09:45 -070086 *
Dave Borowitz209d0aa2012-12-28 14:28:53 -080087 * @param? branches list of branch objects with url and name keys.
88 * @param? moreBranchesUrl URL to show more branches, if necessary.
Dave Borowitz9de65952012-08-13 16:09:45 -070089 */
Dave Borowitz209d0aa2012-12-28 14:28:53 -080090{template .branches_ private="true"}
91 {if length($branches)}
92 {call .refList}
93 {param type: 'Branches' /}
94 {param refs: $branches /}
95 {/call}
96 {if $moreBranchesUrl}
97 <a href="{$moreBranchesUrl}">{msg desc="link to view more branches"}More...{/msg}</a>
98 {/if}
99 {/if}
100{/template}
101
102/**
103 * List of tags.
104 *
105 * @param? tags list of branch objects with url and name keys.
106 * @param? moreTagsUrl URL to show more tags, if necessary.
107 */
108{template .tags_ private="true"}
109 {if length($tags)}
110 {call .refList}
111 {param type: 'Tags' /}
112 {param refs: $tags /}
113 {/call}
114 {if $moreTagsUrl}
115 <a href="{$moreTagsUrl}">{msg desc="link to view more tags"}More...{/msg}</a>
116 {/if}
117 {/if}
Dave Borowitz9de65952012-08-13 16:09:45 -0700118{/template}