summaryrefslogtreecommitdiffstats
path: root/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy
blob: 9801b44caa16247e245b0cd5acf9c787c47f510f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

{namespace com.google.gerrit.httpd.raw}

/**
 * @param canonicalPath
 * @param staticResourcePath
 * @param? assetsPath {string} URL to static assets root, if served from CDN.
 * @param? assetsBundle {string} Assets bundle .html file, served from $assetsPath.
 * @param? faviconPath
 * @param? versionInfo
 * @param? deprecateGwtUi
 */
{template .Index}
  <!DOCTYPE html>{\n}
  <html lang="en">{\n}
  <meta charset="utf-8">{\n}
  <meta name="description" content="Gerrit Code Review">{\n}
  <meta name="referrer" content="never">{\n}
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">{\n}

  <noscript>
    To use PolyGerrit, please enable JavaScript in your browser settings, and then refresh this page.
  </noscript>

  <script>
    window.CLOSURE_NO_DEPS = true;
    {if $canonicalPath != ''}window.CANONICAL_PATH = '{$canonicalPath}';{/if}
    {if $deprecateGwtUi}window.DEPRECATE_GWT_UI = true;{/if}
    {if $versionInfo}window.VERSION_INFO = '{$versionInfo}';{/if}
    {if $staticResourcePath != ''}window.STATIC_RESOURCE_PATH = '{$staticResourcePath}';{/if}
    {if $assetsPath}window.ASSETS_PATH = '{$assetsPath}';{/if}
  </script>{\n}

  {if $faviconPath}
    <link rel="icon" type="image/x-icon" href="{$canonicalPath}/{$faviconPath}">{\n}
  {else}
    <link rel="icon" type="image/x-icon" href="{$canonicalPath}/favicon.ico">{\n}
  {/if}

  // RobotoMono fonts are used in styles/fonts.css
  // @see https://github.com/w3c/preload/issues/32 regarding crossorigin
  <link rel="preload" href="{$staticResourcePath}/fonts/RobotoMono-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">{\n}
  <link rel="preload" href="{$staticResourcePath}/fonts/RobotoMono-Regular.woff" as="font" type="font/woff" crossorigin="anonymous">{\n}
  <link rel="preload" href="{$staticResourcePath}/fonts/Roboto-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">{\n}
  <link rel="preload" href="{$staticResourcePath}/fonts/Roboto-Regular.woff" as="font" type="font/woff" crossorigin="anonymous">{\n}
  <link rel="preload" href="{$staticResourcePath}/fonts/Roboto-Medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">{\n}
  <link rel="preload" href="{$staticResourcePath}/fonts/Roboto-Medium.woff" as="font" type="font/woff" crossorigin="anonymous">{\n}
  <link rel="stylesheet" href="{$staticResourcePath}/styles/fonts.css">{\n}
  <link rel="stylesheet" href="{$staticResourcePath}/styles/main.css">{\n}
  <script src="{$staticResourcePath}/bower_components/webcomponentsjs/webcomponents-lite.js"></script>{\n}
  // Content between webcomponents-lite and the load of the main app element
  // run before polymer-resin is installed so may have security consequences.
  // Contact your local security engineer if you have any questions, and
  // CC them on any changes that load content before gr-app.html.
  //
  // github.com/Polymer/polymer-resin/blob/master/getting-started.md#integrating
  {if $assetsPath and $assetsBundle}
    <link rel="import" href="{$assetsPath}/{$assetsBundle}">{\n}
  {/if}

  <link rel="preload" href="{$staticResourcePath}/elements/gr-app.js" as="script" crossorigin="anonymous">{\n}
  <link rel="import" href="{$staticResourcePath}/elements/gr-app.html">{\n}

  <body unresolved>{\n}
  <gr-app id="app"></gr-app>{\n}
{/template}