Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.
Closed

0.4.0 #331

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions config/env/all.js → config/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ module.exports = {
]
},
css: [
'public/modules/**/css/*.css'
'modules/**/client/css/*.css'
],
js: [
'public/config.js',
'public/application.js',
'public/modules/*/*.js',
'public/modules/*/*[!tests]*/*.js'
'modules/*/client/*.js',
'modules/*/client/*[!tests]*/*.js'
],
tests: [
'public/lib/angular-mocks/angular-mocks.js',
'public/modules/*/tests/*.js'
'modules/*/client/tests/*.js'
]
}
};
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
107 changes: 107 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,63 @@
'use strict';

module.exports = function(grunt) {
<<<<<<< HEAD
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
serverViews: {
files: ['modules/*/views/**'],
options: {
livereload: true,
}
},
serverJS: {
files: ['gruntfile.js', 'server.js', 'config/**/*.js', 'modules/*/server/**/*.js'],
tasks: ['jshint'],
options: {
livereload: true,
}
},
clientViews: {
files: ['modules/*/client/views/*.html'],
options: {
livereload: true,
}
},
clientJS: {
files: ['public/*.js', 'modules/*/client/**/*.js'],
tasks: ['jshint'],
options: {
livereload: true,
}
},
clientCSS: {
files: ['modules/*/client/css/*.css'],
tasks: ['csslint'],
options: {
livereload: true,
}
}
},
jshint: {
all: {
src: ['gruntfile.js', 'server.js', 'config/**/*.js', 'modules/**/*.js', 'public/*.js'],
options: {
jshintrc: true
}
}
},
csslint: {
options: {
csslintrc: '.csslintrc',
},
all: {
src: ['modules/**/css/*.css']
}
},
uglify: {
=======
// Unified Watch Object
var watchFiles = {
serverViews: ['app/views/**/*.*'],
Expand Down Expand Up @@ -106,12 +163,47 @@ module.exports = function(grunt) {
}
},
ngmin: {
>>>>>>> 0.3.2
production: {
files: {
'public/dist/application.js': '<%= applicationJavaScriptFiles %>'
}
}
},
<<<<<<< HEAD
nodemon: {
dev: {
script: 'server.js',
options: {
nodeArgs: ['--debug']
}
}
},
concurrent: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
},
env: {
test: {
NODE_ENV: 'test'
}
},
mochaTest: {
src: ['modules/*/server/tests/**/*.js'],
options: {
reporter: 'spec',
require: 'server.js'
}
},
karma: {
unit: {
configFile: 'karma.conf.js'
}
}
});
=======
concurrent: {
default: ['nodemon', 'watch'],
debug: ['nodemon', 'watch', 'node-inspector'],
Expand Down Expand Up @@ -140,10 +232,24 @@ module.exports = function(grunt) {

// Load NPM tasks
require('load-grunt-tasks')(grunt);
>>>>>>> 0.3.2

// Making grunt default to force in order not to break the project.
grunt.option('force', true);

<<<<<<< HEAD
// Making grunt default to force in order not to break the project.
// grunt.option('force', true);

// A Task for loading the configuration object
grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() {
var MEAN = require('mean-core');
var application = new MEAN();

grunt.config.set('applicationJavaScriptFiles', application.config.assets.js);
grunt.config.set('applicationCSSFiles', application.config.assets.css);
});
=======
// A Task for loading the configuration object
grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() {
var init = require('./config/init')();
Expand All @@ -155,6 +261,7 @@ module.exports = function(grunt) {

// Default task(s).
grunt.registerTask('default', ['lint', 'concurrent:default']);
>>>>>>> 0.3.2

// Debug task.
grunt.registerTask('debug', ['lint', 'concurrent:debug']);
Expand Down
7 changes: 4 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/**
* Module dependencies.
*/
var applicationConfiguration = require('./config/config');
var MEAN = require('mean-core'),
application = new MEAN();

// Karma configuration
module.exports = function(config) {
Expand All @@ -12,7 +13,7 @@ module.exports = function(config) {
frameworks: ['jasmine'],

// List of files / patterns to load in the browser
files: applicationConfiguration.assets.lib.js.concat(applicationConfiguration.assets.js, applicationConfiguration.assets.tests),
files: application.config.assets.lib.js.concat(application.config.assets.js, application.config.assets.tests),

// Test results reporter to use
// Possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
Expand Down Expand Up @@ -49,4 +50,4 @@ module.exports = function(config) {
// If true, it capture browsers, run tests and exit
singleRun: true
});
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
/**
* Module dependencies.
*/
var users = require('../../app/controllers/users'),
articles = require('../../app/controllers/articles');
var path = require('path'),
users = require(path.resolve('./modules/users/server/controllers/users')),
articles = require('../controllers/articles');

module.exports = function(app) {
// Article Routes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module.exports = function(app) {
// Root routing
var core = require('../../app/controllers/core');
var core = require('../controllers/core');
app.route('/').get(core.index);
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ angular.module('users').config(['$stateProvider',
state('signin', {
url: '/signin',
templateUrl: 'modules/users/views/signin.client.view.html'
}).
state('forgot', {
url: '/forgot',
templateUrl: 'modules/users/views/forgot.client.view.html'
}).
state('reset', {
url: '/reset/:token',
templateUrl: 'modules/users/views/reset.client.view.html'
});
}
]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
'use strict';

<<<<<<< HEAD
angular.module('users').controller('AuthenticationController', ['$scope', '$http', '$location', 'Authentication',
function($scope, $http, $location, Authentication) {
$scope.authentication = Authentication;
=======
angular.module('users').controller('AuthenticationController', ['$scope', '$stateParams', '$http', '$location', 'Authentication',
function($scope, $stateParams, $http, $location, Authentication) {
$scope.authentication = Authentication;
>>>>>>> pr/73

//If user is signed in then redirect back home
if ($scope.authentication.user) $location.path('/');

$scope.signup = function() {
$http.post('/auth/signup', $scope.credentials).success(function(response) {
//If successful we assign the response to the global user model
$scope.authentication.user = response;

//And redirect to the index page
$location.path('/');
}).error(function(response) {
$scope.error = response.message;
});
};

$scope.signin = function() {
$http.post('/auth/signin', $scope.credentials).success(function(response) {
//If successful we assign the response to the global user model
$scope.authentication.user = response;

<<<<<<< HEAD
//And redirect to the index page
$location.path('/');
}).error(function(response) {
$scope.error = response.message;
});
};
}
=======
//And redirect to the index page
$location.path('/');
}).error(function(response) {
$scope.error = response.message;
});
};

$scope.forgot = function() {
$scope.success = $scope.error = null;

$http.post('/auth/forgot', $scope.credentials).success(function(response) {
// Show user success message and clear form
$scope.credentials = null;
$scope.success = response.message;

}).error(function(response) {
// Show user error message and clear form
$scope.credentials = null;
$scope.error = response.message;
});
};

// Change user password
$scope.reset = function() {
$scope.success = $scope.error = null;

$http.post('/auth/reset/' + $stateParams.token,
$scope.passwordDetails).success(function(response) {

// If successful show success message and clear form
$scope.success = response.message;
$scope.passwordDetails = null;

}).error(function(response) {
$scope.error = response.message;
});
};

}
>>>>>>> pr/73
]);
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ <h3 class="col-md-12 text-center">Or with your account</h3>
<button type="submit" class="btn btn-primary">Sign in</button>&nbsp; or&nbsp;
<a href="/#!/signup">Sign up</a>
</div>
<div class"forgot-password">
<a href="/#!/forgot">Forgot your password?</a>
</div>
<div data-ng-show="error" class="text-center text-danger">
<strong data-ng-bind="error"></strong>
</div>
</fieldset>
</form>
</div>
</section>
</section>
13 changes: 8 additions & 5 deletions config/passport.js → ...r/config/passport.server.configuration.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

var passport = require('passport'),
User = require('mongoose').model('User'),
path = require('path'),
config = require('./config');
path = require('path');

module.exports = function(app, config) {
// use passport session
app.use(passport.initialize());
app.use(passport.session());

module.exports = function() {
// Serialize sessions
passport.serializeUser(function(user, done) {
done(null, user.id);
Expand All @@ -21,7 +24,7 @@ module.exports = function() {
});

// Initialize strategies
config.getGlobbedFiles('./config/strategies/**/*.js').forEach(function(strategy) {
require(path.resolve(strategy))();
config.getGlobbedFiles(path.join(__dirname, 'strategies/*.js')).forEach(function(strategy) {
require(path.resolve(strategy))(config);
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
var passport = require('passport'),
url = require('url'),
FacebookStrategy = require('passport-facebook').Strategy,
config = require('../config'),
users = require('../../app/controllers/users');
users = require('../../controllers/users');

module.exports = function() {
module.exports = function(config) {
// Use facebook strategy
passport.use(new FacebookStrategy({
clientID: config.facebook.clientID,
Expand Down Expand Up @@ -39,4 +38,4 @@ module.exports = function() {
users.saveOAuthUserProfile(req, providerUserProfile, done);
}
));
};
};
Loading