mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-25 00:34:32 +00:00
Allow spots and alerts to have multiple activities #143
This commit is contained in:
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user