blob: a3676d9f5cb863055e21ef4db35cf7f4c06ca2f5 [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="contextual"}
/**
* 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.
* @param? logEntryVariant variant name for log entry template.
* @param entries list of log entries; see .logEntry.
* @param? nextUrl URL for the next page of results.
* @param? previousUrl URL for the previous page of results.
*/
{template .logDetail}
{call .header data="all" /}
{if $tags}
{foreach $tag in $tags}
{call gitiles.tagDetail data="$tag" /}
{/foreach}
{/if}
{call .logEntries data="all" /}
{call .footer /}
{/template}
/**
* List of log entries.
*
* @param? logEntryVariant variant name for log entry template.
* @param entries list of log entries; see .logEntry.
* @param? nextUrl URL for the next page of results.
* @param? previousUrl URL for the previous page of results.
*/
{template .logEntries}
{if $previousUrl}
<div class="log-nav">
<a href="{$previousUrl}">{msg desc="text for previous URL"}&laquo; Previous{/msg}</a>
</div>
{/if}
{if length($entries)}
<ol class="shortlog">
{foreach $entry in $entries}
<li{if $previousUrl and isFirst($entry)} class="first"{/if}>
{delcall gitiles.logEntry variant="$logEntryVariant ?: 'default'"
data="$entry" /}
</li>
{/foreach}
</ol>
{else}
<p>{msg desc="informational text for when the log is empty"}No commits.{/msg}</p>
{/if}
{if $nextUrl}
<div class="log-nav">
<a href="{$nextUrl}">{msg desc="text for next URL"}Next &raquo;{/msg}</a>
</div>
{/if}
{/template}
/**
* Single shortlog entry.
*
* @param abbrevSha abbreviated SHA-1.
* @param url URL to commit detail page.
* @param shortMessage short commit message.
* @param author author information with at least "name" 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.
*/
{deltemplate gitiles.logEntry variant="'default'"}
<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 class="commit-message">{$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}