blob: 4297d316f18e3047c8ec7686a01f2a0ced4da82d [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.
14{namespace gitiles autoescape="contextual"}
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.
24 * @param breadcrumbs navigation breadcrumbs for this page.
25 * @param? css optional list of CSS URLs to include.
26 * @param? js optional list of Javascript URLs to include.
27 * @param? onLoad optional Javascript to execute in the body's onLoad handler.
28 * Warning: not autoescaped.
29 */
30{template .header}
31<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
32<html>
33<head>
34 <title>
35 {$title}
36 {if $repositoryName}
37 {sp}- {$repositoryName}
38 {/if}
39 {sp}- {msg desc="name of the application"}Git at Google{/msg}
40 </title>
41 <link rel="stylesheet" type="text/css" href="//www.google.com/css/go.css" />
42
43 {if $css and length($css)}
44 {foreach $url in $css}
45 <link rel="stylesheet" type="text/css" href="{$url}" />
46 {/foreach}
47 {/if}
48 // Include default CSS after custom CSS so it can override defaults in third-
49 // party stylesheets (e.g. prettify).
50 <link rel="stylesheet" type="text/css" href="{gitiles.CSS_URL}" />
51
52 {if $js and length($js)}
53 {foreach $url in $js}
54 <script src="{$url}" type="text/javascript"></script>
55 {/foreach}
56 {/if}
57</head>
58<body {if $onLoad}onload="{$onLoad|id}"{/if}>
59 {call .customHeader /}
60
61 {if $menuEntries and length($menuEntries)}
62 <div class="menu">
63 {foreach $entry in $menuEntries}
64 {sp}
65 {if $entry.url}
66 <a href="{$entry.url}"{if not isLast($entry)} class="entry"{/if}>{$entry.text}</a>
67 {else}
68 <span{if not isLast($entry)} class="entry"{/if}>{$entry.text}</span>
69 {/if}
70 {/foreach}
71 {sp}
72 </div>
73 {/if}
74
75 {if $breadcrumbs and length($breadcrumbs)}
76 <div class="breadcrumbs">
77 {foreach $entry in $breadcrumbs}
78 {if not isFirst($entry)}{sp}/{sp}{/if}
79 {if not isLast($entry)}
80 <a href="{$entry.url}">{$entry.text}</a>
81 {else}
82 {$entry.text}
83 {/if}
84 {/foreach}
85 </div>
86 {/if}
87{/template}
88
89/**
90 * Standard footer.
91 */
92{template .footer}
93</body>
94</html>
95{/template}