blob: 6c4de7413767ebd969bc27960ee16f95dcd101ac [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.
Dave Borowitz9de65952012-08-13 16:09:45 -070026 */
27{template .logDetail}
28{call .header data="all" /}
29
30{if $tags}
31 {foreach $tag in $tags}
32 {call gitiles.tagDetail data="$tag" /}
33 {/foreach}
34{/if}
35
Dave Borowitzf6dcf7a2014-07-30 10:26:58 -070036{call .streamingPlaceholder /}
Dave Borowitzb772cce2012-12-28 13:57:22 -080037
38{call .footer /}
39{/template}
40
Dave Borowitzf6dcf7a2014-07-30 10:26:58 -070041
Dave Borowitzb772cce2012-12-28 13:57:22 -080042/**
Dave Borowitzf6dcf7a2014-07-30 10:26:58 -070043 * Header for list of log entries.
Dave Borowitzb772cce2012-12-28 13:57:22 -080044 *
Dave Borowitzf6dcf7a2014-07-30 10:26:58 -070045 * @param? pretty base "pretty" format for the log entry template.
Dave Borowitzb772cce2012-12-28 13:57:22 -080046 * @param? previousUrl URL for the previous page of results.
47 */
Dave Borowitzf6dcf7a2014-07-30 10:26:58 -070048{template .logEntriesHeader}
Dave Borowitz9de65952012-08-13 16:09:45 -070049{if $previousUrl}
50 <div class="log-nav">
51 <a href="{$previousUrl}">{msg desc="text for previous URL"}&laquo; Previous{/msg}</a>
52 </div>
53{/if}
54
Dave Borowitzf6dcf7a2014-07-30 10:26:58 -070055<ol class="{$pretty ?: 'default'} log">
56{/template}
Dave Borowitz9de65952012-08-13 16:09:45 -070057
Dave Borowitzf6dcf7a2014-07-30 10:26:58 -070058
59/**
60 * Wrapper for a single log entry with pretty format and variant.
61 *
62 * @param firstWithPrevious whether this entry is the first in the current list,
63 * but also comes below a "Previous" link.
64 * @param variant variant name for log entry template.
65 * @param entry log entry; see .logEntry.
66 */
67{template .logEntryWrapper}
68// TODO(dborowitz): Better CSS instead of this firstWithPrevious hack.
69<li{if $firstWithPrevious} class="first"{/if}>
70 {delcall gitiles.logEntry variant="$variant ?: 'default'" data="$entry" /}
71</li>
72{/template}
73
74
75/**
76 * Footer for the list of log entries.
77 *
78 * @param? nextUrl URL for the next page of results.
79 */
80{template .logEntriesFooter}
81</ol>
Dave Borowitz9de65952012-08-13 16:09:45 -070082{if $nextUrl}
83 <div class="log-nav">
84 <a href="{$nextUrl}">{msg desc="text for next URL"}Next &raquo;{/msg}</a>
85 </div>
86{/if}
Dave Borowitz9de65952012-08-13 16:09:45 -070087{/template}
88
Dave Borowitzb772cce2012-12-28 13:57:22 -080089
Dave Borowitz9de65952012-08-13 16:09:45 -070090/**
Dave Borowitzf6dcf7a2014-07-30 10:26:58 -070091 * Single log entry indicating the full log is empty.
92 */
93{template .emptyLog}
94<li class="empty">{msg desc="informational text for when the log is empty"}No commits.{/msg}</p>
95{/template}
96
97
98/**
Michael Moss558f8642014-04-15 09:29:21 -070099 * Single pretty log entry, similar to --pretty=oneline.
Dave Borowitz9de65952012-08-13 16:09:45 -0700100 *
101 * @param abbrevSha abbreviated SHA-1.
Michael Moss558f8642014-04-15 09:29:21 -0700102 * @param sha commit SHA-1.
Dave Borowitz9de65952012-08-13 16:09:45 -0700103 * @param url URL to commit detail page.
104 * @param shortMessage short commit message.
Michael Moss558f8642014-04-15 09:29:21 -0700105 * @param message list of commit message parts, where each part contains:
106 * text: raw text of the part.
107 * url: optional URL that should be linked to from the part.
108 * @param author author information with at least "name" and "relativeTime" keys.
109 * @param committer committer information with at least "time" and "relativeTime" keys.
Dave Borowitz9de65952012-08-13 16:09:45 -0700110 * @param branches list of branches for this entry, with "name" and "url" keys.
111 * @param tags list of tags for this entry, with "name" and "url" keys.
Michael Moss92bb12f2014-05-09 10:55:35 -0700112 * @param diffTree unused in this variant.
Dave Borowitz9de65952012-08-13 16:09:45 -0700113 */
Michael Moss558f8642014-04-15 09:29:21 -0700114{deltemplate gitiles.logEntry variant="'oneline'"}
Dave Borowitz9de65952012-08-13 16:09:45 -0700115<a href="{$url}">
116 <span class="sha1">{$abbrevSha}</span>
117 // nbsp instad of CSS padding/margin because those cause a break in the
118 // underline.
119 &nbsp;
Michael Moss558f8642014-04-15 09:29:21 -0700120 {sp}<span>{$shortMessage}</span>
Dave Borowitz9de65952012-08-13 16:09:45 -0700121</a>
Dave Borowitz9cc6fd72014-04-07 19:08:29 -0700122{sp}<span class="author" title="{$author.email}">{msg desc="commit author name"}by {$author.name}{/msg}</span>
123{sp}<span class="time" title="{$author.time}">- {$author.relativeTime}</span>
Dave Borowitz9de65952012-08-13 16:09:45 -0700124{if length($branches)}
125 {foreach $branch in $branches}
126 {sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a>
127 {/foreach}
128{/if}
129{if length($tags)}
130 {foreach $tag in $tags}
131 {sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a>
132 {/foreach}
133{/if}
Stefan Zagerd2187432014-02-28 02:23:02 -0800134{/deltemplate}
Michael Moss558f8642014-04-15 09:29:21 -0700135
136
137/**
138 * Default single log entry (oneline format).
139 *
140 * @param abbrevSha abbreviated SHA-1.
141 * @param sha commit SHA-1.
142 * @param url URL to commit detail page.
143 * @param shortMessage short commit message.
144 * @param message list of commit message parts, where each part contains:
145 * text: raw text of the part.
146 * url: optional URL that should be linked to from the part.
147 * @param author author information with at least "name" and "relativeTime" keys.
148 * @param committer committer information with at least "time" and "relativeTime" keys.
149 * @param branches list of branches for this entry, with "name" and "url" keys.
150 * @param tags list of tags for this entry, with "name" and "url" keys.
Michael Moss92bb12f2014-05-09 10:55:35 -0700151 * @param diffTree unused in this variant.
Michael Moss558f8642014-04-15 09:29:21 -0700152 */
153{deltemplate gitiles.logEntry variant="'default'"}
154{delcall gitiles.logEntry variant="'oneline'" data="all" /}
155{/deltemplate}
156
157
158/**
159 * Single pretty log entry, similar to --pretty=full.
160 *
161 * @param abbrevSha abbreviated SHA-1.
162 * @param sha commit SHA-1.
163 * @param url URL to commit detail page.
164 * @param shortMessage short commit message.
165 * @param message list of commit message parts, where each part contains:
166 * text: raw text of the part.
167 * url: optional URL that should be linked to from the part.
168 * @param author author information with at least "name" and "relativeTime" keys.
169 * @param committer committer information with at least "time" and "relativeTime" keys.
170 * @param branches list of branches for this entry, with "name" and "url" keys.
171 * @param tags list of tags for this entry, with "name" and "url" keys.
Michael Moss92bb12f2014-05-09 10:55:35 -0700172 * @param diffTree unused in this variant.
Michael Moss558f8642014-04-15 09:29:21 -0700173 */
174{deltemplate gitiles.logEntry variant="'full'"}
175<div class="git-commit">
176<table>
177 <tr>
178 <th>{msg desc="Header for commit SHA entry"}commit{/msg}</th>
179 <td class="sha1">
180 <a href="{$url}">{$sha}</a>
181 </td>
182 <td>
183 {if length($branches)}
184 {foreach $branch in $branches}
185 {sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a>
186 {/foreach}
187 {/if}
188 {if length($tags)}
189 {foreach $tag in $tags}
190 {sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a>
191 {/foreach}
192 {else}
193 {sp}
194 {/if}
195 </td>
196 </tr>
197 <tr>
198 <th>{msg desc="Header for commit author"}author{/msg}</th>
199 <td>{call .person_ data="$author" /}</td>
200 <td>{$author.time}</td>
201 </tr>
202 <tr>
203 <th>{msg desc="Header for committer"}committer{/msg}</th>
204 <td>{call .person_ data="$committer" /}</td>
205 <td>{$committer.time}</td>
206 </tr>
207</table>
208</div>
209<pre class="commit-message">
210 {$message}
211</pre>
212{/deltemplate}