Files
gerrit/polygerrit-ui/app/elements/edit/gr-editor-view/gr-editor-view.html
Kasper Nilsson 122f8982f0 Make it more clear when in "edit mode"
Previously, there was no indication that "edit mode" was loaded. This
change colors the header blue in edit-related views. It also removes the
yellow coloration of the file list header when an edit patch set is
loaded. This color may or may not be replaced with another color later,
based on feedback from users.

Change-Id: I42c546a1e5809c853f71f6aa6e7ad198213d45c0
2018-02-09 13:57:51 -08:00

124 lines
4.3 KiB
HTML

<!--
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.
-->
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../../behaviors/gr-patch-set-behavior/gr-patch-set-behavior.html">
<link rel="import" href="../../../behaviors/gr-path-list-behavior/gr-path-list-behavior.html">
<link rel="import" href="../../../behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.html">
<link rel="import" href="../../core/gr-navigation/gr-navigation.html">
<link rel="import" href="../../plugins/gr-endpoint-decorator/gr-endpoint-decorator.html">
<link rel="import" href="../../plugins/gr-endpoint-param/gr-endpoint-param.html">
<link rel="import" href="../../shared/gr-button/gr-button.html">
<link rel="import" href="../../shared/gr-editable-label/gr-editable-label.html">
<link rel="import" href="../../shared/gr-fixed-panel/gr-fixed-panel.html">
<link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html">
<link rel="import" href="../gr-default-editor/gr-default-editor.html">
<link rel="import" href="../../../styles/shared-styles.html">
<dom-module id="gr-editor-view">
<template>
<style include="shared-styles">
:host {
background-color: var(--view-background-color);
}
gr-fixed-panel {
background-color: #ebf5fb;
border-bottom: 1px #ddd solid;
z-index: 1;
}
header,
.subHeader {
align-items: center;
display: flex;
justify-content: space-between;
padding: .75em var(--default-horizontal-margin);
}
header gr-editable-label {
font-size: var(--font-size-large);
font-weight: bold;
--label-style: {
text-overflow: initial;
white-space: initial;
word-break: break-all;
}
--input-style: {
margin-top: 1em;
}
}
.textareaWrapper {
border: 1px solid #ddd;
border-radius: 3px;
margin: var(--default-horizontal-margin);
}
.textareaWrapper .editButtons {
display: none;
}
.controlGroup {
align-items: center;
display: flex;
font-size: var(--font-size-large);
}
.rightControls {
justify-content: flex-end;
}
@media screen and (max-width: 50em) {
header,
.subHeader {
display: block;
}
.rightControls {
float: right;
}
}
</style>
<gr-fixed-panel keep-on-scroll>
<header>
<span class="controlGroup">
<span>Edit mode</span>
<span class="separator"></span>
<gr-editable-label
label-text="File path"
value="[[_path]]"
placeholder="File path..."
on-changed="_handlePathChanged"></gr-editable-label>
</span>
<span class="controlGroup rightControls">
<gr-button
id="close"
link
on-tap="_handleCloseTap">Close</gr-button>
<gr-button
id="save"
disabled$="[[_saveDisabled]]"
primary
link
on-tap="_saveEdit">Save</gr-button>
</span>
</header>
</gr-fixed-panel>
<div class="textareaWrapper">
<gr-endpoint-decorator id="editorEndpoint" name="editor">
<gr-endpoint-param name="fileContent" value="[[_newContent]]"></gr-endpoint-param>
<gr-endpoint-param name="prefs" value="[[_prefs]]"></gr-endpoint-param>
<gr-endpoint-param name="fileType" value="[[_type]]"></gr-endpoint-param>
<gr-default-editor id="file" file-content="[[_newContent]]"></gr-default-editor>
</gr-endpoint-decorator>
</div>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
</template>
<script src="gr-editor-view.js"></script>
</dom-module>