From e665176abc85fef5b5da54abc16ee54474c14a76 Mon Sep 17 00:00:00 2001 From: Andrew Hayward Date: Thu, 6 Jun 2013 20:32:16 +0100 Subject: [PATCH 1/2] Fixing `db` file path --- bin/migrate-db | 5 +++-- migrations/20130530095331-add-user-real-names.js | 3 ++- migrations/20130531084137-add-token-last-reminder.js | 3 ++- migrations/20130531165656-add-reviews-to-applications.js | 3 ++- migrations/20130531222314-add-guardian-denial-state.js | 3 ++- migrations/20130602230835-add-unique-idx-to-favorites.js | 3 ++- migrations/20130604142742-add-playlist-unique-index.js | 3 ++- migrations/20130604225500-add-birthday-to-learner.js | 3 ++- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/bin/migrate-db b/bin/migrate-db index c948d1a..01b8521 100755 --- a/bin/migrate-db +++ b/bin/migrate-db @@ -8,8 +8,9 @@ db .getMigrator({path: migrationsPath}) .migrate() .success(function () { - console.log("Success!"); + console.log("Migration successful"); }) .error(function (err) { - console.log("Error:", err); + console.log("Migration error:", err); + process.exit(1); }); diff --git a/migrations/20130530095331-add-user-real-names.js b/migrations/20130530095331-add-user-real-names.js index 84a3ae3..14fd6b8 100644 --- a/migrations/20130530095331-add-user-real-names.js +++ b/migrations/20130530095331-add-user-real-names.js @@ -1,4 +1,5 @@ -var runMigrations = require('../db').runMigrations; +var path = require('path'); +var runMigrations = require(path.join(__dirname, '../db')).runMigrations; module.exports = { up: function(target, DataTypes, callback) { diff --git a/migrations/20130531084137-add-token-last-reminder.js b/migrations/20130531084137-add-token-last-reminder.js index 67cd61c..497df3e 100644 --- a/migrations/20130531084137-add-token-last-reminder.js +++ b/migrations/20130531084137-add-token-last-reminder.js @@ -1,4 +1,5 @@ -var runMigrations = require('../db').runMigrations; +var path = require('path'); +var runMigrations = require(path.join(__dirname, '../db')).runMigrations; module.exports = { up: function(target, DataTypes, callback) { diff --git a/migrations/20130531165656-add-reviews-to-applications.js b/migrations/20130531165656-add-reviews-to-applications.js index 020d9d0..20f0281 100644 --- a/migrations/20130531165656-add-reviews-to-applications.js +++ b/migrations/20130531165656-add-reviews-to-applications.js @@ -1,4 +1,5 @@ -var runMigrations = require('../db').runMigrations; +var path = require('path'); +var runMigrations = require(path.join(__dirname, '../db')).runMigrations; module.exports = { up: function(target, DataTypes, callback) { diff --git a/migrations/20130531222314-add-guardian-denial-state.js b/migrations/20130531222314-add-guardian-denial-state.js index b236d33..e1a874a 100644 --- a/migrations/20130531222314-add-guardian-denial-state.js +++ b/migrations/20130531222314-add-guardian-denial-state.js @@ -1,4 +1,5 @@ -var runMigrations = require('../db').runMigrations; +var path = require('path'); +var runMigrations = require(path.join(__dirname, '../db')).runMigrations; module.exports = { up: function(target, DataTypes, callback) { diff --git a/migrations/20130602230835-add-unique-idx-to-favorites.js b/migrations/20130602230835-add-unique-idx-to-favorites.js index e1aacbd..e623804 100644 --- a/migrations/20130602230835-add-unique-idx-to-favorites.js +++ b/migrations/20130602230835-add-unique-idx-to-favorites.js @@ -1,4 +1,5 @@ -var runMigrations = require('../db').runMigrations; +var path = require('path'); +var runMigrations = require(path.join(__dirname, '../db')).runMigrations; module.exports = { up: function(target, DataTypes, callback) { diff --git a/migrations/20130604142742-add-playlist-unique-index.js b/migrations/20130604142742-add-playlist-unique-index.js index 1b0a6ac..eb6f4ec 100644 --- a/migrations/20130604142742-add-playlist-unique-index.js +++ b/migrations/20130604142742-add-playlist-unique-index.js @@ -1,4 +1,5 @@ -var runMigrations = require('../db').runMigrations; +var path = require('path'); +var runMigrations = require(path.join(__dirname, '../db')).runMigrations; module.exports = { up: function(target, DataTypes, callback) { diff --git a/migrations/20130604225500-add-birthday-to-learner.js b/migrations/20130604225500-add-birthday-to-learner.js index e9410d4..a386608 100644 --- a/migrations/20130604225500-add-birthday-to-learner.js +++ b/migrations/20130604225500-add-birthday-to-learner.js @@ -1,4 +1,5 @@ -var runMigrations = require('../db').runMigrations; +var path = require('path'); +var runMigrations = require(path.join(__dirname, '../db')).runMigrations; module.exports = { up: function(target, DataTypes, callback) { From 5ed0a58265aa2688f4b43c5520ccebf717bf1c3e Mon Sep 17 00:00:00 2001 From: Brian J Brennan Date: Thu, 6 Jun 2013 16:03:21 -0400 Subject: [PATCH 2/2] Move filter label options out of JS and into template. --- static/media/js/custom_logic.js | 17 ++++------------- views/filter.html | 12 ++++++------ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/static/media/js/custom_logic.js b/static/media/js/custom_logic.js index 57309d6..c3af91f 100644 --- a/static/media/js/custom_logic.js +++ b/static/media/js/custom_logic.js @@ -5,15 +5,6 @@ var mob = 0; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) mob = 1 $('.show-tooltip').tooltip(); - - /*move filter labels into the selectors*/ - if($('.navbar.filter').length != 0) { - $('.navbar.filter form label').each(function(){ - var selectID = ($(this).attr('for')); - var selectEle = $('#' + selectID); - $('#' + selectID + ' option:first').text($(this).text()); - }); - } /*landing page overrides*/ if($('body.home').length != 0) { @@ -39,9 +30,9 @@ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) mob /*landing page menu rearrange*/ $('

This summer Mayor Rahm Emanuel is challenging all Chicago youth to participate in the Summer of Learning. School stops for the summer, but learning never should.

').prependTo('.footer .upper'); $('
Join the conversation on Facebook.share stories
').appendTo('.footer .upper'); - + /*landing page mobile overrides*/ - if(mob) { + if(mob) { vidLink = 'watch video'; } @@ -56,7 +47,7 @@ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) mob $('li.challenges a').append(' your future.'); } else { /*non-landing page overrides*/ - if(mob) { + if(mob) { var dynWrap = $(''); var dynList = $('
  • '); var dynLink = $('Menu').click(function(){ @@ -74,4 +65,4 @@ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) mob }); } } -}); \ No newline at end of file +}); diff --git a/views/filter.html b/views/filter.html index 16979ad..b7700c2 100644 --- a/views/filter.html +++ b/views/filter.html @@ -3,7 +3,7 @@ {% block content %} {% block filter %} - {% if filters %} + {% if filters %}