Skip to content

Commit fd51a3a

Browse files
committed
Merge branch 'master' into release
2 parents a553ea6 + 0641b72 commit fd51a3a

File tree

7 files changed

+35
-16
lines changed

7 files changed

+35
-16
lines changed

app/datastore/AgencyTx.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,14 @@ public LocalDate[] run(String id, ScheduleException ex) {
217217
});
218218

219219
tripCountByCalendar = getMap("tripCountByCalendar");
220-
Bind.histogram(trips, tripCountByCalendar, new Fun.Function2<String, String, Trip>() {
220+
BindUtils.multiHistogram(trips, tripCountByCalendar, new Fun.Function2<String[], String, Trip>() {
221221

222222
@Override
223-
public String run(String key, Trip trip) {
224-
// TODO Auto-generated method stub
225-
return trip.calendarId;
223+
public String[] run(String key, Trip trip) {
224+
if (trip.calendarId == null)
225+
return new String[] {};
226+
else
227+
return new String[] { trip.calendarId };
226228
}
227229
});
228230

app/models/transit/TripPattern.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public class TripPattern extends Model implements Cloneable, Serializable {
5353
// if true, use straight-line rather than shape-based distances
5454
public boolean useStraightLineDistances;
5555

56+
public boolean useFrequency;
57+
5658
public String routeId;
5759

5860
public String agencyId;

app/views/Admin/accounts.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
</script>
119119

120120
<script id="resetPassword" type="text/html">
121-
<form method="POST" id="resetPasswordForm" action="@{Admin.changePassword()}" class="form-horizontal">
121+
<form method="POST" id="resetPasswordForm" action="@{Admin.resetPassword()}" class="form-horizontal">
122122
<div class="control-group">
123123
<label class="control-label" for="username">Username</label>
124124
<div class="controls">
@@ -157,7 +157,7 @@ <h3>Account Management</h3>
157157
<td>#{if account.lastLogin}${account.lastLogin.format('yyyy-MM-dd hh:mm')}#{/if}#{else}--#{/else}</td>
158158
<td>#{if account.active}<i class="icon-ok"></i>#{/if}#{else}<i class="icon-remove"></i>#{/else}</td>
159159
<td>#{if account.admin}<i class="icon-ok"></i>#{/if}#{else}<i class="icon-remove"></i>#{/else}</td>
160-
<td>#{if account.agency}${account.agency.name}#{/if}</td>
160+
<td>#{if account.agencyId}${account.agencyId}#{/if}</td>
161161
<td><a href="#editAccountModal" onclick="editAccount('${account.username}');">Edit</a> <!-- | <a href="#resetPasswordModal" onclick="resetPassword('${account.username}');">Reset Password</a> --></td>
162162

163163
</tr>

app/views/Application/route.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ <h3 id="calendar-create-modal-label">&{'route.trip-info-tpl.calendar-create-moda
276276
<label class="control-label" for="tripPattern"><strong>&{'route.trip-info-tpl.trip-pattern'}</strong><br>(&{'shared.required'})</label>
277277
<div class="controls">
278278
<p>
279-
<select required name="pattern" id="tripPattern" class="input" title="&{'route.trip-info-tpl.trip-pattern'}" data-content="&{'route.trip-info-tpl.trip-pattern-content'}">
279+
<select required name="patternId" id="tripPattern" class="input" title="&{'route.trip-info-tpl.trip-pattern'}" data-content="&{'route.trip-info-tpl.trip-pattern-content'}">
280280
<option value="">-- &{'route.trip-pattern-select-pattern'} --</option>
281281

282282
{{#items}}<option value="{{attributes.id}}">{{attributes.name}}</option>{{/items}}
@@ -344,7 +344,7 @@ <h3 id="calendar-create-modal-label">&{'route.trip-info-tpl.calendar-create-moda
344344
<label class="control-label" for="trip"><strong>&{'route.trip-info-tpl.trip'}</strong><br>(&{'shared.required'})</label>
345345
<div class="controls">
346346
<p>
347-
<select required name="pattern" id="trip" class="input" title="&{'route.trip-info-tpl.trip'}" data-content="&{'route.trip-info-tpl.trip-content'}">
347+
<select required name="patternId" id="trip" class="input" title="&{'route.trip-info-tpl.trip'}" data-content="&{'route.trip-info-tpl.trip-content'}">
348348
<option value="">-- &{'route.trip-pattern-select-trip'} --</option>
349349

350350
{{#items}}<option value="{{attributes.id}}">{{attributes.tripDescription}}</option>{{/items}}

conf/application.conf.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ date.format=yyyy-MM-dd
117117
# db=mysql://user:pwd@host/database
118118
#
119119
# To connect to a local PostgreSQL9 database, use:
120-
db.url=jdbc:postgresql://127.0.0.1/gtfs-editor
121-
db.driver=org.postgresql.Driver
122-
db.user=postgres
120+
# db.url=jdbc:postgresql://127.0.0.1/gtfs-editor
121+
# db.driver=org.postgresql.Driver
122+
# db.user=postgres
123123
#
124124
# If you need a full JDBC configuration use the following :
125125
# db.url=jdbc:postgresql:database_name

conf/dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require:
1212
- org.geotools -> gt-geojson 12.2
1313
- com.fasterxml.jackson.core -> jackson-core 2.4.4
1414
- com.fasterxml.jackson.core -> jackson-databind 2.4.4
15-
- org.opentripplanner -> otp 1.0.0-SNAPSHOT
15+
- org.opentripplanner -> otp 0.14.0
1616
- net.sf.opencsv -> opencsv 2.0
1717
- org.mapdb -> mapdb 1.0.7
1818

public/javascripts/views/trip-info-view.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@ var GtfsEditor = GtfsEditor || {};
9292

9393
var data = G.Utils.serializeForm($(evt.target));
9494

95-
data.serviceCalendar = data.frequencyServiceCalendar;
95+
data.calendarId = data.frequencyServiceCalendar;
9696

9797
data = _.omit(data, ['file', 'scheduleType', 'frequencyServiceCalendar', 'timetableServiceCalendar']);
9898

99-
data.pattern = selectedPatternId;
99+
data.patternId = selectedPatternId;
100100
data.startTime = this.calcTime(data.startTimeString);
101101
data.endTime = this.calcTime(data.endTimeString);
102102
data.headway = this.calcTime(data.serviceFrequencyString);
103+
data.routeId = this.model.tripPatterns.get(selectedPatternId).get('routeId');
103104

104105
delete data.startTimeString;
105106
delete data.endTimeString;
@@ -198,10 +199,24 @@ var GtfsEditor = GtfsEditor || {};
198199

199200
var tripData = {
200201
useFrequency: true,
201-
pattern: selectedPatternId,
202+
patternId: selectedPatternId,
203+
agencyId: G.session.agencyId,
202204
tripDescription: this.$('[name=name]').val()
203205
};
204206

207+
var arrivalTime = 0, departureTime = 0;
208+
209+
tripData.stopTimes = _.map(this.model.tripPatterns.get(selectedPatternId).get('patternStops'), function (ps) {
210+
arrivalTime = departureTime + ps.defaultTravelTime;
211+
departureTime = arrivalTime + ps.defaultDwellTime;
212+
213+
return {
214+
stopId: ps.stopId,
215+
arrivalTime: arrivalTime,
216+
departureTime: departureTime
217+
};
218+
});
219+
205220
var view = this;
206221

207222
this.model.tripPatterns.get(selectedPatternId).trips.create(tripData, {
@@ -237,7 +252,7 @@ var GtfsEditor = GtfsEditor || {};
237252

238253
var tripData = {
239254
useFrequency: true,
240-
pattern: selectedPatternId,
255+
patternId: selectedPatternId,
241256
tripDescription: this.$('[name=name]').val(),
242257
serviceCalendar: serviceCalendarId,
243258
startTime: existingTrip.startTime,

0 commit comments

Comments
 (0)