| // 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 diffs for a single 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? commit optional commit for which diffs are displayed, with keys |
| * corresponding to the gitiles.commitDetail template (minus "diffTree"). |
| */ |
| {template .diffDetail} |
| {call .header data="all" /} |
| |
| {if $commit} |
| {call .commitDetail data="$commit" /} |
| {/if} |
| <div id="DIFF_OUTPUT_BLOCK" /> |
| |
| {call .footer /} |
| {/template} |
| |
| /** |
| * File header for a single unified diff patch. |
| * |
| * @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. |
| */ |
| {template .diffHeader} |
| <pre class="diff-header"> |
| <a name="F{$fileIndex}" class="diff-git"></a> |
| {foreach $part in $firstParts} |
| {if not isFirst($part)}{sp}{/if} |
| {if $part.url} |
| <a href="{$part.url}">{$part.text}</a> |
| {else} |
| {$part.text} |
| {/if} |
| {/foreach}{\n} |
| {$rest} |
| </pre> |
| {/template} |