From 2e8871d22e09db674564b8d9f76b76465c2512ce Mon Sep 17 00:00:00 2001 From: Piet Heil Date: Thu, 7 Mar 2024 11:41:25 +0100 Subject: [PATCH] ngFor -> @For finished --- .../dialogs/conditions-dialog.component.html | 8 +- .../views-user/user-account.component.html | 16 ++-- .../app/views-user/user-device.component.html | 10 +- .../views-user/user-favorites.component.html | 72 ++++++++------- .../src/app/views-weather/city.component.html | 12 ++- .../language-select.component.html | 10 +- .../location-autocomplete.component.html | 34 +++---- .../weather-diagram.component.html | 92 +++++++++++-------- .../weather-video-bar.component.html | 42 +++++---- .../elements/forecast/forecast.component.html | 58 ++++++------ 10 files changed, 199 insertions(+), 155 deletions(-) diff --git a/web-angular/src/app/dialogs/conditions-dialog.component.html b/web-angular/src/app/dialogs/conditions-dialog.component.html index 8f1fa009..1a112958 100644 --- a/web-angular/src/app/dialogs/conditions-dialog.component.html +++ b/web-angular/src/app/dialogs/conditions-dialog.component.html @@ -10,9 +10,11 @@
- - - + @for(c of conditions; track $index){ + + + + }
diff --git a/web-angular/src/app/views-user/user-account.component.html b/web-angular/src/app/views-user/user-account.component.html index 5bd6881d..df58795a 100644 --- a/web-angular/src/app/views-user/user-account.component.html +++ b/web-angular/src/app/views-user/user-account.component.html @@ -22,11 +22,13 @@ {{ correspondence.address }} - - - {{ email.verified?"mail":"send" }}{{email.address}} - - + @for(email of emails; track $index){ + + + {{ email.verified?"mail":"send" }}{{email.address}} + + + } @@ -79,7 +81,8 @@

{{ res.strings('user_account_del_email_title') }}

{{ res.strings('user_account_del_email_subtitle') }}

