blob: 2a7ba4033b760667e7a138ad103713ade7d41346 [file] [log] [blame]
Dave Borowitz9de65952012-08-13 16:09:45 -07001// 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 Borowitze16e4862014-06-26 12:23:18 -070014{namespace gitiles autoescape="strict"}
Dave Borowitz9de65952012-08-13 16:09:45 -070015
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 Borowitz76bbefd2014-03-11 16:57:45 -070024 * @param? headerVariant variant name for custom header.
Dave Borowitz9de65952012-08-13 16:09:45 -070025 * @param breadcrumbs navigation breadcrumbs for this page.
26 * @param? css optional list of CSS URLs to include.
Andrew Bonventreb33426e2015-09-09 18:28:28 -040027 * @param? containerClass optional class to append to the main container.
Dave Borowitz9de65952012-08-13 16:09:45 -070028 */
29{template .header}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040030<!DOCTYPE html>
31<html lang="en">
Dave Borowitz9de65952012-08-13 16:09:45 -070032<head>
Andrew Bonventreb33426e2015-09-09 18:28:28 -040033 <meta charset="utf-8">
Dave Borowitz9de65952012-08-13 16:09:45 -070034 <title>
35 {$title}
36 {if $repositoryName}
37 {sp}- {$repositoryName}
38 {/if}
Chad Horohoe2a28d622012-11-12 11:56:59 -080039 {sp}- {msg desc="name of the application"}{gitiles.SITE_TITLE}{/msg}
Dave Borowitz9de65952012-08-13 16:09:45 -070040 </title>
Dave Borowitz9de65952012-08-13 16:09:45 -070041
Andrew Bonventreb33426e2015-09-09 18:28:28 -040042 <link rel="stylesheet" type="text/css" href="{gitiles.BASE_CSS_URL}">
Dave Borowitz9de65952012-08-13 16:09:45 -070043 {if $css and length($css)}
44 {foreach $url in $css}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040045 <link rel="stylesheet" type="text/css" href="{$url}">
Dave Borowitz9de65952012-08-13 16:09:45 -070046 {/foreach}
47 {/if}
Dave Borowitz9de65952012-08-13 16:09:45 -070048</head>
Andrew Bonventreb33426e2015-09-09 18:28:28 -040049<body class="Site">
50 <header class="Site-header">
51 <div class="Header">
52 {delcall gitiles.customHeader variant="$headerVariant ?: 'default'" /}
Dave Borowitz9de65952012-08-13 16:09:45 -070053
Andrew Bonventreb33426e2015-09-09 18:28:28 -040054 {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 Borowitz9de65952012-08-13 16:09:45 -070066 {/if}
Dave Borowitz9de65952012-08-13 16:09:45 -070067 </div>
Andrew Bonventreb33426e2015-09-09 18:28:28 -040068 </header>
Dave Borowitz9de65952012-08-13 16:09:45 -070069
Andrew Bonventreb33426e2015-09-09 18:28:28 -040070 <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 Borowitz9de65952012-08-13 16:09:45 -070084{/template}
85
86/**
Dave Borowitz76bbefd2014-03-11 16:57:45 -070087 * Default custom header implementation for Gitiles.
88 */
89{deltemplate gitiles.customHeader variant="'default'"}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040090<div class="Header-title">
91 {msg desc="short name of the application"}{gitiles.SITE_TITLE}{/msg}
92</div>
Dave Borowitz76bbefd2014-03-11 16:57:45 -070093{/deltemplate}
94
95/**
Dave Borowitz9de65952012-08-13 16:09:45 -070096 * Standard footer.
97 */
98{template .footer}
Andrew Bonventreb33426e2015-09-09 18:28:28 -040099 </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 Bonventre0ffb2822015-09-16 15:28:02 -0400107 <a class="u-monospace Footer-formatsItem" href="?format=TEXT">{msg desc="text format"}txt{/msg}</a>
Andrew Bonventreb33426e2015-09-09 18:28:28 -0400108 {sp}
Andrew Bonventre0ffb2822015-09-16 15:28:02 -0400109 <a class="u-monospace Footer-formatsItem" href="?format=JSON">{msg desc="JSON format"}json{/msg}</a>
Andrew Bonventreb33426e2015-09-09 18:28:28 -0400110 </span>
111 </div>
112 </footer>
Dave Borowitz9de65952012-08-13 16:09:45 -0700113</body>
114</html>
115{/template}
Dave Borowitzfc2f00a2014-07-29 17:34:43 -0700116
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}