blob: 5222fa0f63df53a16ef93de75e12ffd4e2f0658c [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.
14{namespace gitiles autoescape="contextual"}
15
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}
33<div id="DIFF_OUTPUT_BLOCK" />
34
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}
47<pre class="diff-header">
Dave Borowitza999b162014-04-21 16:51:47 -070048<a name="F{$fileIndex}" class="diff-git"></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}
Dave Borowitz9de65952012-08-13 16:09:45 -070057{$rest}
58</pre>
59{/template}