mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Automation dialog: add localization, fix CSS (#1227)
* Automation dialog: add localization, fix CSS * Feedback * Add bottom margin to dialog controls * Remove margin for all
This commit is contained in:
parent
a8fa8d46e5
commit
f96db5003a
@ -1,40 +1,48 @@
|
|||||||
import '@polymer/iron-flex-layout/iron-flex-layout-classes.js';
|
|
||||||
import '@polymer/paper-button/paper-button.js';
|
import '@polymer/paper-button/paper-button.js';
|
||||||
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
|
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
|
||||||
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
||||||
|
|
||||||
import '../../../components/ha-relative-time.js';
|
import '../../../components/ha-relative-time.js';
|
||||||
|
|
||||||
class MoreInfoAutomation extends PolymerElement {
|
import LocalizeMixin from '../../../mixins/localize-mixin.js';
|
||||||
|
|
||||||
|
class MoreInfoAutomation extends LocalizeMixin(PolymerElement) {
|
||||||
static get template() {
|
static get template() {
|
||||||
return html`
|
return html`
|
||||||
<style>
|
<style>
|
||||||
paper-button {
|
paper-button {
|
||||||
color: var(--primary-color);
|
color: var(--primary-color);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
top: 3px;
|
}
|
||||||
height: 37px;
|
.flex {
|
||||||
}
|
display: flex;
|
||||||
</style>
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.actions {
|
||||||
|
margin: 36px 0 8px 0;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<p>
|
<div class="flex">
|
||||||
Last triggered:
|
<div>
|
||||||
<ha-relative-time datetime="[[stateObj.attributes.last_triggered]]"></ha-relative-time>
|
[[localize('ui.card.automation.last_triggered')]]:
|
||||||
</p>
|
</div>
|
||||||
|
<ha-relative-time datetime="[[stateObj.attributes.last_triggered]]"></ha-relative-time>
|
||||||
|
</div>
|
||||||
|
|
||||||
<paper-button on-click="handleTriggerTapped">TRIGGER</paper-button>
|
<div class="actions">
|
||||||
`;
|
<paper-button on-click="handleTriggerTapped">
|
||||||
|
[[localize('ui.card.automation.trigger')]]
|
||||||
|
</paper-button>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
hass: {
|
hass: Object,
|
||||||
type: Object,
|
stateObj: Object
|
||||||
},
|
|
||||||
|
|
||||||
stateObj: {
|
|
||||||
type: Object,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,6 +322,10 @@
|
|||||||
"arm_home": "Arm home",
|
"arm_home": "Arm home",
|
||||||
"arm_away": "Arm away"
|
"arm_away": "Arm away"
|
||||||
},
|
},
|
||||||
|
"automation": {
|
||||||
|
"last_triggered": "Last triggered",
|
||||||
|
"trigger": "Trigger"
|
||||||
|
},
|
||||||
"camera": {
|
"camera": {
|
||||||
"not_available": "Image not available"
|
"not_available": "Image not available"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user