Files
gerrit/polygerrit-ui/app/elements/gr-app.html
Thomas Shafer 08407e32a2 Add ability to not pass in the server config to the gr-change-view
This allows gr-change-view to be included with minimal config.

Change-Id: I5f538208dd0d7ca3fb0b23a699143c36964795c1
2017-06-13 14:10:33 -07:00

210 lines
8.1 KiB
HTML

<!--
Copyright (C) 2015 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.
-->
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../behaviors/base-url-behavior/base-url-behavior.html">
<link rel="import" href="../behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.html">
<link rel="import" href="../styles/app-theme.html">
<link rel="import" href="./admin/gr-admin-group-list/gr-admin-group-list.html">
<link rel="import" href="./admin/gr-admin-project-list/gr-admin-project-list.html">
<link rel="import" href="./admin/gr-admin-project/gr-admin-project.html">
<link rel="import" href="./admin/gr-admin-view/gr-admin-view.html">
<link rel="import" href="./change-list/gr-change-list-view/gr-change-list-view.html">
<link rel="import" href="./change-list/gr-dashboard-view/gr-dashboard-view.html">
<link rel="import" href="./change/gr-change-view/gr-change-view.html">
<link rel="import" href="./core/gr-error-manager/gr-error-manager.html">
<link rel="import" href="./core/gr-keyboard-shortcuts-dialog/gr-keyboard-shortcuts-dialog.html">
<link rel="import" href="./core/gr-main-header/gr-main-header.html">
<link rel="import" href="./core/gr-reporting/gr-reporting.html">
<link rel="import" href="./core/gr-router/gr-router.html">
<link rel="import" href="./diff/gr-diff-view/gr-diff-view.html">
<link rel="import" href="./plugins/gr-external-style/gr-external-style.html">
<link rel="import" href="./plugins/gr-plugin-host/gr-plugin-host.html">
<link rel="import" href="./settings/gr-cla-view/gr-cla-view.html">
<link rel="import" href="./settings/gr-registration-dialog/gr-registration-dialog.html">
<link rel="import" href="./settings/gr-settings-view/gr-settings-view.html">
<link rel="import" href="./shared/gr-fixed-panel/gr-fixed-panel.html">
<link rel="import" href="./shared/gr-overlay/gr-overlay.html">
<link rel="import" href="./shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../styles/shared-styles.html">
<script src="../scripts/util.js"></script>
<dom-module id="gr-app">
<template>
<style include="shared-styles">
:host {
display: flex;
min-height: 100%;
flex-direction: column;
}
gr-fixed-panel {
/**
* This one should be greater that the z-index in gr-diff-view
* because gr-main-header contains overlay.
*/
z-index: 10;
}
gr-main-header,
footer {
color: var(--primary-text-color);
}
gr-main-header {
background-color: var(--header-background-color);
padding: 0 var(--default-horizontal-margin);
}
footer {
background-color: var(--footer-background-color);
display: flex;
justify-content: space-between;
padding: .5rem var(--default-horizontal-margin);
}
main {
flex: 1;
position: relative;
}
.errorView {
align-items: center;
display: none;
flex-direction: column;
justify-content: center;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.errorView.show {
display: flex;
}
.errorEmoji {
font-size: 2.6em;
}
.errorText,
.errorMoreInfo {
margin-top: .75em;
}
.errorText {
font-size: 1.2em;
}
.errorMoreInfo {
color: #999;
}
.feedback {
color: #b71c1c;
}
</style>
<gr-fixed-panel id="header">
<gr-main-header id="mainHeader" search-query="{{params.query}}">
</gr-main-header>
</gr-fixed-panel>
<main>
<template is="dom-if" if="[[_showChangeListView]]" restamp="true">
<gr-change-list-view
params="[[params]]"
view-state="{{_viewState.changeListView}}"
logged-in="[[_computeLoggedIn(_account)]]"></gr-change-list-view>
</template>
<template is="dom-if" if="[[_showDashboardView]]" restamp="true">
<gr-dashboard-view
account="[[_account]]"
params="[[params]]"
view-state="{{_viewState.dashboardView}}"></gr-dashboard-view>
</template>
<template is="dom-if" if="[[_showChangeView]]" restamp="true">
<gr-change-view
params="[[params]]"
view-state="{{_viewState.changeView}}"
back-page="[[_lastSearchPage]]"></gr-change-view>
</template>
<template is="dom-if" if="[[_showDiffView]]" restamp="true">
<gr-diff-view
params="[[params]]"
change-view-state="{{_viewState.changeView}}"></gr-diff-view>
</template>
<template is="dom-if" if="[[_showSettingsView]]" restamp="true">
<gr-settings-view
params="[[params]]"
on-account-detail-update="_handleAccountDetailUpdate">
</gr-settings-view>
</template>
<template is="dom-if" if="[[_showGroupListView]]" restamp="true">
<gr-admin-group-list
params="[[params]]"
id="groupList"></gr-admin-group-list>
</template>
<template is="dom-if" if="[[_showProjectListView]]" restamp="true">
<gr-admin-project-list
params="[[params]]"
id="projectList"></gr-admin-project-list>
</template>
<template is="dom-if" if="[[_showAdminProject]]" restamp="true">
<gr-admin-project project="[[params.project]]"></gr-admin-project>
</template>
<template is="dom-if" if="[[_showAdminView]]" restamp="true">
<gr-admin-view path="[[_path]]"></gr-admin-view>
</template>
<template is="dom-if" if="[[_showCLAView]]" restamp="true">
<gr-cla-view path="[[_path]]"></gr-cla-view>
</template>
<div id="errorView" class="errorView">
<div class="errorEmoji">[[_lastError.emoji]]</div>
<div class="errorText">[[_lastError.text]]</div>
<div class="errorMoreInfo">[[_lastError.moreInfo]]</div>
</div>
</main>
<gr-fixed-panel id="footer">
<footer r="contentinfo">
<div>
Powered by <a href="https://www.gerritcodereview.com/" rel="noopener"
target="_blank">Gerrit Code Review</a>
([[_version]])
</div>
<div>
<a class="feedback"
href="https://bugs.chromium.org/p/gerrit/issues/entry?template=PolyGerrit%20Issue"
rel="noopener" target="_blank">Send feedback</a>
<template is="dom-if" if="[[_computeShowGwtUiLink(_serverConfig)]]">
|
<a id="gwtLink" href$="[[computeGwtUrl(_path)]]" rel="external">Old UI</a>
</template>
| Press &ldquo;?&rdquo; for keyboard shortcuts
</div>
</footer>
</gr-fixed-panel>
<gr-overlay id="keyboardShortcuts" with-backdrop>
<gr-keyboard-shortcuts-dialog
view="[[params.view]]"
on-close="_handleKeyboardShortcutDialogClose"></gr-keyboard-shortcuts-dialog>
</gr-overlay>
<gr-overlay id="registration" with-backdrop>
<gr-registration-dialog
on-account-detail-update="_handleAccountDetailUpdate"
on-close="_handleRegistrationDialogClose">
</gr-registration-dialog>
</gr-overlay>
<gr-error-manager id="errorManager"></gr-error-manager>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
<gr-reporting id="reporting"></gr-reporting>
<gr-router id="router"></gr-router>
<gr-plugin-host id="plugins"
config="[[_serverConfig.plugin]]">
</gr-plugin-host>
<gr-external-style id="externalStyle" name="app-theme"></gr-external-style>
</template>
<script src="gr-app.js" crossorigin="anonymous"></script>
</dom-module>