- + @for (e of emails; track $index) { + @if(!e.correspondence){ @@ -89,6 +92,7 @@ } + } diff --git a/web-angular/src/app/views-user/user-device.component.html b/web-angular/src/app/views-user/user-device.component.html index 265043d3..259f89ca 100644 --- a/web-angular/src/app/views-user/user-device.component.html +++ b/web-angular/src/app/views-user/user-device.component.html @@ -96,10 +96,12 @@
-
-
-
{{ d.value }}
-
+ @for (d of data; track $index) { +
+
+
{{ d.value }}
+
+ }
diff --git a/web-angular/src/app/views-user/user-favorites.component.html b/web-angular/src/app/views-user/user-favorites.component.html index 3106f75b..07787677 100644 --- a/web-angular/src/app/views-user/user-favorites.component.html +++ b/web-angular/src/app/views-user/user-favorites.component.html @@ -6,42 +6,44 @@ @if(!loading){
- - - {{ location.type | locationIcon}} - {{ location.names | localName }} - @if(location.parent){ - - @if(location.parent.parent){ - {{ location.parent.names | localName:true }}, {{ location.parent.parent.names | localName:true }} - } - - } - - @if(getCondition(location) != null){ - - - -
-
-
-
-
{{ getCondition(location).type | weather }}
-
{{ getCondition(location).temperature | temperature }}
-
-
-
-
- @if(location.type != 'City'){ - - -
{{ res.strings('user_favorites_city_hint') }} {{ conditions.get(location).city.names | localName }}
-
-
+ @for(location of locations; let location = $index; track location) { + + + {{ location.type | locationIcon}} + {{ location.names | localName }} + @if(location.parent){ + + @if(location.parent.parent){ + {{ location.parent.names | localName:true }}, {{ location.parent.parent.names | localName:true }} + } + } -
- } -
+ + @if(getCondition(location) != null){ + + + +
+
+
+
+
{{ getCondition(location).type | weather }}
+
{{ getCondition(location).temperature | temperature }}
+
+
+
+
+ @if(location.type != 'CITY'){ + + +
{{ res.strings('user_favorites_city_hint') }} {{ conditions.get(location).city.names | localName }}
+
+
+ } +
+ } + + }
diff --git a/web-angular/src/app/views-weather/city.component.html b/web-angular/src/app/views-weather/city.component.html index 2088b1a1..5f415bb2 100644 --- a/web-angular/src/app/views-weather/city.component.html +++ b/web-angular/src/app/views-weather/city.component.html @@ -47,7 +47,9 @@
@if(dayForecasts | async; as daily){ - + @for (d of daily; track $index) { + + } }
@@ -61,7 +63,9 @@
@if(daytimeForecasts | async; as time){ - + @for (t of time; track $index) { + + } }
@@ -73,7 +77,9 @@
- + @for (c of f.conditions; track $index) { + + }
diff --git a/web-angular/src/app/widgets-common/language-select.component.html b/web-angular/src/app/widgets-common/language-select.component.html index a94792cd..99ee0fd4 100644 --- a/web-angular/src/app/widgets-common/language-select.component.html +++ b/web-angular/src/app/widgets-common/language-select.component.html @@ -2,10 +2,12 @@
- - - {{ lang.title }} - + @for (lang of languages; track $index) { + + + {{ lang.title }} + + }
diff --git a/web-angular/src/app/widgets-common/location-autocomplete.component.html b/web-angular/src/app/widgets-common/location-autocomplete.component.html index b8001379..24fc2795 100644 --- a/web-angular/src/app/widgets-common/location-autocomplete.component.html +++ b/web-angular/src/app/widgets-common/location-autocomplete.component.html @@ -1,20 +1,22 @@ - -
- {{ option.type | locationIcon }} -
-
{{ option.names | localName }}
-
- @if(option.parent){ - - {{ option.parent.names | localName:true }} - @if(opt.parent.parent){ - - } - - } + @for(option of locations; track i; let i = $index){ + +
+ {{ option.type | locationIcon }} +
+
{{ option.names | localName }}
+
+ @if(option.parent){ + + {{ option.parent.names | localName:true }} + @if(opt.parent.parent){ + + } + + } +
-
- + + } diff --git a/web-angular/src/app/widgets-weather/weather-diagram.component.html b/web-angular/src/app/widgets-weather/weather-diagram.component.html index d3e3c835..c7bbe958 100644 --- a/web-angular/src/app/widgets-weather/weather-diagram.component.html +++ b/web-angular/src/app/widgets-weather/weather-diagram.component.html @@ -1,45 +1,59 @@ - - - - @if(s.available){ - {{ pipes[j].transform(s.min + ((s.max - s.min) / (bars.length - 1) * (bars.length - 1 - i))) }} - } - - - - - @if(s.available){ - - - @if(j > 0){ - - - + @for (i of bars; track $index; let end = $last) { + + + + @for (s of settings; track j; let j = $index) { + + @if(s.available){ + {{ pipes[j].transform(s.min + ((s.max - s.min) / (bars.length - 1) * (bars.length - 1 - i))) }} } - - } - - - @if(s.available){ - - - + } + + } + + @for (s of settings; track i; let i = $index) { + + @if(s.available){ + + @for (v of values[i]; track j; let j = $index) { + + @if(j > 0){ + + + + } + + } - - } - - - - {{ t.label }} - - - + } + + } + @for (s of settings; track i; let i = $index) { + + @if(s.available){ + + @for (v of values[i]; track $index) { + + + + } + + } + + } + @for (t of ticks; track $index) { + + + {{ t.label }} + + + } diff --git a/web-angular/src/app/widgets-weather/weather-video-bar.component.html b/web-angular/src/app/widgets-weather/weather-video-bar.component.html index 7d9afc84..1bc88e07 100644 --- a/web-angular/src/app/widgets-weather/weather-video-bar.component.html +++ b/web-angular/src/app/widgets-weather/weather-video-bar.component.html @@ -7,12 +7,14 @@
- -
- -

{{ v.type | videoType }}

-
-
+ @for (v of cosmoEurope; track $index) { + +
+ +

{{ v.type | videoType }}

+
+
+ }
@@ -24,12 +26,14 @@
- -
- -

{{ v.type | videoType }}

-
-
+ @for (v of iconEurope; track $index) { + +
+ +

{{ v.type | videoType }}

+
+
+ }
@@ -41,12 +45,14 @@
- -
- -

{{ v.type | videoType }}

-
-
+ @for (v of iconGlobal; track $index) { + +
+ +

{{ v.type | videoType }}

+
+
+ }
diff --git a/web-angular/src/elements/forecast/forecast.component.html b/web-angular/src/elements/forecast/forecast.component.html index 5f4d7af1..1a959433 100644 --- a/web-angular/src/elements/forecast/forecast.component.html +++ b/web-angular/src/elements/forecast/forecast.component.html @@ -15,37 +15,41 @@
} - @if(forecast | async; as f){ + @if(forecast$ | async; as f){
- - @if(i < tileNoPerContainer){ - - - } - + @for (t of f; track i; let i = $index) { + + @if(i < tileNoPerContainer){ + + + } + + }
- - @if(i >= tileNoPerContainer){ - - - } - + @for (t of f; track i;let i = $index) { + + @if(i >= tileNoPerContainer){ + + + } + + }
}@else{