blob: afe63e80ab676a882b0b1593d6d3b6d0ee659a8a [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 com.google.gitiles.templates.DiffDetail}
import * as common from 'com/google/gitiles/templates/Common.soy';
import * as objDetail from 'com/google/gitiles/templates/ObjectDetail.soy';
/**
* Detail page showing diffs for a single commit.
*/
{template diffDetail stricthtml="false"}
{@param title: ?} /** human-readable revision name. */
{@param repositoryName: ?} /** name of this repository. */
{@param? menuEntries: ?} /** menu entries. */
{@param? customVariant: ?} /** variant name for custom styling. */
{@param breadcrumbs: ?} /** breadcrumbs for this page. */
{@param? commit: ?} /** optional commit for which diffs are displayed, with keys corresponding to
the gitiles.commitDetail template (minus "diffTree"). */
{call common.header data="all" /}
{if $commit}
{call objDetail.commitDetail data="$commit" /}
{/if}
{call common.streamingPlaceholder /}
{call common.footer}
{param customVariant: $customVariant /}
{/call}
{/template}
/**
* File header for a single unified diff patch.
*/
{template diffHeader}
{@param firstParts: ?} /** parts of the first line of the header, with "text" and optional "url"
fields. */
{@param rest: ?} /** remaining lines of the header, if any. */
{@param fileIndex: ?} /** position of the file within the difference. */
<pre class="u-pre u-monospace Diff">
<a name="F{$fileIndex}" class="Diff-fileIndex"></a>
{for $part, $index in $firstParts}
{if $index > 0}{sp}{/if}
{if $part.url}
<a href="{$part.url}">{$part.text}</a>
{else}
{$part.text}
{/if}
{/for}{\n}
{$rest}
</pre>
{/template}