blob: 71ac795b2ebc0daf04b0da2cf5431484fa7a4c37 [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 * Detail page showing a shortlog for a commit.
18 *
19 * @param title human-readable revision name.
20 * @param repositoryName name of this repository.
21 * @param? menuEntries menu entries.
Dave Borowitz76bbefd2014-03-11 16:57:45 -070022 * @param? headerVariant variant name for custom header.
Dave Borowitz9de65952012-08-13 16:09:45 -070023 * @param breadcrumbs breadcrumbs for this page.
24 * @param? tags optional list of tags encountered when peeling this object, with
25 * keys corresponding to gitiles.tagDetail.
Stefan Zagerd2187432014-02-28 02:23:02 -080026 * @param? logEntryVariant variant name for log entry template.
Dave Borowitz9de65952012-08-13 16:09:45 -070027 * @param entries list of log entries; see .logEntry.
28 * @param? nextUrl URL for the next page of results.
29 * @param? previousUrl URL for the previous page of results.
30 */
31{template .logDetail}
32{call .header data="all" /}
33
34{if $tags}
35 {foreach $tag in $tags}
36 {call gitiles.tagDetail data="$tag" /}
37 {/foreach}
38{/if}
39
Dave Borowitzb772cce2012-12-28 13:57:22 -080040{call .logEntries data="all" /}
41
42{call .footer /}
43{/template}
44
45/**
46 * List of log entries.
47 *
Stefan Zagerd2187432014-02-28 02:23:02 -080048 * @param? logEntryVariant variant name for log entry template.
Michael Moss558f8642014-04-15 09:29:21 -070049 * @param? logEntryPretty base "pretty" format for the log entry template.
Dave Borowitzb772cce2012-12-28 13:57:22 -080050 * @param entries list of log entries; see .logEntry.
51 * @param? nextUrl URL for the next page of results.
52 * @param? previousUrl URL for the previous page of results.
53 */
54{template .logEntries}
Dave Borowitz9de65952012-08-13 16:09:45 -070055{if $previousUrl}
56 <div class="log-nav">
57 <a href="{$previousUrl}">{msg desc="text for previous URL"}&laquo; Previous{/msg}</a>
58 </div>
59{/if}
60
61{if length($entries)}
Michael Moss558f8642014-04-15 09:29:21 -070062 <ol class="{$logEntryPretty ?: 'default'} log">
Dave Borowitz9de65952012-08-13 16:09:45 -070063 {foreach $entry in $entries}
64 <li{if $previousUrl and isFirst($entry)} class="first"{/if}>
Stefan Zagerd2187432014-02-28 02:23:02 -080065 {delcall gitiles.logEntry variant="$logEntryVariant ?: 'default'"
66 data="$entry" /}
Dave Borowitz9de65952012-08-13 16:09:45 -070067 </li>
68 {/foreach}
69 </ol>
70{else}
71 <p>{msg desc="informational text for when the log is empty"}No commits.{/msg}</p>
72{/if}
73
74{if $nextUrl}
75 <div class="log-nav">
76 <a href="{$nextUrl}">{msg desc="text for next URL"}Next &raquo;{/msg}</a>
77 </div>
78{/if}
Dave Borowitz9de65952012-08-13 16:09:45 -070079{/template}
80
Dave Borowitzb772cce2012-12-28 13:57:22 -080081
Dave Borowitz9de65952012-08-13 16:09:45 -070082/**
Michael Moss558f8642014-04-15 09:29:21 -070083 * Single pretty log entry, similar to --pretty=oneline.
Dave Borowitz9de65952012-08-13 16:09:45 -070084 *
85 * @param abbrevSha abbreviated SHA-1.
Michael Moss558f8642014-04-15 09:29:21 -070086 * @param sha commit SHA-1.
Dave Borowitz9de65952012-08-13 16:09:45 -070087 * @param url URL to commit detail page.
88 * @param shortMessage short commit message.
Michael Moss558f8642014-04-15 09:29:21 -070089 * @param message list of commit message parts, where each part contains:
90 * text: raw text of the part.
91 * url: optional URL that should be linked to from the part.
92 * @param author author information with at least "name" and "relativeTime" keys.
93 * @param committer committer information with at least "time" and "relativeTime" keys.
Dave Borowitz9de65952012-08-13 16:09:45 -070094 * @param branches list of branches for this entry, with "name" and "url" keys.
95 * @param tags list of tags for this entry, with "name" and "url" keys.
Michael Moss92bb12f2014-05-09 10:55:35 -070096 * @param diffTree unused in this variant.
Dave Borowitz9de65952012-08-13 16:09:45 -070097 */
Michael Moss558f8642014-04-15 09:29:21 -070098{deltemplate gitiles.logEntry variant="'oneline'"}
Dave Borowitz9de65952012-08-13 16:09:45 -070099<a href="{$url}">
100 <span class="sha1">{$abbrevSha}</span>
101 // nbsp instad of CSS padding/margin because those cause a break in the
102 // underline.
103 &nbsp;
Michael Moss558f8642014-04-15 09:29:21 -0700104 {sp}<span>{$shortMessage}</span>
Dave Borowitz9de65952012-08-13 16:09:45 -0700105</a>
Dave Borowitz9cc6fd72014-04-07 19:08:29 -0700106{sp}<span class="author" title="{$author.email}">{msg desc="commit author name"}by {$author.name}{/msg}</span>
107{sp}<span class="time" title="{$author.time}">- {$author.relativeTime}</span>
Dave Borowitz9de65952012-08-13 16:09:45 -0700108{if length($branches)}
109 {foreach $branch in $branches}
110 {sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a>
111 {/foreach}
112{/if}
113{if length($tags)}
114 {foreach $tag in $tags}
115 {sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a>
116 {/foreach}
117{/if}
Stefan Zagerd2187432014-02-28 02:23:02 -0800118{/deltemplate}
Michael Moss558f8642014-04-15 09:29:21 -0700119
120
121/**
122 * Default single log entry (oneline format).
123 *
124 * @param abbrevSha abbreviated SHA-1.
125 * @param sha commit SHA-1.
126 * @param url URL to commit detail page.
127 * @param shortMessage short commit message.
128 * @param message list of commit message parts, where each part contains:
129 * text: raw text of the part.
130 * url: optional URL that should be linked to from the part.
131 * @param author author information with at least "name" and "relativeTime" keys.
132 * @param committer committer information with at least "time" and "relativeTime" keys.
133 * @param branches list of branches for this entry, with "name" and "url" keys.
134 * @param tags list of tags for this entry, with "name" and "url" keys.
Michael Moss92bb12f2014-05-09 10:55:35 -0700135 * @param diffTree unused in this variant.
Michael Moss558f8642014-04-15 09:29:21 -0700136 */
137{deltemplate gitiles.logEntry variant="'default'"}
138{delcall gitiles.logEntry variant="'oneline'" data="all" /}
139{/deltemplate}
140
141
142/**
143 * Single pretty log entry, similar to --pretty=full.
144 *
145 * @param abbrevSha abbreviated SHA-1.
146 * @param sha commit SHA-1.
147 * @param url URL to commit detail page.
148 * @param shortMessage short commit message.
149 * @param message list of commit message parts, where each part contains:
150 * text: raw text of the part.
151 * url: optional URL that should be linked to from the part.
152 * @param author author information with at least "name" and "relativeTime" keys.
153 * @param committer committer information with at least "time" and "relativeTime" keys.
154 * @param branches list of branches for this entry, with "name" and "url" keys.
155 * @param tags list of tags for this entry, with "name" and "url" keys.
Michael Moss92bb12f2014-05-09 10:55:35 -0700156 * @param diffTree unused in this variant.
Michael Moss558f8642014-04-15 09:29:21 -0700157 */
158{deltemplate gitiles.logEntry variant="'full'"}
159<div class="git-commit">
160<table>
161 <tr>
162 <th>{msg desc="Header for commit SHA entry"}commit{/msg}</th>
163 <td class="sha1">
164 <a href="{$url}">{$sha}</a>
165 </td>
166 <td>
167 {if length($branches)}
168 {foreach $branch in $branches}
169 {sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a>
170 {/foreach}
171 {/if}
172 {if length($tags)}
173 {foreach $tag in $tags}
174 {sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a>
175 {/foreach}
176 {else}
177 {sp}
178 {/if}
179 </td>
180 </tr>
181 <tr>
182 <th>{msg desc="Header for commit author"}author{/msg}</th>
183 <td>{call .person_ data="$author" /}</td>
184 <td>{$author.time}</td>
185 </tr>
186 <tr>
187 <th>{msg desc="Header for committer"}committer{/msg}</th>
188 <td>{call .person_ data="$committer" /}</td>
189 <td>{$committer.time}</td>
190 </tr>
191</table>
192</div>
193<pre class="commit-message">
194 {$message}
195</pre>
196{/deltemplate}