Skip to content

Commit

Permalink
Merge branch 'release/2.6.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
tmahtab committed Mar 17, 2021
2 parents 44296ce + f0bb02e commit eff085c
Show file tree
Hide file tree
Showing 9 changed files with 1,832 additions and 1,449 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
Applymyride
================

although the app doesn't use ruby, build process requires haml rubygem installed. (works with ruby version 2.2.2)
The app doesn't use ruby directly, but the build process requires the haml rubygem be installed as haml is used to create the html views. (This should work with ruby version > 2.1 and < 3.0, but see below* if < 2.5)

You may need to install node.js first.
You may need to install node.js first (e.g. `brew install node` on Mac, the latest version should run correctly now).

+ sudo gem install haml
+ `sudo gem install haml -v '~> 4.0'` (haml 5 will not work)

+ sudo gem install compass
+ `sudo gem install compass`

+ npm install
+ `npm install`

+ sudo npm install -g grunt
+ `sudo npm install -g grunt`

+ sudo npm install -g bower
+ `sudo npm install -g bower`

+ bower install
+ `bower install`

+ grunt serve (to test if it's working)
+ `grunt serve` (to test if it's working)

\* If your ruby version is < 2.5, you'll need to first install libssl 1.0: `brew install rbenv/tap/[email protected]`, then you'll need to install your version of ruby with the correct command depending on whether you use rbenv or rvm:
+ ``rvm install 2.3.8 -C --with-openssl-dir=`brew --prefix [email protected]\` ``
+ RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])" rbenv install 2.3.8

Deploy
================
Expand Down
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</script>
</head>
<body ng-app="applyMyRideApp" ng-controller="NavbarController">
<div style="position:absolute; bottom:1px;" ng-hide="true">v2.6.6</div>
<div style="position:absolute; bottom:1px;" ng-hide="true">v2.6.7</div>

<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
Expand Down
24 changes: 20 additions & 4 deletions app/scripts/controllers/paratransit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,37 @@ angular.module('applyMyRideApp')
$scope.prepareTrip = function(){

angular.forEach(planService.paratransitItineraries, function(result, index) {
result.wait_startDesc = moment(result.wait_start).format('h:mm a');
result.wait_endDesc = moment(result.wait_end).format('h:mm a');
result.arrivalDesc = moment(result.arrival).format('h:mm a');
planService.setItineraryDescriptions(result);
});

angular.forEach(planService.booking_results, function(result, index) {
result.wait_startDesc = moment(result.wait_start).format('h:mm a');
result.wait_endDesc = moment(result.wait_end).format('h:mm a');
// don't assume wait window is 30 minutes, get diff
var d1 = new Date(result.wait_end);
var d2 = new Date(result.wait_start);

result.arrivalDesc = moment(result.arrival).format('h:mm a');
result.travelTime = humanizeDuration(result.negotiated_duration * 1000, { units: ["hours", "minutes"], round: true });
if (result.negotiated_duration)
result.travelTime = humanizeDuration(result.negotiated_duration * 1000, { units: ["hours", "minutes"], round: true });
else {
var itinDuration = null;
var itin_id = result.itinerary_id;
angular.forEach(planService.paratransitItineraries, function (itinerary, index) {
if (itinerary.id === itin_id)
itinDuration = itinerary.duration;
});
result.travelTime = humanizeDuration(itinDuration * 1000, { units: ["hours", "minutes"], round: true });
var arrival = new Date(d1.getTime() + ((d2 - d1) / 2) + (itinDuration * 1000));
result.arrivalDesc = moment(arrival).format('h:mm a');
}
if(!result.booked == true){
$scope.booking_failed = true;
}
});



$scope.purpose = planService.itineraryRequestObject.trip_purpose;

$scope.tripCancelled = !planService.booking_results[0].booked;
Expand Down
1 change: 1 addition & 0 deletions app/scripts/services/plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ angular.module('applyMyRideApp')
itinerary.dayAndDateDesc = moment(startTime).format('dddd, MMMM Do');
itinerary.startTimeDesc = moment(itinerary.wait_start || itinerary.departure).format('h:mm a');
itinerary.endTimeDesc = itinerary.arrival ? moment(itinerary.arrival).format('h:mm a') : "Arrive";
itinerary.arrivalDesc = itinerary.arrival ? itinerary.endTimeDesc : moment(itinerary.end_time).format('h:mm a');
itinerary.distanceDesc = this.getDistanceDescription(itinerary.distance);
itinerary.walkDistanceDesc = this.getDistanceDescription(itinerary.walk_distance);
}
Expand Down
5 changes: 5 additions & 0 deletions app/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ $kioskfonts: "Avenir Next", "Helvetica Neue", Helvetica, sans-serif;
.spinner{margin-top: 10em;}
.angular-google-map-container { height: 400px; }


.map-canvas > div {
position:absolute !important;
}

@media(min-width:$screen-md-min) {
.bus_options{
margin-left: 5em;
Expand Down
11 changes: 2 additions & 9 deletions app/views/paratransit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,9 @@
.row
.leg-info.col-xs-12
%h5.text-muted WAIT for Shared Ride
.row{ng: {show: '$index == 0'}}
.row
.leg-info.col-xs-12
%h4.text-muted {{itinerary.start_location.name}}
.row{ng: {show: '$index == 1'}}
.leg-info.col-xs-12
%h4.text-muted {{itinerary.end_location.name}}
.border-between.timeline.mode_paratransit
.row.even-height-row
.col-xs-2.right-side.no-padding
Expand All @@ -117,13 +114,9 @@
.row
.leg-info.col-xs-12.leg-header
%h5.text-muted ARRIVE
.row{ng: {show: '$index == 0'}}
.row
.leg-info.col-xs-12
%h4.text-muted {{itinerary.end_location.name}}
.row{ng: {show: '$index == 1'}}
.leg-info.col-xs-12
%h4.text-muted {{itinerary.start_location.name}}
%div{style: 'margin-top: 1em', ng: {show: 'showEmail'}}
.row
.col-xs-12.col-sm-8.col-sm-offset-2.text-left
Expand Down
2 changes: 1 addition & 1 deletion app/views/plan-transit-details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@
%a.btn{href:'', back:'', ng:{click: 'back()'}}
Back
.pull-right
%a.btn.btn-primary{href: "", ng: {show:'loggedIn', click: "saveBusTrip()"}}
%a.btn.btn-primary{href: "", ng: {show:'loggedIn && false', click: "saveBusTrip()"}}
Save this transit trip

Loading

0 comments on commit eff085c

Please sign in to comment.