| 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 | * Common header for Gitiles. |
| 18 | * |
| 19 | * @param title title for this page. Always suffixed with repository name and a |
| 20 | * sitewide title. |
| 21 | * @param? repositoryName repository name for this page, if applicable. |
| 22 | * @param? menuEntries optional list of menu entries with "text" and optional |
| 23 | * "url" keys. |
| Dave Borowitz | 76bbefd | 2014-03-11 16:57:45 -0700 | [diff] [blame] | 24 | * @param? headerVariant variant name for custom header. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 25 | * @param breadcrumbs navigation breadcrumbs for this page. |
| 26 | * @param? css optional list of CSS URLs to include. |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 27 | * @param? containerClass optional class to append to the main container. |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 28 | */ |
| 29 | {template .header} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 30 | <!DOCTYPE html> |
| 31 | <html lang="en"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 32 | <head> |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 33 | <meta charset="utf-8"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 34 | <title> |
| 35 | {$title} |
| 36 | {if $repositoryName} |
| 37 | {sp}- {$repositoryName} |
| 38 | {/if} |
| Chad Horohoe | 2a28d62 | 2012-11-12 11:56:59 -0800 | [diff] [blame] | 39 | {sp}- {msg desc="name of the application"}{gitiles.SITE_TITLE}{/msg} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 40 | </title> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 41 | |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 42 | <link rel="stylesheet" type="text/css" href="{gitiles.BASE_CSS_URL}"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 43 | {if $css and length($css)} |
| 44 | {foreach $url in $css} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 45 | <link rel="stylesheet" type="text/css" href="{$url}"> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 46 | {/foreach} |
| 47 | {/if} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 48 | </head> |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 49 | <body class="Site"> |
| 50 | <header class="Site-header"> |
| 51 | <div class="Header"> |
| 52 | {delcall gitiles.customHeader variant="$headerVariant ?: 'default'" /} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 53 | |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 54 | {if $menuEntries and length($menuEntries)} |
| 55 | <div class="Header-menu"> |
| 56 | {foreach $entry in $menuEntries} |
| 57 | {sp} |
| 58 | {if $entry.url} |
| 59 | <a class="Header-menuItem" href="{$entry.url}">{$entry.text}</a> |
| 60 | {else} |
| 61 | <span class="Header-menuItem Header-menuItem--noAction">{$entry.text}</span> |
| 62 | {/if} |
| 63 | {/foreach} |
| 64 | {sp} |
| 65 | </div> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 66 | {/if} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 67 | </div> |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 68 | </header> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 69 | |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 70 | <div class="Site-content"> |
| 71 | <div class="Container {if $containerClass}{$containerClass}{/if}"> |
| 72 | {if $breadcrumbs and length($breadcrumbs)} |
| 73 | <div class="Breadcrumbs"> |
| 74 | {foreach $entry in $breadcrumbs} |
| 75 | {if not isFirst($entry)}{sp}/{sp}{/if} |
| 76 | {if not isLast($entry)} |
| 77 | <a class="Breadcrumbs-crumb" href="{$entry.url}">{$entry.text}</a> |
| 78 | {else} |
| 79 | <span class="Breadcrumbs-crumb">{$entry.text}</span> |
| 80 | {/if} |
| 81 | {/foreach} |
| 82 | </div> |
| 83 | {/if} |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 84 | {/template} |
| 85 | |
| 86 | /** |
| Dave Borowitz | 76bbefd | 2014-03-11 16:57:45 -0700 | [diff] [blame] | 87 | * Default custom header implementation for Gitiles. |
| 88 | */ |
| 89 | {deltemplate gitiles.customHeader variant="'default'"} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 90 | <div class="Header-title"> |
| 91 | {msg desc="short name of the application"}{gitiles.SITE_TITLE}{/msg} |
| 92 | </div> |
| Dave Borowitz | 76bbefd | 2014-03-11 16:57:45 -0700 | [diff] [blame] | 93 | {/deltemplate} |
| 94 | |
| 95 | /** |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 96 | * Standard footer. |
| 97 | */ |
| 98 | {template .footer} |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 99 | </div> <!-- Container --> |
| 100 | </div> <!-- Site-content --> |
| 101 | <footer class="Site-footer"> |
| 102 | <div class="Footer"> |
| 103 | <span class="Footer-poweredBy"> |
| 104 | Powered by <a href="https://code.google.com/p/gitiles/">Gitiles</a> |
| 105 | </span> |
| 106 | <span class="Footer-formats"> |
| Andrew Bonventre | 0ffb282 | 2015-09-16 15:28:02 -0400 | [diff] [blame] | 107 | <a class="u-monospace Footer-formatsItem" href="?format=TEXT">{msg desc="text format"}txt{/msg}</a> |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 108 | {sp} |
| Andrew Bonventre | 0ffb282 | 2015-09-16 15:28:02 -0400 | [diff] [blame] | 109 | <a class="u-monospace Footer-formatsItem" href="?format=JSON">{msg desc="JSON format"}json{/msg}</a> |
| Andrew Bonventre | b33426e | 2015-09-09 18:28:28 -0400 | [diff] [blame] | 110 | </span> |
| 111 | </div> |
| 112 | </footer> |
| Dave Borowitz | 9de6595 | 2012-08-13 16:09:45 -0700 | [diff] [blame] | 113 | </body> |
| 114 | </html> |
| 115 | {/template} |
| Dave Borowitz | fc2f00a | 2014-07-29 17:34:43 -0700 | [diff] [blame] | 116 | |
| 117 | /** |
| 118 | * Placeholder for streaming rendering. |
| 119 | * |
| 120 | * Insert this in a template to use with |
| 121 | * Renderer#renderStreaming(HttpServletResponse, String). |
| 122 | */ |
| 123 | {template .streamingPlaceholder} |
| 124 | <div id="STREAMED_OUTPUT_BLOCK" /> |
| 125 | {/template} |