Allow spots and alerts to have multiple activities #143

This commit is contained in:
Ian Renton
2026-09-24 22:57:46 +01:00
parent 81166dccab
commit 4477942bec
34 changed files with 217 additions and 157 deletions
+1 -1
View File
@@ -208,7 +208,7 @@ function addSpot() {
spot["dx_call"] = dx;
spot["freq"] = parseFloat(freqStr) * 1000;
if (mode !== "") spot["mode"] = mode;
if (activity !== "") spot["activity"] = activity;
if (activity !== "") spot["activities"] = [activity];
if (activityRef !== "") spot["activity_refs"] = [{activity: activity, id: activityRef}];
if (dxGrid !== "") spot["dx_grid"] = dxGrid;
if (comment !== "") spot["comment"] = comment;
+4 -4
View File
@@ -210,14 +210,14 @@ function addAlertRowsToTable(tbody, alerts) {
if (a["dx_calls"] != null) {
dx_calls_html = a["dx_calls"].map(call => `<a class='dx-link' href='https://qrz.com/db/${call}' target='_new'>${call}</a>`).join(", ");
}
if (dx_calls_html === "" && a["activity"] === "Contest") {
if (dx_calls_html === "" && a["activities"] != null && a["activities"].includes("Contest")) {
// Contest = true and no DX callsigns, so display "Contest"
dx_calls_html = "Contest"
}
// Format DXpedition country
let dx_country_html = "";
if (a["activity"] === "DXpedition" && a["dx_country"] != null && a["dx_country"] !== "") {
if (a["activities"] != null && a["activities"].includes("DXpedition") && a["dx_country"] != null && a["dx_country"] !== "") {
dx_country_html = `<br/>${a["dx_country"]}`;
}
@@ -252,8 +252,8 @@ function addAlertRowsToTable(tbody, alerts) {
// Activity or fallback to "General DX"
let activityText = "General DX";
if (a["activity"]) {
activityText = a["activity"];
if (a["activities"] != null && a["activities"].length > 0) {
activityText = a["activities"].join(", ");
}
// Format activity refs
+2 -2
View File
@@ -276,8 +276,8 @@ function getTooltipText(s) {
// Activity or fallback to source
let activitySourceText = s["source"];
if (s["activity"]) {
activitySourceText = s["activity"];
if (s["activities"] != null && s["activities"].length > 0) {
activitySourceText = s["activities"].join(", ");
}
// Format activity refs
+2 -2
View File
@@ -329,8 +329,8 @@ function createNewTableRowsForSpot(s, highlightNew) {
// Format activity
let activityText = "General DX";
if (s["activity"]) {
activityText = s["activity"];
if (s["activities"] != null && s["activities"].length > 0) {
activityText = s["activities"].join(", ");
}
// Format activity refs