diff --git a/config-example.yml b/config-example.yml index 73f6977..c8b0e5a 100644 --- a/config-example.yml +++ b/config-example.yml @@ -55,7 +55,7 @@ spot-providers: - class: "DXCluster" name: "W3LPL Cluster" - enabled: true + enabled: false host: "w3lpl.net" port: 7373 login_prompt: "Please enter your call: " diff --git a/core/utils.py b/core/utils.py index 482ff38..f4a1e5c 100644 --- a/core/utils.py +++ b/core/utils.py @@ -179,7 +179,6 @@ def get_qrzcq_data_for_callsign(call): # Iterate in reverse order - see comments on the data structure itself for entry in reversed(QRZCQ_CALLSIGN_LOOKUP_DATA): if call.startswith(entry["prefix"]): - print(call + " " + str(entry)) return entry return None diff --git a/views/webpage_alerts.tpl b/views/webpage_alerts.tpl index 8b11787..54e41e7 100644 --- a/views/webpage_alerts.tpl +++ b/views/webpage_alerts.tpl @@ -7,7 +7,8 @@

- + +

@@ -16,10 +17,10 @@
- filters + Filters
- +
@@ -29,23 +30,93 @@
+
+
+
+
+ Display +
+
+ +
+
+ +
+
+
+
+
+
+
Time Zone
+

Use + +

+
+
+
+
+
+
+
Number of Alerts
+

Show up to + + alerts +

+
+
+
+
+
+
+
Table Data
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+
-

- - - - - Alerts to view: - - -

diff --git a/views/webpage_spots.tpl b/views/webpage_spots.tpl index 9b0357d..132b3dc 100644 --- a/views/webpage_spots.tpl +++ b/views/webpage_spots.tpl @@ -22,7 +22,8 @@

- + +

@@ -31,10 +32,10 @@
- filters + Filters
- +
@@ -45,22 +46,111 @@
+
+
+
+
+ Display +
+
+ +
+
+ +
+
+
+
+
+
+
Time Zone
+

Use + +

+
+
+
+
+
+
+
Number of Spots
+

Show up to + + spots +

+
+
+
+
+
+
+
Table Data
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+
+
+
+
Location
+
+ + +
+
+
+
+
+
+
+
-

- - - - - Spots to view: - - -

