Add per-sport location settings and clarify recovery groups
This commit is contained in:
+11
-1
@@ -763,11 +763,16 @@
|
||||
const syncPreview = row => {
|
||||
const labelInput = row.querySelector('input[data-name-template$="[label]"]');
|
||||
const iconSelect = row.querySelector('select[data-name-template$="[icon]"]');
|
||||
const locationSelect = row.querySelector('select[data-name-template$="[location]"]');
|
||||
const previewText = row.querySelector(".sport-pill span:last-child");
|
||||
const previewImage = row.querySelector(".sport-pill img");
|
||||
|
||||
if (previewText) {
|
||||
previewText.textContent = (labelInput && labelInput.value.trim()) || "Neue Sportart";
|
||||
const label = (labelInput && labelInput.value.trim()) || "Neue Sportart";
|
||||
const location = locationSelect && locationSelect.value
|
||||
? locationSelect.options[locationSelect.selectedIndex]?.textContent || ""
|
||||
: "";
|
||||
previewText.textContent = location ? `${label} · ${location}` : label;
|
||||
}
|
||||
|
||||
if (previewImage && iconSelect) {
|
||||
@@ -808,6 +813,7 @@
|
||||
const idInput = row.querySelector('input[data-name-template$="[id]"]');
|
||||
const labelInput = row.querySelector('input[data-name-template$="[label]"]');
|
||||
const iconSelect = row.querySelector('select[data-name-template$="[icon]"]');
|
||||
const locationSelect = row.querySelector('select[data-name-template$="[location]"]');
|
||||
const groupInput = row.querySelector('input[data-name-template$="[recovery_group]"]');
|
||||
const bonusInput = row.querySelector('input[data-name-template$="[bonus_points]"]');
|
||||
const consecutiveInput = row.querySelector('input[data-name-template$="[allow_consecutive]"]');
|
||||
@@ -821,6 +827,9 @@
|
||||
if (iconSelect) {
|
||||
iconSelect.value = values.icon || "run";
|
||||
}
|
||||
if (locationSelect) {
|
||||
locationSelect.value = values.location || "";
|
||||
}
|
||||
if (groupInput) {
|
||||
groupInput.value = values.recovery_group || "";
|
||||
}
|
||||
@@ -845,6 +854,7 @@
|
||||
id: button.dataset.id || "",
|
||||
label: button.dataset.label || "",
|
||||
icon: button.dataset.icon || "run",
|
||||
location: button.dataset.location || "",
|
||||
recovery_group: button.dataset.recoveryGroup || "",
|
||||
bonus_points: button.dataset.bonusPoints || "2",
|
||||
allow_consecutive: button.dataset.allowConsecutive === "1",
|
||||
|
||||
Reference in New Issue
Block a user