mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-06 19:45:45 +02:00
Merge pull request #442 from miguelcoba/issue-441
Remove unnecessary whitespace, format code, and add comments
This commit is contained in:
@@ -99,8 +99,8 @@ exports.articleByID = function(req, res, next, id) {
|
||||
if (err) return next(err);
|
||||
if (!article) {
|
||||
return res.status(404).send({
|
||||
message: 'Article not found'
|
||||
});
|
||||
message: 'Article not found'
|
||||
});
|
||||
}
|
||||
req.article = article;
|
||||
next();
|
||||
|
||||
@@ -12,7 +12,7 @@ var _ = require('lodash'),
|
||||
nodemailer = require('nodemailer'),
|
||||
async = require('async'),
|
||||
crypto = require('crypto');
|
||||
|
||||
|
||||
var smtpTransport = nodemailer.createTransport(config.mailer.options);
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,7 +58,7 @@ describe('Article Model Unit Tests:', function() {
|
||||
|
||||
afterEach(function(done) {
|
||||
Article.remove().exec(function() {
|
||||
User.remove().exec(done);
|
||||
User.remove().exec(done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -274,7 +274,7 @@ describe('Article CRUD tests', function() {
|
||||
|
||||
afterEach(function(done) {
|
||||
User.remove().exec(function() {
|
||||
Article.remove().exec(done);
|
||||
Article.remove().exec(done);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
|
||||
<!--Application CSS Files-->
|
||||
{% for cssFile in cssFiles %}
|
||||
<link rel="stylesheet" href="{{cssFile}}">{% endfor %}
|
||||
<link rel="stylesheet" href="{{cssFile}}">
|
||||
{% endfor %}
|
||||
|
||||
<!-- HTML5 Shim -->
|
||||
<!--[if lt IE 9]>
|
||||
@@ -59,7 +60,8 @@
|
||||
|
||||
<!--Application JavaScript Files-->
|
||||
{% for jsFile in jsFiles %}
|
||||
<script type="text/javascript" src="{{jsFile}}"></script>{% endfor %}
|
||||
<script type="text/javascript" src="{{jsFile}}"></script>
|
||||
{% endfor %}
|
||||
|
||||
{% if process.env.NODE_ENV === 'development' %}
|
||||
<!--Livereload script rendered -->
|
||||
|
||||
4
config/env/all.js
vendored
4
config/env/all.js
vendored
@@ -14,7 +14,7 @@ module.exports = {
|
||||
// The name of the MongoDB collection to store sessions in
|
||||
sessionCollection: 'sessions',
|
||||
// The session cookie settings
|
||||
sessionCookie: {
|
||||
sessionCookie: {
|
||||
path: '/',
|
||||
httpOnly: true,
|
||||
// If secure is set to true then it will cause the cookie to be set
|
||||
@@ -25,7 +25,7 @@ module.exports = {
|
||||
// Only set the maxAge to null if the cookie shouldn't be expired
|
||||
// at all. The cookie will expunge when the browser is closed.
|
||||
maxAge: null,
|
||||
// To set the cookie in a specific domain uncomment the following
|
||||
// To set the cookie in a specific domain uncomment the following
|
||||
// setting:
|
||||
// domain: 'yourdomain.com'
|
||||
},
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
// Articles controller
|
||||
angular.module('articles').controller('ArticlesController', ['$scope', '$stateParams', '$location', 'Authentication', 'Articles',
|
||||
function($scope, $stateParams, $location, Authentication, Articles) {
|
||||
$scope.authentication = Authentication;
|
||||
|
||||
// Create new Article
|
||||
$scope.create = function() {
|
||||
// Create new Article object
|
||||
var article = new Articles({
|
||||
title: this.title,
|
||||
content: this.content
|
||||
});
|
||||
|
||||
// Redirect after save
|
||||
article.$save(function(response) {
|
||||
$location.path('articles/' + response._id);
|
||||
|
||||
// Clear form fields
|
||||
$scope.title = '';
|
||||
$scope.content = '';
|
||||
}, function(errorResponse) {
|
||||
@@ -19,6 +25,7 @@ angular.module('articles').controller('ArticlesController', ['$scope', '$statePa
|
||||
});
|
||||
};
|
||||
|
||||
// Remove existing Article
|
||||
$scope.remove = function(article) {
|
||||
if (article) {
|
||||
article.$remove();
|
||||
@@ -35,6 +42,7 @@ angular.module('articles').controller('ArticlesController', ['$scope', '$statePa
|
||||
}
|
||||
};
|
||||
|
||||
// Update existing Article
|
||||
$scope.update = function() {
|
||||
var article = $scope.article;
|
||||
|
||||
@@ -45,10 +53,12 @@ angular.module('articles').controller('ArticlesController', ['$scope', '$statePa
|
||||
});
|
||||
};
|
||||
|
||||
// Find a list of Articles
|
||||
$scope.find = function() {
|
||||
$scope.articles = Articles.query();
|
||||
};
|
||||
|
||||
// Find existing Article
|
||||
$scope.findOne = function() {
|
||||
$scope.article = Articles.get({
|
||||
articleId: $stateParams.articleId
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
(function() {
|
||||
// Articles Controller Spec
|
||||
describe('ArticlesController', function() {
|
||||
describe('Articles Controller Tests', function() {
|
||||
// Initialize global variables
|
||||
var ArticlesController,
|
||||
scope,
|
||||
|
||||
Reference in New Issue
Block a user