diff --git a/UpNext.md b/UpNext.md index 0c0c9ba..d9db93c 100644 --- a/UpNext.md +++ b/UpNext.md @@ -3,13 +3,15 @@ ## Frontend: * Implement error pages. -* Still need SVG Fallback option for alert icon on board.html * Alerts box should not be clickable, bar should be. * Issue page: Submit using API. -* UNDER TEST:: Support multiple service origins/destinations: - - Where there are multiples an array is returned for trainServices.service * Enable text search for `locationName` on find-code page. + +### Completed - Testing: + * Implement calling list. +* Still need SVG Fallback for alert icon. +* Support multiple origins/destinations: NOT INCLUDING ON CALLING LIST ## Backend: diff --git a/static/board.html b/static/board.html index ebbe8b9..f7ed4d6 100644 --- a/static/board.html +++ b/static/board.html @@ -36,7 +36,10 @@
- + + + +

@@ -113,7 +116,7 @@ - Home + Home
diff --git a/static/images/nav/alert_icon-50.png b/static/images/nav/alert_icon-50.png new file mode 100644 index 0000000..fac429e Binary files /dev/null and b/static/images/nav/alert_icon-50.png differ diff --git a/static/js/boards.js b/static/js/boards.js index f4753c8..9a88b64 100644 --- a/static/js/boards.js +++ b/static/js/boards.js @@ -79,29 +79,42 @@ async function parseName(location) { // Build calling list: async function buildCallLists(data) { - console.log(JSON.stringify(data)) - if (data.previousCallingPoints.callingPointList.callingPoint) { - var preCallPoint = data.previousCallingPoints.callingPointList.callingPoint; + try { + if (data.previousCallingPoints.callingPointList.callingPoint) { + var preCallPoint = data.previousCallingPoints.callingPointList.callingPoint; + } + } catch (err) { + console.log(`Data not found error, ${err}`) } - if (data.subsequentCallingPoints.callingPointList.callingPoint) { - var postCallPoint = data.subsequentCallingPoints.callingPointList.callingPoint; + try { + if (data.subsequentCallingPoints.callingPointList.callingPoint) { + var postCallPoint = data.subsequentCallingPoints.callingPointList.callingPoint; + } + } catch (err) { + console.log(`Data not found error, ${err}`) } var procPre = ""; var procPost = ""; - if (preCallPoint) { - for(var i = 0; i < preCallPoint.length; i++) { - var proc = await buildCalls(preCallPoint[i]); - procPre = `${procPre}\n${proc}` + try { + if (preCallPoint) { + for(var i = 0; i < preCallPoint.length; i++) { + var proc = await buildPastCalls(preCallPoint[i]); + procPre = `${procPre}\n${proc}` + } } + } catch (err) { + console.log(`Error reading previous stops. ${err}`) } - if (postCallPoint) { - for (var i = 0; i < postCallPoint.length; i++) { - var proc = await buildCalls(postCallPoint[i]); - procPost = `${procPost}\n${proc}` + try { + if (postCallPoint) { + for (var i = 0; i < postCallPoint.length; i++) { + var proc = await buildCalls(postCallPoint[i]); + procPost = `${procPost}\n${proc}` + } } + } catch (err) { + console.log(`Error reading next stops. ${err}`) } - console.log(JSON.stringify(procPre)) - console.log(JSON.stringify(procPost)) var div = `

X

@@ -176,8 +189,17 @@ async function deflateAlerts() { async function buildCalls(data) { var timeEt = await parseTime(data.et) return ` - ${data.locationName} - ${data.st} - ${timeEt.data} + ${data.locationName} + ${data.st} + ${timeEt.data} + ` +} + +async function buildPastCalls(data) { + var timeEt = await parseTime(data.at) + return ` + ${data.locationName} + ${data.st} + ${timeEt.data} ` } \ No newline at end of file diff --git a/static/js/public-board.js b/static/js/public-board.js index ae02089..3ea57e5 100644 --- a/static/js/public-board.js +++ b/static/js/public-board.js @@ -99,6 +99,7 @@ async function displayTrains(data) { } clearLoading(); + document.getElementById("output").style = "display:block;"; log(`Insertion complete`) } @@ -113,6 +114,7 @@ async function displayBus(busSvc) { log(JSON.stringify(busSvc)) for(var i = 0; i < busSvc.service.length; i++) { displayBusService(busSvc.service[i]) + buildCallLists(busSvc.service[i]) } } @@ -131,8 +133,8 @@ async function displayService(svc) { var row = ` - - + + @@ -172,8 +174,8 @@ async function displayFerryService(svc) { var row = `
${svc.origin.location.locationName}${svc.destination.location.locationName}${await parseName(svc.origin.location)}${await parseName(svc.destination.location)} ${plt.num} ${sta.data} ${eta.data}
- - + + diff --git a/static/styles/boards.css b/static/styles/boards.css index 6c793e8..039389a 100644 --- a/static/styles/boards.css +++ b/static/styles/boards.css @@ -137,6 +137,7 @@ /* Content */ #output { + display: none; width: 100%; margin-top: 65px; } @@ -173,18 +174,20 @@ caption{ .name-item { color: var(--board-name-color); + font-size: 12px; } .plat{ width: 4%; + font-size: 12px; text-align: center; } .time{ width: 11.5%; + font-size: 12px; text-align: center; } - .msg{ width: 95%; font-size: 10px; @@ -199,7 +202,8 @@ caption{ display: none; border-radius: 20px; width: 93%; - position: absolute; + max-height: 75%; + position: fixed; z-index: 10; top: 50px; left: 0; @@ -210,6 +214,7 @@ caption{ padding-bottom: 10px; margin-bottom: 25px; background-color: var(--overlay-color); + overflow: scroll; } .close-data { @@ -219,6 +224,10 @@ caption{ font-weight: 900; } +.detail-table-content { + font-size: 12px; +} + .changed{ animation: pulse-change 1.5s linear infinite; }
${parseName(svc.origin.location.locationName)}${parseName(svc.destination.location.locationName)}${await parseName(svc.origin.location)}${await parseName(svc.destination.location)} ${plt} ${sta.data} ${eta.data}