diff --git a/webassets/css/style.css b/webassets/css/style.css index 26504d7..89d5f00 100644 --- a/webassets/css/style.css +++ b/webassets/css/style.css @@ -47,7 +47,7 @@ div.appearing-panel { display: none; } -p.filter-card-text { +.spothole-card-text { line-height: 2.5em !important; } diff --git a/webassets/js/alerts.js b/webassets/js/alerts.js index 4e001c2..256c739 100644 --- a/webassets/js/alerts.js +++ b/webassets/js/alerts.js @@ -39,7 +39,7 @@ function buildQueryString() { // Update the alerts table function updateTable() { // Use local time instead of UTC? - var useLocalTime = $("#useLocalTime")[0].checked; + var useLocalTime = $("#timeZone")[0].value == "local"; // Populate table with headers let table = $('').append(''); @@ -89,7 +89,7 @@ function addAlertRowsToTable(tbody, alerts) { let $tr = $(''); // Use local time instead of UTC? - var useLocalTime = $("#useLocalTime")[0].checked; + var useLocalTime = $("#timeZone")[0].value == "local"; // Get times for the alert, and convert to local time if necessary. var start_time_unix = moment.unix(a["start_time"]); @@ -226,7 +226,7 @@ function generateMaxDurationDropdownFilterCard(band_options) { let $card = $("
"); let $card_body = $("
"); $card_body.append(`
Duration Limit
`); - $p = $("

"); + $p = $("

"); $p.append("Hide any alerts lasting more than:
"); $p.append(``); - $p2 = $("

"); + $p2 = $("

"); $p2.append(``); // Compile HTML elements to return $card_body.append($p); @@ -252,15 +252,32 @@ function filtersUpdated() { loadAlerts(); saveSettings(); } -// Set up UI element event listeners, after the document is ready -function setUpEventListeners() { - $("#filters-button").click(function() { - $("#filters-area").toggle(); - }); - $("#close-filters-button").click(function() { - $("#filters-button").button("toggle"); + +// React to toggling/closing panels +function toggleFiltersPanel() { + // If we are going to display the filters panel, hide the display panel + if (!$("#filters-area").is(":visible") && $("#display-area").is(":visible")) { + $("#display-area").hide(); + $("#display-button").button("toggle"); + } + $("#filters-area").toggle(); +} +function closeFiltersPanel() { + $("#filters-button").button("toggle"); + $("#filters-area").hide(); +} + +function toggleDisplayPanel() { + // If we are going to display status, load the data for the status panel, and hide the filters panel + if (!$("#display-area").is(":visible") && $("#filters-area").is(":visible")) { $("#filters-area").hide(); - }); + $("#filters-button").button("toggle"); + } + $("#display-area").toggle(); +} +function closeDisplayPanel() { + $("#display-button").button("toggle"); + $("#display-area").hide(); } // Startup @@ -269,6 +286,4 @@ $(document).ready(function() { loadOptions(); // Update the refresh timing display every second setInterval(updateRefreshDisplay, 1000); - // Set up event listeners - setUpEventListeners(); }); \ No newline at end of file diff --git a/webassets/js/common.js b/webassets/js/common.js index 288abde..513ede4 100644 --- a/webassets/js/common.js +++ b/webassets/js/common.js @@ -34,7 +34,7 @@ function generateMultiToggleFilterCard(displayName, filterQuery, options) { let $card = $("

"); let $card_body = $("
"); $card_body.append(`
${displayName}
`); - $p = $("

"); + $p = $("

"); // Create a button for each option options.forEach(o => { $p.append(` `); @@ -98,7 +98,7 @@ function escapeHtml(str) { } // When the "use local time" field is changed, reload the table and save settings -function localTimeUpdated() { +function timeZoneUpdated() { updateTable(); saveSettings(); } @@ -108,10 +108,13 @@ function saveSettings() { // Find all storeable UI elements, store a key of "element id:property name" mapped to the value of that // property. For a checkbox, that's the "checked" property. $(".storeable-checkbox").each(function() { - localStorage.setItem("#" + $(this)[0].id + ":checked", $(this)[0].checked); + localStorage.setItem("#" + $(this)[0].id + ":checked", JSON.stringify($(this)[0].checked)); }); $(".storeable-select").each(function() { - localStorage.setItem("#" + $(this)[0].id + ":value", $(this)[0].value); + localStorage.setItem("#" + $(this)[0].id + ":value", JSON.stringify($(this)[0].value)); + }); + $(".storeable-text").each(function() { + localStorage.setItem("#" + $(this)[0].id + ":value", JSON.stringify($(this)[0].value)); }); } diff --git a/webassets/js/spots.js b/webassets/js/spots.js index 7793263..623cf81 100644 --- a/webassets/js/spots.js +++ b/webassets/js/spots.js @@ -32,7 +32,7 @@ function buildQueryString() { // Update the spots table function updateTable() { // Use local time instead of UTC? - var useLocalTime = $("#useLocalTime")[0].checked; + var useLocalTime = $("#timeZone")[0].value == "local"; // Populate table with headers let table = $('

').append(''); @@ -211,7 +211,7 @@ function generateBandsMultiToggleFilterCard(band_options) { let $card = $("
"); let $card_body = $("
"); $card_body.append(`
Bands
`); - $p = $("

"); + $p = $("

"); // Create a button for each option band_options.forEach(o => { // CSS doesn't like IDs with decimal points in, so we need to replace that in the same way as when we originally @@ -234,15 +234,31 @@ function filtersUpdated() { saveSettings(); } -// Set up UI element event listeners, after the document is ready -function setUpEventListeners() { - $("#filters-button").click(function() { - $("#filters-area").toggle(); - }); - $("#close-filters-button").click(function() { - $("#filters-button").button("toggle"); +// React to toggling/closing panels +function toggleFiltersPanel() { + // If we are going to display the filters panel, hide the display panel + if (!$("#filters-area").is(":visible") && $("#display-area").is(":visible")) { + $("#display-area").hide(); + $("#display-button").button("toggle"); + } + $("#filters-area").toggle(); +} +function closeFiltersPanel() { + $("#filters-button").button("toggle"); + $("#filters-area").hide(); +} + +function toggleDisplayPanel() { + // If we are going to display status, load the data for the status panel, and hide the filters panel + if (!$("#display-area").is(":visible") && $("#filters-area").is(":visible")) { $("#filters-area").hide(); - }); + $("#filters-button").button("toggle"); + } + $("#display-area").toggle(); +} +function closeDisplayPanel() { + $("#display-button").button("toggle"); + $("#display-area").hide(); } // Display the intro box, unless the user has already dismissed it once. @@ -261,8 +277,6 @@ $(document).ready(function() { loadOptions(); // Update the refresh timing display every second setInterval(updateRefreshDisplay, 1000); - // Set up event listeners - setUpEventListeners(); // Display intro box displayIntroBox(); }); \ No newline at end of file