Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions src/panels/lovelace/editor/view-editor/hui-view-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
TemplateResult,
customElement,
property,
CSSResult,
css,
} from "lit-element";
import "@polymer/paper-input/paper-input";

Expand Down Expand Up @@ -80,20 +82,32 @@ export class HuiViewEditor extends LitElement {
${configElementStyle}
<div class="card-config">
<paper-input
label="Title"
.label="${this.hass.localize(
"ui.panel.lovelace.editor.card.generic.title"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm this isn't a card, so we should have put this under ui.panel.lovelace.editor.generic. we will get the same with badges...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah thought the same thing but didn't want to refactor all the translations for editors as well and didn't want to make a 2nd set of the same thing. ui.panel.lovelace.editor.generic.title ideally, I think in the future

)} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional"
)})"
.value=${this._title}
.configValue=${"title"}
@value-changed=${this._valueChanged}
@blur=${this._handleTitleBlur}
></paper-input>
<paper-input
label="Icon"
.label="${this.hass.localize(
"ui.panel.lovelace.editor.card.generic.icon"
)} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional"
)})"
.value=${this._icon}
.configValue=${"icon"}
@value-changed=${this._valueChanged}
></paper-input>
<paper-input
label="URL Path"
.label="${this.hass.localize(
"ui.panel.lovelace.editor.card.generic.url"
)} (${this.hass.localize(
"ui.panel.lovelace.editor.card.config.optional"
)})"
.value=${this._path}
.configValue=${"path"}
@value-changed=${this._valueChanged}
Expand All @@ -108,7 +122,14 @@ export class HuiViewEditor extends LitElement {
?checked=${this._panel !== false}
.configValue=${"panel"}
@change=${this._valueChanged}
>Panel Mode?</ha-switch
>${this.hass.localize(
"ui.panel.lovelace.editor.view.panel_mode.title"
)}</ha-switch
>
<span class="panel"
>${this.hass.localize(
"ui.panel.lovelace.editor.view.panel_mode.description"
)}</span
>
</div>
`;
Expand Down Expand Up @@ -147,6 +168,14 @@ export class HuiViewEditor extends LitElement {
const config = { ...this._config, path: slugify(ev.currentTarget.value) };
fireEvent(this, "view-config-changed", { config });
}

static get styles(): CSSResult {
return css`
.panel {
color: var(--secondary-text-color);
}
`;
}
}

declare global {
Expand Down
6 changes: 6 additions & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,12 @@
"weather-forecast": {
"name": "Weather Forecast"
}
},
"view": {
"panel_mode": {
"title": "Panel Mode?",
"description": "This renders the first card at full width; other cards in this view will not be rendered."
}
}
},
"warning": {
Expand Down