blob: 6c4de7413767ebd969bc27960ee16f95dcd101ac [file] [log] [blame]
// Copyright 2012 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
{namespace gitiles autoescape="strict"}
/**
* Detail page showing a shortlog for a commit.
*
* @param title human-readable revision name.
* @param repositoryName name of this repository.
* @param? menuEntries menu entries.
* @param? headerVariant variant name for custom header.
* @param breadcrumbs breadcrumbs for this page.
* @param? tags optional list of tags encountered when peeling this object, with
* keys corresponding to gitiles.tagDetail.
*/
{template .logDetail}
{call .header data="all" /}
{if $tags}
{foreach $tag in $tags}
{call gitiles.tagDetail data="$tag" /}
{/foreach}
{/if}
{call .streamingPlaceholder /}
{call .footer /}
{/template}
/**
* Header for list of log entries.
*
* @param? pretty base "pretty" format for the log entry template.
* @param? previousUrl URL for the previous page of results.
*/
{template .logEntriesHeader}
{if $previousUrl}
<div class="log-nav">
<a href="{$previousUrl}">{msg desc="text for previous URL"}&laquo; Previous{/msg}</a>
</div>
{/if}
<ol class="{$pretty ?: 'default'} log">
{/template}
/**
* Wrapper for a single log entry with pretty format and variant.
*
* @param firstWithPrevious whether this entry is the first in the current list,
* but also comes below a "Previous" link.
* @param variant variant name for log entry template.
* @param entry log entry; see .logEntry.
*/
{template .logEntryWrapper}
// TODO(dborowitz): Better CSS instead of this firstWithPrevious hack.
<li{if $firstWithPrevious} class="first"{/if}>
{delcall gitiles.logEntry variant="$variant ?: 'default'" data="$entry" /}
</li>
{/template}
/**
* Footer for the list of log entries.
*
* @param? nextUrl URL for the next page of results.
*/
{template .logEntriesFooter}
</ol>
{if $nextUrl}
<div class="log-nav">
<a href="{$nextUrl}">{msg desc="text for next URL"}Next &raquo;{/msg}</a>
</div>
{/if}
{/template}
/**
* Single log entry indicating the full log is empty.
*/
{template .emptyLog}
<li class="empty">{msg desc="informational text for when the log is empty"}No commits.{/msg}</p>
{/template}
/**
* Single pretty log entry, similar to --pretty=oneline.
*
* @param abbrevSha abbreviated SHA-1.
* @param sha commit SHA-1.
* @param url URL to commit detail page.
* @param shortMessage short commit message.
* @param message list of commit message parts, where each part contains:
* text: raw text of the part.
* url: optional URL that should be linked to from the part.
* @param author author information with at least "name" and "relativeTime" keys.
* @param committer committer information with at least "time" and "relativeTime" keys.
* @param branches list of branches for this entry, with "name" and "url" keys.
* @param tags list of tags for this entry, with "name" and "url" keys.
* @param diffTree unused in this variant.
*/
{deltemplate gitiles.logEntry variant="'oneline'"}
<a href="{$url}">
<span class="sha1">{$abbrevSha}</span>
// nbsp instad of CSS padding/margin because those cause a break in the
// underline.
&nbsp;
{sp}<span>{$shortMessage}</span>
</a>
{sp}<span class="author" title="{$author.email}">{msg desc="commit author name"}by {$author.name}{/msg}</span>
{sp}<span class="time" title="{$author.time}">- {$author.relativeTime}</span>
{if length($branches)}
{foreach $branch in $branches}
{sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a>
{/foreach}
{/if}
{if length($tags)}
{foreach $tag in $tags}
{sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a>
{/foreach}
{/if}
{/deltemplate}
/**
* Default single log entry (oneline format).
*
* @param abbrevSha abbreviated SHA-1.
* @param sha commit SHA-1.
* @param url URL to commit detail page.
* @param shortMessage short commit message.
* @param message list of commit message parts, where each part contains:
* text: raw text of the part.
* url: optional URL that should be linked to from the part.
* @param author author information with at least "name" and "relativeTime" keys.
* @param committer committer information with at least "time" and "relativeTime" keys.
* @param branches list of branches for this entry, with "name" and "url" keys.
* @param tags list of tags for this entry, with "name" and "url" keys.
* @param diffTree unused in this variant.
*/
{deltemplate gitiles.logEntry variant="'default'"}
{delcall gitiles.logEntry variant="'oneline'" data="all" /}
{/deltemplate}
/**
* Single pretty log entry, similar to --pretty=full.
*
* @param abbrevSha abbreviated SHA-1.
* @param sha commit SHA-1.
* @param url URL to commit detail page.
* @param shortMessage short commit message.
* @param message list of commit message parts, where each part contains:
* text: raw text of the part.
* url: optional URL that should be linked to from the part.
* @param author author information with at least "name" and "relativeTime" keys.
* @param committer committer information with at least "time" and "relativeTime" keys.
* @param branches list of branches for this entry, with "name" and "url" keys.
* @param tags list of tags for this entry, with "name" and "url" keys.
* @param diffTree unused in this variant.
*/
{deltemplate gitiles.logEntry variant="'full'"}
<div class="git-commit">
<table>
<tr>
<th>{msg desc="Header for commit SHA entry"}commit{/msg}</th>
<td class="sha1">
<a href="{$url}">{$sha}</a>
</td>
<td>
{if length($branches)}
{foreach $branch in $branches}
{sp}<a href="{$branch.url}" class="branch-label">{$branch.name}</a>
{/foreach}
{/if}
{if length($tags)}
{foreach $tag in $tags}
{sp}<a href="{$tag.url}" class="tag-label">{$tag.name}</a>
{/foreach}
{else}
{sp}
{/if}
</td>
</tr>
<tr>
<th>{msg desc="Header for commit author"}author{/msg}</th>
<td>{call .person_ data="$author" /}</td>
<td>{$author.time}</td>
</tr>
<tr>
<th>{msg desc="Header for committer"}committer{/msg}</th>
<td>{call .person_ data="$committer" /}</td>
<td>{$committer.time}</td>
</tr>
</table>
</div>
<pre class="commit-message">
{$message}
</pre>
{/deltemplate}