| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 1 | // 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 Borowitz | e16e486 | 2014-06-26 12:23:18 -0700 | [diff] [blame] | 14 | {namespace gitiles autoescape="strict"} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 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. |
| Björn Pedersen | bc0eaaa | 2016-03-29 15:30:29 +0200 | [diff] [blame] | 22 | * @param? customVariant variant name for custom styling. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 23 | * @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 Borowitz | fc2f00a | 2014-07-29 17:34:43 -0700 | [diff] [blame] | 33 | {call .streamingPlaceholder /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 34 | |
| Björn Pedersen | bc0eaaa | 2016-03-29 15:30:29 +0200 | [diff] [blame] | 35 | {call .footer} |
| 36 | {param customVariant: $customVariant /} |
| 37 | {/call} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 38 | {/template} |
| 39 | |
| 40 | /** |
| 41 | * File header for a single unified diff patch. |
| 42 | * |
| Dave Borowitz | a999b16 | 2014-04-21 16:51:47 -0700 | [diff] [blame] | 43 | * @param firstParts parts of the first line of the header, with "text" and |
| 44 | * optional "url" fields. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 45 | * @param rest remaining lines of the header, if any. |
| 46 | * @param fileIndex position of the file within the difference. |
| 47 | */ |
| 48 | {template .diffHeader} |
| Andrew Bonventre | 0ffb282 | 2015-09-16 15:28:02 -0400 | [diff] [blame] | 49 | <pre class="u-pre u-monospace Diff"> |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 50 | <a name="F{$fileIndex}" class="Diff-fileIndex"></a> |
| 51 | {foreach $part in $firstParts} |
| 52 | {if not isFirst($part)}{sp}{/if} |
| 53 | {if $part.url} |
| 54 | <a href="{$part.url}">{$part.text}</a> |
| 55 | {else} |
| 56 | {$part.text} |
| 57 | {/if} |
| 58 | {/foreach}{\n} |
| 59 | {$rest} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 60 | </pre> |
| 61 | {/template} |