Skip to content

Commit

Permalink
highlight invalid trips.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwigway committed Nov 3, 2014
1 parent 26be34d commit 03ae801
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions public/javascripts/views/trip-pattern-schedule-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ var GtfsEditor = GtfsEditor || {};
defaults: {
stopTime: null,
// is this the arrival time cell, or the departure time cell?
arr: null
arr: null,
trip: null
},
toString: function() {
var st = this.get('stopTime');
Expand Down Expand Up @@ -53,10 +54,11 @@ var GtfsEditor = GtfsEditor || {};

// TODO: template
text =
'<div class="time ' + (arr ? 'time-arr' : 'time-dep') +
'<div class="time ' + (arr ? 'time-arr ' : 'time-dep ') +
// dim departure times that are the same as their arrival times
// TODO: only in two-time mode
(!arr && st.departureTime == st.arrivalTime ? 'time-dep-dimmed' : '') + '">' +
(!arr && st.departureTime == st.arrivalTime ? 'time-dep-dimmed ' : '') +
(value.get('trip').get('invalid') === true ? 'trip-invalid' : '') + '">' +
'<span class="hours">' + hours + '</span>' +
'<span class="minutes">' + (mins < 10 ? '0' + mins : mins) + '</span>' +
'<span class="seconds">' + (secs < 10 ? '0' + secs : secs) + '</span>' +
Expand Down Expand Up @@ -245,7 +247,8 @@ var GtfsEditor = GtfsEditor || {};
if (_.isUndefined(val)) {
return new StopTimeCell({
arr: arr,
stopTime: st
stopTime: st,
trip: trip
});
} else {
if (st == null) {
Expand Down
1 change: 1 addition & 0 deletions public/stylesheets/timetable.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
.handsontable .time-arr { color: #050 }
.handsontable .time-dep { color: #005 }
.handsontable .time-dep-dimmed { color: #aaa }
.handsontable .trip-invalid { background-color: #fdd }

0 comments on commit 03ae801

Please sign in to comment.