Skip to content

Commit 025786c

Browse files
More fixes (ld+json fixes + enter bug on route planner)!
1 parent cdabf5b commit 025786c

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

app/controllers/StationController.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ public function specificTrain($station_id, $liveboard_id){
7979
$newData = \hyperRail\iRailFormatConverter::convertLiveboardData($data, $station_id);
8080
foreach ($newData['@graph'] as $graph){
8181
if (strpos($graph['@id'],$liveboard_id) !== false) {
82-
return $graph;
82+
$context = array(
83+
"delay" => "http://semweb.mmlab.be/ns/rplod/delay",
84+
"platform" => "http://semweb.mmlab.be/ns/rplod/platform",
85+
"scheduledDepartureTime" => "http://semweb.mmlab.be/ns/rplod/scheduledDepartureTime",
86+
"stop" => "http://semweb.mmlab.be/ns/rplod/stop",
87+
"headsign" => "http://vocab.org/transit/terms/headsign",
88+
"routeLabel" => "http://semweb.mmlab.be/ns/rplod/routeLabel",
89+
);
90+
return array("@context" => $context, "@graph" => $graph);
8391
}
8492
}
8593
return View::make('stations.expired');

app/hyperRail/Models/LiveboardItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function fill($stationId, $requestDate, $requestTime, $routeLabel, $headS
2323
$this->delay = $delay;
2424
$this->scheduledDepartureTime = $time;
2525
$this->platform = $platform;
26-
$this->destinationURL = "http://" . _DOMAIN_ . "/stations/NMBS/" . $stationId . "/departures/";
26+
$this->destinationURL = "http://" . _DOMAIN_ . "/stations/NMBS/" . $stationId;
2727
}
2828

2929
public function toArray(){

app/hyperRail/iRailFormatConverter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ public static function convertLiveboardData($json, $station_id, $format = "jsonl
3535
"delay" => "http://semweb.mmlab.be/ns/rplod/delay",
3636
"platform" => "http://semweb.mmlab.be/ns/rplod/platform",
3737
"scheduledDepartureTime" => "http://semweb.mmlab.be/ns/rplod/scheduledDepartureTime",
38-
"stop" => "http://semweb.mmlab.be/ns/rplod/stop",
3938
"headsign" => "http://vocab.org/transit/terms/headsign",
4039
"routeLabel" => "http://semweb.mmlab.be/ns/rplod/routeLabel",
40+
"stop" => array(
41+
"@id" => "http://semweb.mmlab.be/ns/rplod/stop",
42+
"@type" => "@id"
43+
),
4144
);
4245
return array("@context" => $context, "@graph" => $liveboardCollection);
4346
}

app/views/route/planner.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</select>
4444
<timepicker ng-model="mytime" ng-change="changed()" minute-step="15" show-meridian="ismeridian"></timepicker>
4545
<br/>
46-
<input type="submit" id="submit" class="btn btn-default btn-lg btn-primary btn-wide" ng-click="save()" value="{{Lang::get('client.confirmSearch')}}" ng-hide="departure == destination">
46+
<input type="submit" id="confirm" class="btn btn-default btn-lg btn-primary btn-wide" ng-click="save()" value="{{Lang::get('client.confirmSearch')}}" ng-hide="departure == destination">
4747
<div class="alert alert-danger" ng-show="data === null">
4848
<p ng-show="stationnotfound === true">{{Lang::get('client.errorCheckInput')}}</p>
4949
</div>

public/js/irailapp/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
$(document).keypress(function(e) {
3434
if(e.which == 13 && $scope.planning == true){
35-
$scope.confirmRouteSearch();
35+
$('#confirm').focus();
3636
}
3737
});
3838

0 commit comments

Comments
 (0)