| 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 about a single revision. |
| 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 styling. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 23 | * @param breadcrumbs breadcrumbs for this page. |
| 24 | * @param? hasBlob set to true if the revision or its peeled value is a blob. |
| Shawn Pearce | 73e3453 | 2015-02-12 16:27:54 -0800 | [diff] [blame] | 25 | * @param? hasReadme set to true if the treeDetail has readmeHtml. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 26 | * @param objects list of objects encountered when peeling this object. Each |
| 27 | * object has a "type" key with one of the |
| 28 | * org.eclipse.jgit.lib.Contants.TYPE_* constant strings, and a "data" key |
| 29 | * with an object whose keys correspond to the appropriate object detail |
| 30 | * template from ObjectDetail.soy. |
| 31 | */ |
| 32 | {template .revisionDetail} |
| 33 | {if $hasBlob} |
| Dave Borowitz | ddc0efc | 2014-04-27 19:12:47 -0600 | [diff] [blame] | 34 | {call .header data="all"} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 35 | {param css: [gitiles.PRETTIFY_CSS_URL] /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 36 | {/call} |
| Shawn Pearce | 73e3453 | 2015-02-12 16:27:54 -0800 | [diff] [blame] | 37 | {elseif $hasReadme} |
| 38 | {call .header data="all"} |
| Shawn Pearce | d4d031d | 2015-07-09 21:32:20 -0700 | [diff] [blame] | 39 | {param css: [gitiles.DOC_CSS_URL, gitiles.PRETTIFY_CSS_URL] /} |
| Shawn Pearce | 73e3453 | 2015-02-12 16:27:54 -0800 | [diff] [blame] | 40 | {/call} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 41 | {else} |
| 42 | {call .header data="all" /} |
| 43 | {/if} |
| 44 | |
| 45 | {foreach $object in $objects} |
| 46 | {switch $object.type} |
| 47 | {case 'commit'} |
| 48 | {call .commitDetail data="$object.data" /} |
| 49 | {case 'tree'} |
| 50 | {call .treeDetail data="$object.data" /} |
| 51 | {case 'blob'} |
| 52 | {call .blobDetail data="$object.data" /} |
| 53 | {case 'tag'} |
| 54 | {call .tagDetail data="$object.data" /} |
| 55 | {default} |
| 56 | <div class="error"> |
| 57 | {msg desc="Error message for an unknown object type"}Object has unknown type.{/msg} |
| 58 | </div> |
| 59 | {/switch} |
| 60 | {/foreach} |
| 61 | |
| Björn Pedersen | bc0eaaa | 2016-03-29 15:30:29 +0200 | [diff] [blame] | 62 | {call .footer} |
| 63 | {param customVariant: $customVariant /} |
| 64 | {/call} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 65 | {/template} |