Skip to content
6 changes: 3 additions & 3 deletions src/plugins/weather/render/weather.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<div class="weather-dashboard">
{% if plugin_settings.displayRefreshTime == "true" %}
<div class="last-refresh">Last refresh: {{ last_refresh_time }}</div>
<div class="last-refresh">{{ last_refresh_label }}: {{ last_refresh_time }}</div>
{% endif %}
<!-- Current Date -->
<div class="header">
Expand All @@ -21,7 +21,7 @@
<img class="current-icon" src="{{current_day_icon}}" alt="Current Weather Icon">
<div class="current-weather">
<div class="current-temp">{{ current_temperature }}<span class="temperature-unit">{{temperature_unit}}</span></div>
<div class="feels-like">Feels Like {{ feels_like }}{% if units != "standard" %}°{% endif %}</div>
<div class="feels-like">{{ feels_like_label }} {{ feels_like }}{% if units != "standard" %}°{% endif %}</div>
<div class="min-max">{{ forecast[0].high }}{% if units != "standard" %}°{% endif %} / {{ forecast[0].low }}{% if units != "standard" %}°{% endif %}</div>
</div>
</div>
Expand All @@ -38,7 +38,7 @@
<div class="data-point-label">{{ dp.label }}</div>
<div class="data-point-measurement">
{{ dp.measurement }}{% if dp.unit %}<span class="data-point-unit">{{ dp.unit }}</span>{% endif %}
{% if dp.label == "Wind" %}
{% if dp.key == "Wind" %}
<span class="wind-arrow-symbol">{{ dp.arrow }}</span>
{% endif %}
</div>
Expand Down
21 changes: 21 additions & 0 deletions src/plugins/weather/settings.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" />
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>

<div class="form-group">
<label for="language" class="form-label">Language:</label>
<select id="language" name="language" class="form-input">
<option value="nl">Dutch</option>
<option value="en">English</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="id">Indonesian</option>
<option value="it">Italian</option>
<option value="pt">Portuguese</option>
<option value="es">Spanish</option>
</select>
</div>

<div class="form-group">
<label class="form-label">Location: </label>
<div class="form-group">
Expand Down Expand Up @@ -200,6 +214,12 @@ <h2 id="modalTitle">Select Location</h2>
});

if (loadPluginSettings) {
const language = document.getElementById('language');
const hasConfiguredLanguage = Array.from(language.options).some(
(option) => option.value === pluginSettings.language
);
language.value = hasConfiguredLanguage ? pluginSettings.language : 'en';

document.getElementById('latitude').value = pluginSettings.latitude;
document.getElementById('longitude').value = pluginSettings.longitude;

Expand Down Expand Up @@ -236,6 +256,7 @@ <h2 id="modalTitle">Select Location</h2>
document.getElementById('customTitle').value = pluginSettings.customTitle || '';
} else {
// set default values
document.getElementById('language').value = 'en';
document.getElementById('units').value = "imperial";
document.getElementById('displayRefreshTime').checked = true;
document.getElementById('displayRefreshTime').value = "true";
Expand Down
Loading