From 25996d153ad5ec3d2e42854bdb3746e271d0a67a Mon Sep 17 00:00:00 2001 From: Michael Pritchard Date: Thu, 18 Apr 2013 23:26:22 +0100 Subject: [PATCH] #6 - support change of origin --- TrainDelayed/Scripts/viewmodels.js | 3 +++ TrainDelayed/search-results.cshtml | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/TrainDelayed/Scripts/viewmodels.js b/TrainDelayed/Scripts/viewmodels.js index 16a00ca..205be6c 100644 --- a/TrainDelayed/Scripts/viewmodels.js +++ b/TrainDelayed/Scripts/viewmodels.js @@ -16,6 +16,7 @@ function TrainViewModel(json, from, callingAt) { self.tocName = json.AtocCode ? json.AtocCode.Name : ""; self.from = json.Origin.Description.toLowerCase(); + self.newFrom = json.ChangeOfOrigin !== null ? json.ChangeOfOrigin.NewOrigin.Description.toLowerCase() : null; self.to = json.Destination.Description.toLowerCase(); self.fromStation = from.toLowerCase(); @@ -36,6 +37,8 @@ function TrainViewModel(json, from, callingAt) { self.cancelled = json.Cancellation !== null; + self.changeOfOrigin = json.ChangeOfOrigin !== null; + self.title = json.Cancellation ? "Cancelled " + json.Cancellation.Type + (json.Cancellation.CancelledAt ? " at " + json.Cancellation.CancelledAt.Description : "") : ""; } \ No newline at end of file diff --git a/TrainDelayed/search-results.cshtml b/TrainDelayed/search-results.cshtml index 6162fe2..74dd00d 100644 --- a/TrainDelayed/search-results.cshtml +++ b/TrainDelayed/search-results.cshtml @@ -77,7 +77,7 @@ - + @{ if (string.IsNullOrEmpty(@ConfigurationManager.AppSettings["trainLink"])) { @@ -89,7 +89,16 @@ } } - + + + +
+ Starts from + + + + +