blob: d800d2ee1eb92c010b6a658cd35144f7e0a51c69 [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 diffs for a single 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? commit optional commit for which diffs are displayed, with keys
25 * corresponding to the gitiles.commitDetail template (minus "diffTree").
26 */
27{template .diffDetail}
28{call .header data="all" /}
29
30{if $commit}
31 {call .commitDetail data="$commit" /}
32{/if}
Dave Borowitzfc2f00a2014-07-29 17:34:43 -070033{call .streamingPlaceholder /}
Dave Borowitz9de65952012-08-13 16:09:45 -070034
35{call .footer /}
36{/template}
37
38/**
39 * File header for a single unified diff patch.
40 *
Dave Borowitza999b162014-04-21 16:51:47 -070041 * @param firstParts parts of the first line of the header, with "text" and
42 * optional "url" fields.
Dave Borowitz9de65952012-08-13 16:09:45 -070043 * @param rest remaining lines of the header, if any.
44 * @param fileIndex position of the file within the difference.
45 */
46{template .diffHeader}
Andrew Bonventre0ffb2822015-09-16 15:28:02 -040047<pre class="u-pre u-monospace Diff">
Andrew Bonventreb33426e2015-09-09 18:28:28 -040048 <a name="F{$fileIndex}" class="Diff-fileIndex"></a>
49 {foreach $part in $firstParts}
50 {if not isFirst($part)}{sp}{/if}
51 {if $part.url}
52 <a href="{$part.url}">{$part.text}</a>
53 {else}
54 {$part.text}
55 {/if}
56 {/foreach}{\n}
57 {$rest}
Dave Borowitz9de65952012-08-13 16:09:45 -070058</pre>
59{/template}