Project import generated by Copybara.
GitOrigin-RevId: d9e9e3fb4e31372ec1fb43b178994ca78fa8fe70
diff --git a/templates/framework/header-shared.ezt b/templates/framework/header-shared.ezt
new file mode 100644
index 0000000..614fe5c
--- /dev/null
+++ b/templates/framework/header-shared.ezt
@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+[# This is the part of header.ezt used by both the legacy
+ Monorail UI, and the new Polymer pages.
+]
+<html lang="en">
+<head>
+ <link rel="icon" type="image/vnd.microsoft.icon" href="/static/images/monorail.ico">
+ [if-any link_rel_canonical]
+ <link rel="canonical" href="[link_rel_canonical]">
+ [end]
+
+ <script type="text/javascript" nonce="[nonce]">
+ [# Javascript object containing basic page data. ]
+ window.CS_env = {
+ 'absoluteBaseUrl': '[format "js"][absolute_base_url][end]',
+ 'app_version': '[format "js"][app_version][end]',
+ 'token': '[format "js"][xhr_token][end]',
+ 'tokenExpiresSec': [format "js"][token_expires_sec][end],
+ 'loggedInUserEmail':
+ [if-any logged_in_user]
+ '[format "js"][logged_in_user.email][end]'
+ [else]
+ null
+ [end],
+ 'login_url': '[format "js"][login_url][end]',
+ 'logout_url': '[format "js"][logout_url][end]',
+ 'profileUrl':
+ [if-any logged_in_user]
+ '[format "js"][logged_in_user.profile_url][end]'
+ [else]
+ null
+ [end],
+ 'projectName': '[format "js"][projectname][end]',
+ 'projectIsRestricted': [if-any project_is_restricted]true[else]false[end],
+ 'is_member': '[format "js"][is_member][end]',
+ 'gapi_client_id': '[format "js"][gapi_client_id][end]',
+ };
+ </script>
+
+ [# Improve the snippet that appears in search]
+ [if-any show_search_metadata]
+ <meta name="Description" content="Monorail is simple, reliable, and flexible issue tracking tool.">
+ <meta name="robots" content="NOODP">
+ [end]
+
+ <title>
+ [if-any title][title] - [end]
+ [if-any title_summary][title_summary] - [end]
+ [if-any projectname]
+ [projectname] -
+ [else]
+ [if-any viewing_user_page][viewed_user.display_name] - [end]
+ [end]
+ [if-any title_summary][else]
+ [if-any project_summary][project_summary] - [end]
+ [end]
+ [site_name]
+ </title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="referrer" content="no-referrer">
+ [if-any robots_no_index]
+ <meta name="ROBOTS" content="NOINDEX,NOARCHIVE">
+ [else]
+ <meta name="ROBOTS" content="NOARCHIVE">
+ [end]
+ <meta name="viewport" content="width=device-width, minimum-scale=1.0">
+ <link type="text/css" rel="stylesheet" href="[version_base]/static/css/chopsui-normal.css">
+
+ [if-any is_ezt]
+ <link type="text/css" rel="stylesheet" href="[version_base]/static/css/ph_core.css">
+ <link type="text/css" rel="stylesheet" media="(max-width:425px)"
+ href="[version_base]/static/css/ph_mobile.css">
+
+ [if-any category_css]
+ <link type="text/css" rel="stylesheet" href="[version_base]/static/[category_css]">
+ [end]
+ [if-any category2_css]
+ <link type="text/css" rel="stylesheet" href="[version_base]/static/[category2_css]">
+ [end]
+ [if-any page_css]
+ <link type="text/css" rel="stylesheet" href="[version_base]/static/[page_css]">
+ [end]
+ [end]
+
+ <!-- Lazy load icons. -->
+ <link rel="stylesheet"
+ href="https://fonts.googleapis.com/icon?family=Material+Icons"
+ media="none"
+ id="icons-stylesheet">
+ <script type="module" async defer nonce="[nonce]">
+ document.getElementById('icons-stylesheet').media = 'all';
+ </script>
+ [# NO MORE SCRIPTS IN HEAD, it makes page loading too slow.]
+</head>
+
+[# Tiny script used sitewide. ]
+<script type="text/javascript" nonce="[nonce]">
+ function _go(url, newWindow) {
+ if (newWindow)
+ window.open(url, '_blank');
+ else
+ document.location = url;
+ }
+ function $(id) { return document.getElementById(id); }
+
+ var loadQueue = [];
+ function runOnLoad(fn) { loadQueue.push(fn); }
+
+ window.onload = function() {
+ for (var i = 0; i < loadQueue.length; i++)
+ loadQueue[[]i]();
+ delete loadQueue;
+ };
+</script>