Files
gerrit/polygerrit-ui/app/elements/settings/gr-http-password/gr-http-password.html
Wyatt Allen 9f5f43703e Use http_password_url in GR-HTTP-PASSWORD when provided
Bug: Issue 5790
Change-Id: I9c64fe15c12dc91ff7addf14a7007775f24cf4fa
2017-03-15 16:53:07 -07:00

88 lines
2.9 KiB
HTML

<!--
Copyright (C) 2016 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="../../../styles/gr-settings-styles.html">
<link rel="import" href="../../shared/gr-button/gr-button.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">
<dom-module id="gr-http-password">
<template>
<style>
.password {
font-family: var(--monospace-font-family);
}
#generatedPasswordOverlay {
padding: 2em;
width: 50em;
}
#generatedPasswordDisplay {
margin: 1em 0;
}
#generatedPasswordDisplay .value {
font-family: var(--monospace-font-family);
}
#passwordWarning {
font-style: italic;
text-align: center;
}
.closeButton {
bottom: 2em;
position: absolute;
right: 2em;
}
</style>
<style include="gr-settings-styles"></style>
<div class="gr-settings-styles">
<div hidden$="[[_passwordUrl]]">
<section>
<span class="title">Username</span>
<span class="value">[[_username]]</span>
</section>
<gr-button
id="generateButton"
on-tap="_handleGenerateTap">Generate new password</gr-button>
</div>
<span hidden$="[[!_passwordUrl]]">
<a href="[[_passwordUrl]]" target="_blank" rel="noopener">
Obtain password</a>
(opens in a new tab)
</span>
</div>
<gr-overlay
id="generatedPasswordOverlay"
on-iron-overlay-closed="_generatedPasswordOverlayClosed"
with-backdrop>
<div class="gr-settings-styles">
<section id="generatedPasswordDisplay">
<span class="title">New Password:</span>
<span class="value">[[_generatedPassword]]</span>
</section>
<section id="passwordWarning">
This password will not be displayed again.<br>
If you lose it, you will need to generate a new one.
</section>
<gr-button
class="closeButton"
on-tap="_closeOverlay">Close</gr-button>
</div>
</gr-overlay>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
</template>
<script src="gr-http-password.js"></script>
</dom-module>