Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
flibbertigibbet committed Sep 13, 2017
2 parents de3c58c + 36145e3 commit dc199e4
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 32 deletions.
20 changes: 10 additions & 10 deletions deployment/ansible/roles/cac-tripplanner.app/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ root_media_dir: "/media/cac"
app_cron_event_feed: "cd {{ root_app_dir }} && python manage.py load_events >> {{ app_cron_event_feed_log }} 2>&1"

cac_python_dependencies:
- { name: 'base58', version: '0.2.4' }
- { name: 'boto', version: '2.45.0' }
- { name: 'django', version: '1.8.17' }
- { name: 'django-ckeditor', version: '5.1.1' }
- { name: 'django-extensions', version: '1.7.5' }
- { name: 'django-storages-redux', version: '1.3.2' }
- { name: 'gunicorn', version: '19.6.0' }
- { name: 'pillow', version: '3.4.2' }
- { name: 'psycopg2', version: '2.6.2' }
- { name: 'pytz', version: '2016.10' }
- { name: 'base58', version: '0.2.5' }
- { name: 'boto', version: '2.48.0' }
- { name: 'django', version: '1.8.18' }
- { name: 'django-ckeditor', version: '5.3.0' }
- { name: 'django-extensions', version: '1.9.0' }
- { name: 'django-storages-redux', version: '1.3.3' }
- { name: 'gunicorn', version: '19.7.1' }
- { name: 'pillow', version: '4.2.1' }
- { name: 'psycopg2', version: '2.7.3' }
- { name: 'pytz', version: '2017.2' }
- { name: 'pyyaml', version: '3.12' }
- { name: 'troposphere', version: '0.7.2'}
# Note: django-wpadmin is installed manually to work around the fact that ansible-pip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- name: Install dev/test python packages
pip: name={{ item.name }} version={{ item.version }}
with_items:
- { name: 'flake8', version: '2.3.0' }
- { name: 'flake8', version: '3.4.1' }
42 changes: 37 additions & 5 deletions python/cac_tripplanner/cac_tripplanner/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@
MEDIA_URL = '/media/'

# LOGGING CONFIGURATION
LOGGING_CONFIG = None
logging.config.dictConfig({
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
Expand All @@ -180,16 +179,49 @@
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'level': 'INFO',
'formatter': 'verbose',
},
'logfile': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'formatter': 'verbose',
'filename': os.path.join(BASE_DIR, 'cac-tripplanner-app.log'),
},
},
'loggers': {
'django': {
'handlers': ['console'],
'handlers': ['console', 'logfile'],
'level': 'INFO',
}
'propagate': True,
},
'ckeditor': {
'handlers': ['console', 'logfile'],
'level': 'DEBUG',
'propagate': True,
},
'wpadmin': {
'handlers': ['console', 'logfile'],
'level': 'DEBUG',
'propagate': True,
},
'destinations': {
'handlers': ['console', 'logfile'],
'level': 'DEBUG',
'propagate': True,
},
'cms': {
'handlers': ['console', 'logfile'],
'level': 'DEBUG',
'propagate': True,
},
'shortlinks': {
'handlers': ['console', 'logfile'],
'level': 'DEBUG',
'propagate': True,
},
}
})
}

# TEMPLATE CONFIGURATION
# See https://docs.djangoproject.com/en/1.8/ref/settings/#templates
Expand Down
13 changes: 9 additions & 4 deletions python/cac_tripplanner/templates/service-worker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Service Worker to support functioning as a PWA
// https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers

var CACHE_NAME = 'cac_tripplanner_v1';
var CACHE_NAME = 'cac_tripplanner_v2';

var cacheFiles = {{ cache_files | safe }};

Expand All @@ -27,15 +27,20 @@ self.addEventListener('fetch', function(event) {
return response;
} else {
return fetch(event.request).then(function (response) {
// cache fetched request if it is on this domain
if (request.url.startsWith(location.href)) {
// Only cache static and media assets on this domain
var url = event.request.url;
if (url.startsWith(location.origin) &&
(url.includes('/static') || url.includes('/media'))) {

var responseClone = response.clone();
caches.open(CACHE_NAME).then(function (cache) {
cache.put(event.request, responseClone);
});
}
return response;
}).catch(function () {
}).catch(function (error) {
console.error(error);
console.error(event);
return fetch(event.request);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/scripts/cac/map/cac-map-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ CAC.Map.Templates = (function (Handlebars, moment, Utils) {
// .back and .getdirections are used to select these elements for the click event
'<div class="col-sm-6"><a class="back btn btn-primary btn-block hidden-xs">Back</a></div>',
'<div class="col-sm-6"><a class="getdirections btn btn-primary btn-block">',
'Get Directions</a></div>',
'Get directions</a></div>',
'</div>',
'</div>',
'</div>'
Expand Down
6 changes: 3 additions & 3 deletions src/app/scripts/cac/pages/cac-pages-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CAC.Pages.Home = (function ($, ModeOptions, MapControl, TripOptions, SearchPara
'use strict';

// this needs to match the value in styles/utils/_breakpoints.scss
var MD_UP_BREAKPOINT = 992;
var XXS_BREAKPOINT = 480;

var defaults = {
selectors: {
Expand Down Expand Up @@ -60,7 +60,7 @@ CAC.Pages.Home = (function ($, ModeOptions, MapControl, TripOptions, SearchPara

mapControl = new MapControl({
tabControl: tabControl,
isMobile: $(window).width() < MD_UP_BREAKPOINT
isMobile: $(window).width() < XXS_BREAKPOINT
});

modeOptionsControl = new ModeOptions();
Expand Down Expand Up @@ -168,7 +168,7 @@ CAC.Pages.Home = (function ($, ModeOptions, MapControl, TripOptions, SearchPara

// only allow explore mode on desktop and only respond to label in map view
if (tabControl.isTabShowing(tabControl.TABS.HOME) ||
$(window).width() < MD_UP_BREAKPOINT) {
$(window).width() < XXS_BREAKPOINT) {

return;
}
Expand Down
21 changes: 14 additions & 7 deletions src/app/styles/components/_directions-form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,23 @@

&.directions-tab-button label {
position: relative;
padding-right: 2rem;
background-color: $gophillygo-blue-dark;
cursor: pointer;
}

&.directions-to label {
padding-right: .5rem;
}

&.isochrone-control label {
padding-right: 1rem;
&:after {
position: absolute;
right: 4px;
width: 20px;
margin: 0;
padding: 0;
color: inherit;
font-family: gpg;
font-size: .7em;
line-height: 30px;
text-align: right;
content: '\e813';
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/styles/utils/_breakpoints.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ $breakpoints: (

// 'xxs' must match defaults.slick.responsive.breakpoint in cac-control-itinerary-list.js
'xxs': (max-width: 480px),
// NB: if xxs breakpoint changes, must also update cac-pages-home.js XXS_BREAKPOINT
'xxs-up': (min-width: 481px),

'xs': (max-width: 767px),
Expand All @@ -12,7 +13,6 @@ $breakpoints: (
'sm-down': (max-width: 991px),

'md': "(min-width: 992px) and (max-width: 1200px)",
// NB: if md-up breakpoint changes, must also update cac-pages-home.js MD_UP_BREAKPOINT
'md-up': (min-width: 992px),
'md-down': (max-width: 1200px),

Expand Down

0 comments on commit dc199e4

Please sign in to comment.