Browse Source

Add "Result" line to map marker info window

Alan Lam 2 years ago
parent
commit
a705059865
3 changed files with 8 additions and 0 deletions
  1. 1 0
      engine/helpers/location_helper.php
  2. 3 0
      public/js/app-locations.js
  3. 4 0
      public/js/app-map-overview.js

+ 1 - 0
engine/helpers/location_helper.php

@@ -193,6 +193,7 @@ class LocationHelper {
 					"tester" => null,
 					"pastDue" => $past_due,
 					"passed" => $test->isPass(),
+					"resultText" => $test->getPassText(),
 				];
 
 				if($tester) {

+ 3 - 0
public/js/app-locations.js

@@ -206,6 +206,9 @@ function displayInfoWindow(marker) {
 		if(location.test.formattedDueDts) {
 			lines.push({title: "Due", text: location.test.formattedDueDts});
 		}
+		if(location.test) {
+			lines.push({title: "Result", text: location.test.resultText});
+		}
 	}
 
 	let linesHtml = "";

+ 4 - 0
public/js/app-map-overview.js

@@ -370,6 +370,10 @@ function addMarkerClickListenerForLocation(marker, location) {
 				content += '<div class="small"><strong>Due:</strong> ' + location.test.formattedDueDts + ' ' + pastDueBadge + '</div>';
 			}
 
+			if(location.test) {
+				content += '<div class="small"><strong>Result:</strong> ' + location.test.resultText + '</div>';
+			}
+
 		}
 
 		if(typeof location.testCount !== "undefined") {