Skip to content

Commit

Permalink
Merge branch 'release/3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
flibbertigibbet committed Mar 25, 2020
2 parents d96095c + aaea06f commit 38f8fb2
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 14 deletions.
2 changes: 1 addition & 1 deletion python/cac_tripplanner/deployment_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
boto==2.49.0
PyYAML==5.3
PyYAML==5.3.1
majorkirby==1.0.0
requests==2.23.0
troposphere==2.6.0
8 changes: 4 additions & 4 deletions python/cac_tripplanner/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
base58==2.0.0
boto3==1.12.14
boto3==1.12.26
Django==2.2.11
django-ckeditor==5.9.0
django-image-cropping==1.3.0
django-extensions==2.2.8
django-storages==1.9
django-storages==1.9.1
easy-thumbnails==2.7
gunicorn==20.0.4
Pillow==7.0.0
psycopg2-binary==2.8.4
pytz==2019.3
PyYAML==5.3
PyYAML==5.3.1
requests==2.23.0
git+https://github.com/azavea/[email protected]#egg=django-wpadmin
virtualenv==20.0.7
virtualenv==20.0.13
12 changes: 6 additions & 6 deletions python/cac_tripplanner/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
<div class="directions-form">
<div class="mode-picker">
<div class="mode-toggle">
<div class="walk mode-option on" title ="Walk there">
<div class="walk mode-option off" title ="Walk there">
<i class="icon-walk"></i> <span class="mode-label">Walk</span>
</div>
<div class="bike mode-option" title ="Bike there">
<div class="bike mode-option on" title ="Bike there">
<i class="icon-bike"></i> <span class="mode-label">Bike</span>
</div>
<input type="hidden" name="mode" value="walk">
<input type="hidden" name="mode" value="bike">
</div>
<div class="transit mode-option on" title ="Click to disable transit">
<i class="icon-transit-on"></i> <span class="mode-label">Transit</span>
<input type="hidden" name="transit" value="on">
<div class="transit mode-option" title ="Take transit there">
<i class="icon-transit"></i> <span class="mode-label">Transit</span>
<input type="hidden" name="transit" value="off">
</div>
<div class="btn-options" title="Route options">
<i class="icon-sliders"></i>
Expand Down
7 changes: 7 additions & 0 deletions src/app/scripts/cac/control/cac-control-directions-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ CAC.Control.DirectionsList = (function (_, $, ShareModal, MapTemplates) {
$alert.remove();
});
$container.find(options.selectors.directionsHeader).after($alert);
} else if (itinerary.agencies.length) {
var alert = MapTemplates.transitWarningAlert();
var $alert = $(alert);
$alert.one('click', options.selectors.alertCloseButton, function () {
$alert.remove();
});
$container.find(options.selectors.directionsHeader).after($alert);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/scripts/cac/control/cac-control-mode-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CAC.Control.ModeOptions = (function ($) {
'use strict';

var defaults = {
defaultMode: 'WALK,TRANSIT',
defaultMode: 'BICYCLE',
// map button class names to OpenTripPlanner mode parameters
modes: {
walk: 'WALK',
Expand Down
36 changes: 35 additions & 1 deletion src/app/scripts/cac/map/cac-map-templates.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
CAC.Map.Templates = (function (Handlebars, moment, Utils) {
'use strict';

var transitWarningMessage = ['Consult <a class="alert-link" target="_blank" ',
'href="http://septa.org/">SEPTA</a>, ',
'<a class="alert-link" target="_blank" href="https://www.njtransit.com/">NJ Transit</a>, ',
'<a class="alert-link" target="_blank" href="http://www.ridepatco.org/">PATCO</a>, and ',
'<a class="alert-link" target="_blank" href="https://dartfirststate.com/">DART</a> ',
'for their most up-to-date schedules and policies when planning your trip. ',
'Please exercise social distancing during the COVID-19 health crisis.'].join('');

var module = {
alert: alert,
bicycleWarningAlert: bicycleWarningAlert,
bikeSharePopup: bikeSharePopup,
eventPopup: eventPopup,
itinerary: itinerary,
itineraryList: itineraryList,
transitWarningAlert: transitWarningAlert,
tourDestinationList: tourDestinationList
};

Expand Down Expand Up @@ -73,7 +82,7 @@ CAC.Map.Templates = (function (Handlebars, moment, Utils) {
agency,
'</a>, '].join('');
});
msg = msg.substring(0, msg.length - 2); // trim off trailing comma
msg = ' ' + msg.substring(0, msg.length - 2) + '. '; // trim off trailing comma

// message is not templated, so we can embed links
var source = [
Expand All @@ -84,6 +93,7 @@ CAC.Map.Templates = (function (Handlebars, moment, Utils) {
'<i class="icon-cancel"></i></button>',
'</div>',
'<div class="alert-body">',
transitWarningMessage,
msg,
'</div>',
'</div>'
Expand Down Expand Up @@ -282,6 +292,30 @@ CAC.Map.Templates = (function (Handlebars, moment, Utils) {
return html;
}

/**
* Build an HTML snippet for an alert with SEPTA COVID warning
*
* @returns {String} Compiled Handlebars template for the Bootstrap alert
*/
function transitWarningAlert() {
// TODO: set message
var source = [
'<div class="alert alert-warning">',
'<div class="alert-title">',
'notice',
'<button title="Dismiss this message" name="close" class="close" aria-label="Close">',
'<i class="icon-cancel"></i></button>',
'</div>',
'<div class="alert-body">',
transitWarningMessage,
'</div>',
'</div>'
].join('');
var template = Handlebars.compile(source);
var html = template();
return html;
}

/**
* Build an HTML snippet for tour destination sidebar list.
* Note that the date/time helpers used here were registered in the home templates
Expand Down
2 changes: 1 addition & 1 deletion src/app/scripts/cac/user/cac-user-preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CAC.User.Preferences = (function(Storages, _) {
exploreMinutes: 15,
maxWalk: 482802, // in meters; set large, since not user-controllable
method: 'directions',
mode: 'TRANSIT,WALK',
mode: 'BICYCLE',
originText: '',
destinationText: '',
tourMode: false,
Expand Down

0 comments on commit 38f8fb2

Please sign in to comment.