Skip to content

Commit

Permalink
Merge pull request #102 from matt8707/more-info
Browse files Browse the repository at this point in the history
show_details_on_interaction -> show_more_info
  • Loading branch information
matt8707 authored Jan 6, 2024
2 parents 0f28d87 + bb82855 commit 6c7c65d
Show file tree
Hide file tree
Showing 67 changed files with 128 additions and 51 deletions.
1 change: 1 addition & 0 deletions scripts/translations/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def process_dir(_dir, _output, _keys):
("alarm_modes_armed_custom_bypass", ["ui.panel.lovelace.editor.features.types.alarm-modes.modes_list.armed_custom_bypass"]),
("alarm_modes_disarmed", ["ui.panel.lovelace.editor.features.types.alarm-modes.modes_list.disarmed"]),
("buttons", ["ui.panel.lovelace.editor.card.entities.entity_row.buttons"]),
("show_more_info", ["ui.panel.lovelace.cards.show_more_info"]),
],
),
( # DEVELOPER-TOOLS
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Main/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$: icon = sel?.icon;
$: color = sel?.color;
$: marquee = sel?.marquee;
$: can_open_details = sel?.can_open_details;
$: more_info = sel?.more_info;
let entity: HassEntity;
let contentWidth: number;
Expand Down Expand Up @@ -159,7 +159,7 @@
demo: entity_id,
sel
});
} else if (can_open_details === false) {
} else if (more_info === false) {
toggle();
} else {
switch (getDomain(sel?.entity_id)) {
Expand Down
38 changes: 18 additions & 20 deletions src/lib/Modal/ButtonConfig.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
import Icon from '@iconify/svelte';
import Ripple from 'svelte-ripple';
import InputClear from '$lib/Components/InputClear.svelte';
import Toggle from '$lib/Components/Toggle.svelte';
import ConfigButtons from '$lib/Modal/ConfigButtons.svelte';
import { updateObj, getDomain, getName } from '$lib/Utils';
import type { ButtonItem } from '$lib/Types';
export let isOpen: boolean;
export let canOpen: boolean | undefined = undefined;
export let sel: ButtonItem;
export let demo: string | undefined = undefined;
Expand All @@ -31,11 +29,6 @@
// (maybe make reactive)
$: entity_id = sel?.entity_id;
$: canOpen, set('can_open_details', canOpen);
canOpen = sel?.can_open_details;
if (canOpen === undefined) {
canOpen = true;
}
let icon: string | undefined = sel?.icon;
Expand Down Expand Up @@ -196,11 +189,24 @@
/>
</InputClear>

<div class="interaction_container">
<h2>{$lang('show_details_on_interaction')}</h2>
<div style:margin-top="1.3rem">
<Toggle bind:checked={canOpen} />
</div>
<h2>{$lang('show_more_info')}</h2>

<div class="button-container">
<button
class:selected={sel?.more_info !== false}
on:click={() => set('more_info')}
use:Ripple={$ripple}
>
{$lang('yes')}
</button>

<button
class:selected={sel?.more_info === false}
on:click={() => set('more_info', false)}
use:Ripple={$ripple}
>
{$lang('no')}
</button>
</div>

{#if getDomain(entity_id) === 'media_player'}
Expand Down Expand Up @@ -228,11 +234,3 @@
<ConfigButtons {sel} />
</Modal>
{/if}

<style>
.interaction_container {
display: grid;
grid-template-columns: 1fr auto;
align-items: center;
}
</style>
2 changes: 1 addition & 1 deletion src/lib/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface ButtonItem {
icon?: string;
color?: string;
marquee?: boolean;
can_open_details?: boolean;
more_info?: boolean;
}

export type SidebarItem = BarItem &
Expand Down
1 change: 0 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import { browser } from '$app/environment';
import { modals } from 'svelte-modals';
import Theme from '$lib/Components/Theme.svelte';
import { fade } from 'svelte/transition';
/**
* Data from server-side load
Expand Down
1 change: 1 addition & 0 deletions static/translations/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"shortcuts": "Shortcuts",
"show": "Show",
"show_in_sidebar": "Wys in Kantbalk",
"show_more_info": "Show more information",
"sidebar": "Sidebar",
"size": "Size",
"start": "start",
Expand Down
1 change: 1 addition & 0 deletions static/translations/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"shortcuts": "\u0627\u0644\u0627\u062e\u062a\u0635\u0627\u0631\u0627\u062a",
"show": "\u0639\u0631\u0636",
"show_in_sidebar": "\u0625\u0638\u0647\u0627\u0631 \u0641\u064a \u0627\u0644\u0634\u0631\u064a\u0637 \u0627\u0644\u062c\u0627\u0646\u0628\u064a",
"show_more_info": "Show more information",
"sidebar": "\u0627\u0644\u0634\u0631\u064a\u0637 \u0627\u0644\u062c\u0627\u0646\u0628\u064a",
"size": "Size",
"start": "\u0628\u062f\u0621",
Expand Down
1 change: 1 addition & 0 deletions static/translations/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"shortcuts": "\u041f\u0440\u0435\u043a\u0438 \u043f\u044a\u0442\u0438\u0449\u0430",
"show": "\u041f\u043e\u043a\u0430\u0436\u0438",
"show_in_sidebar": "\u041f\u043e\u043a\u0430\u0437\u0432\u0430\u043d\u0435 \u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u0430\u0442\u0430 \u043b\u0435\u043d\u0442\u0430",
"show_more_info": "\u041f\u043e\u043a\u0430\u0437\u0432\u0430\u043d\u0435 \u043d\u0430 \u043f\u043e\u0432\u0435\u0447\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f",
"sidebar": "\u0421\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u0430 \u043b\u0435\u043d\u0442\u0430",
"size": "\u0420\u0430\u0437\u043c\u0435\u0440",
"source": "\u0418\u0437\u0442\u043e\u0447\u043d\u0438\u043a",
Expand Down
1 change: 1 addition & 0 deletions static/translations/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"shortcuts": "Shortcuts",
"show": "Show",
"show_in_sidebar": "Show in sidebar",
"show_more_info": "Show more information",
"sidebar": "Sidebar",
"size": "Size",
"start": "start",
Expand Down
41 changes: 21 additions & 20 deletions static/translations/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"group": "Grupa",
"ha_url": "Home Assistant URL",
"hidden": "Hidden",
"hide": "Hide",
"hide": "Sakriti",
"history": "Istorija",
"horizontal_stack": "Horizontalni stog",
"hours": "Sati",
Expand All @@ -70,7 +70,7 @@
"javascript_module": "JavaScript modul",
"key_missing": "Nedostaje potreban klju\u010d ''{key}''.",
"language": "Jezik",
"loading": "Loading\u2026",
"loading": "U\u010ditavanje\u2026",
"log_out": "Odjaviti se",
"max": "Maksimalna du\u017eina",
"media": "Media",
Expand All @@ -84,9 +84,9 @@
"no": "Ne",
"no_entities": "Nema entiteta",
"no_options": "Zasad jo\u0161 nema postavki.",
"none": "None",
"none": "Nema",
"nothing_configured": "Jo\u0161 ni\u0161ta nije konfigurisano.",
"nothing_found": "Nothing found!",
"nothing_found": "Ni\u0161ta nije prona\u0111eno!",
"numeric": "Numeri\u010dko stanje",
"object": "Object",
"ok": "OK",
Expand All @@ -97,10 +97,10 @@
"overview": "Pregled",
"pause": "pauziraj",
"period": "Period",
"period_5minute": "5 Minutes",
"period_day": "Day",
"period_hour": "Hour",
"period_month": "Month",
"period_5minute": "5 minuta",
"period_day": "Dan",
"period_hour": "Sat",
"period_month": "Mjesec",
"period_week": "Week",
"picture": "Slika",
"position": "Pozicija",
Expand All @@ -109,19 +109,20 @@
"remove": "Izbrisati",
"save": "Spasiti",
"saved": "Sa\u010duvano",
"say": "Say",
"script": "Script",
"say": "Re\u0107i",
"script": "Skripta",
"search": "Tra\u017ei",
"seconds": "Sekunde",
"section": "Sekcija",
"sensor": "Senzor",
"service": "Service",
"service": "Usluga",
"set_state": "Podesi stanje",
"settings": "Postavke",
"shortcuts": "Shortcuts",
"show": "Show",
"shortcuts": "Pre\u010dice",
"show": "Poka\u017ei",
"show_in_sidebar": "Prika\u017ei u bo\u010dnoj traci",
"sidebar": "Sidebar",
"show_more_info": "Prika\u017ei vi\u0161e informacija",
"sidebar": "Bo\u010dna traka",
"size": "Size",
"start": "start",
"state": "State",
Expand All @@ -135,11 +136,11 @@
"theme": "Tema",
"tilt_position": "Nagibna pozicija",
"time": "Vrijeme",
"time_format_12": "12 hours (AM/PM)",
"time_format_24": "24 hours",
"time_format_auto": "Auto (use language setting)",
"time_format_description": "Choose how times are formatted.",
"time_format_header": "Time format",
"time_format_12": "12 sati (prijepodne/poslijepodne)",
"time_format_24": "24 sata",
"time_format_auto": "Automatski (koristi postavke jezika)",
"time_format_description": "Odaberi kako \u0107e se vremena formatirati.",
"time_format_header": "Format vremena",
"timer": "Tajmer",
"toggle": "Toggle",
"token": "Dugotrajni pristupni tokeni",
Expand All @@ -149,7 +150,7 @@
"unsaved_changes": "Imate nesa\u010duvane promjene, jeste li sigurni da \u017eelite iza\u0107i?",
"unsaved_changes_title": "Nesa\u010duvane promjene",
"url": "URL",
"value": "Value",
"value": "Vrijednost",
"visibility": "Vidljivost",
"visible": "Visible",
"week": "Week",
Expand Down
1 change: 1 addition & 0 deletions static/translations/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"shortcuts": "Dreceres",
"show": "Mostra",
"show_in_sidebar": "Mostra a la barra lateral",
"show_more_info": "Mostra m\u00e9s informaci\u00f3",
"sidebar": "Barra lateral",
"size": "Mida",
"source": "Font",
Expand Down
1 change: 1 addition & 0 deletions static/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"shortcuts": "Z\u00e1stupci",
"show": "Zobrazit",
"show_in_sidebar": "Zobrazit na postrann\u00edm panelu",
"show_more_info": "Zobrazit v\u00edce informac\u00ed",
"sidebar": "Postrann\u00ed panel",
"size": "Velikost",
"source": "Zdroj",
Expand Down
1 change: 1 addition & 0 deletions static/translations/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"shortcuts": "Shortcuts",
"show": "Show",
"show_in_sidebar": "Show in sidebar",
"show_more_info": "Show more information",
"sidebar": "Sidebar",
"size": "Size",
"start": "start",
Expand Down
19 changes: 19 additions & 0 deletions static/translations/da.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"above_horizon": "Over horisonten",
"add": "Tilf\u00f8j",
"add_view": "Tilf\u00f8j visning",
"addons": "Tilf\u00f8jelsesprogrammer",
Expand All @@ -11,10 +12,19 @@
"alarm_modes_disarmed": "Frakoblet",
"alarm_modes_label": "Alarmtilstande",
"appearance": "Udseende",
"armed": "Tilkoblet",
"armed_away": "Tilkoblet ude",
"armed_custom_bypass": "Tilkoblet brugerdefineret bypass",
"armed_home": "Tilkoblet hjemme",
"armed_night": "Tilkoblet nat",
"armed_vacation": "Tilkoblet ferie",
"arming": "Tilkobler",
"auth": "Applikations-loginoplysninger",
"auto": "Auto",
"before": "F\u00f8r",
"below_horizon": "Under horisonten",
"brightness": "Lysstyrke",
"buffering": "Buffer",
"button": "Knap",
"buttons": "Knapper",
"camera": "Kamera",
Expand All @@ -25,6 +35,7 @@
"close_cover": "Luk gardin/port",
"close_tilt_cover": "Luk vippeposition",
"closed": "Lukket",
"closing": "Lukker",
"code": "Kode",
"color": "Farve",
"color_temp": "Temperatur",
Expand All @@ -43,6 +54,8 @@
"day": "Dag",
"delete": "Slet",
"detect": "Detekter",
"disarmed": "Frakoblet",
"disarming": "Frakobler",
"discovered": "Fundet",
"divider": "Opdeler",
"docs": "Dokumentation",
Expand Down Expand Up @@ -118,6 +131,7 @@
"open_cover": "\u00c5bn gardin/port",
"open_menu": "\u00c5bn betjeningspanel-menuen",
"open_tilt_cover": "\u00c5bn vippeposition",
"opening": "\u00c5bner",
"options": "Indstillinger",
"overview": "Oversigt",
"pause": "pause",
Expand All @@ -130,6 +144,7 @@
"period_month": "M\u00e5ned",
"period_week": "Uge",
"picture": "Billede",
"playing": "Afspiller",
"position": "Position",
"preview": "Forh\u00e5ndsvisning",
"raw": "Tekstbaseret redigering",
Expand All @@ -148,6 +163,7 @@
"shortcuts": "Genveje",
"show": "Vis",
"show_in_sidebar": "Vis i sidebj\u00e6lke",
"show_more_info": "Vis flere oplysninger",
"sidebar": "Sidemenu",
"size": "St\u00f8rrelse",
"source": "Kilde",
Expand All @@ -156,9 +172,12 @@
"state": "Tilstand",
"status": "Status",
"stop_cover": "Stop gardin/port",
"stopped": "Stoppet",
"successfully_saved": "Gemt",
"suggestion": "Vi har lavet et forslag til dig",
"summary": "Resum\u00e9",
"swing_modes": "Vippe-tilstande",
"target_temperature": "M\u00e5ltemperatur",
"template": "Skabelon",
"template_editor": "Skabelonredigering",
"theme": "Tema",
Expand Down
1 change: 1 addition & 0 deletions static/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"shortcuts": "Verkn\u00fcpfungen",
"show": "Anzeigen",
"show_in_sidebar": "In der Seitenleiste anzeigen",
"show_more_info": "Weitere Informationen anzeigen",
"sidebar": "Seitenleiste",
"size": "Gr\u00f6\u00dfe",
"source": "Quelle",
Expand Down
1 change: 1 addition & 0 deletions static/translations/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"shortcuts": "\u03a3\u03c5\u03bd\u03c4\u03bf\u03bc\u03b5\u03cd\u03c3\u03b5\u03b9\u03c2",
"show": "\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7",
"show_in_sidebar": "\u03a3\u03c4\u03b7\u03bd \u03c0\u03bb\u03b1\u03ca\u03bd\u03ae \u03bc\u03c0\u03ac\u03c1\u03b1",
"show_more_info": "\u0395\u03bc\u03c6\u03ac\u03bd\u03b9\u03c3\u03b7 \u03c0\u03b5\u03c1\u03b9\u03c3\u03c3\u03cc\u03c4\u03b5\u03c1\u03c9\u03bd \u03c0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03b9\u03ce\u03bd",
"sidebar": "\u03a0\u03bb\u03b1\u03ca\u03bd\u03ae \u03bc\u03c0\u03ac\u03c1\u03b1",
"size": "\u039c\u03ad\u03b3\u03b5\u03b8\u03bf\u03c2",
"source": "\u03a0\u03b7\u03b3\u03ae",
Expand Down
1 change: 1 addition & 0 deletions static/translations/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"shortcuts": "Shortcuts",
"show": "Show",
"show_in_sidebar": "Show in sidebar",
"show_more_info": "Show more information",
"sidebar": "Sidebar",
"size": "Size",
"start": "start",
Expand Down
2 changes: 1 addition & 1 deletion static/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@
"settings": "Settings",
"shortcuts": "Shortcuts",
"show": "Show",
"show_details_on_interaction": "Show Details on Interaction",
"show_in_sidebar": "Show in sidebar",
"show_more_info": "Show more information",
"sidebar": "Sidebar",
"size": "Size",
"source": "Source",
Expand Down
1 change: 1 addition & 0 deletions static/translations/eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"shortcuts": "Shortcuts",
"show": "Show",
"show_in_sidebar": "Show in sidebar",
"show_more_info": "Show more information",
"sidebar": "Sidebar",
"size": "Size",
"start": "start",
Expand Down
1 change: 1 addition & 0 deletions static/translations/es-419.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"shortcuts": "Atajos",
"show": "Mostrar",
"show_in_sidebar": "Mostrar en la barra lateral",
"show_more_info": "Mostrar m\u00e1s informaci\u00f3n",
"sidebar": "Barra lateral",
"size": "Tama\u00f1o",
"start": "iniciar",
Expand Down
Loading

0 comments on commit 6c7c65d

Please sign in to comment.