| 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. |
| 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 Borowitz | 76bbefd | 2014-03-11 16:57:45 -0700 | [diff] [blame] | 22 | * @param? headerVariant variant name for custom header. |
| 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} |
| 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 Borowitz | a999b16 | 2014-04-21 16:51:47 -0700 | [diff] [blame] | 41 | * @param firstParts parts of the first line of the header, with "text" and |
| 42 | * optional "url" fields. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 43 | * @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 Borowitz | a999b16 | 2014-04-21 16:51:47 -0700 | [diff] [blame] | 48 | <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 Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 57 | {$rest} |
| 58 | </pre> |
| 59 | {/template} |