Skip to content

Commit

Permalink
Whitespace trimming
Browse files Browse the repository at this point in the history
Because Sublime is cool like that
  • Loading branch information
Chris Hall committed Feb 27, 2014
1 parent 21f7f40 commit d962195
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
17 changes: 9 additions & 8 deletions controllers/news.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ exports.deleteComment = function (req, res, next) {

/**
* GET /ajaxGetUserGithubDataUrl/:id
* Called via AJAX.
* Called via AJAX.
* Responds with 'failure' or the number of GitHub contributions of
* the specified user.
* GET paramaters
* id - the username of the user for whom the number of GitHub
* id - the username of the user for whom the number of GitHub
* contributions should be retrieved
*/
exports.ajaxGetUserGithubData = function(req, res, next) {
Expand All @@ -253,7 +253,7 @@ exports.ajaxGetUserGithubData = function(req, res, next) {
onSuccess: function(data) {
if (constants.DEBUG) console.log (data);
if (constants.DEBUG) console.log ('success');
var contributions =
var contributions =
githubContributors.getContributions(user.username, data);
res.send ({contributions: contributions});
}
Expand Down Expand Up @@ -362,7 +362,7 @@ function getNewsItems(query, page, user, callback, sort) {
sort = null;
}


if(!sort) {
// default sort is by `created`, so we can use `skip` and `limit` on the Mongo query
skip = (page - 1) * newsItemsPerPage;
Expand All @@ -384,6 +384,7 @@ function getNewsItems(query, page, user, callback, sort) {

if(err) return callback(err);


// no further sort necessary, just add metadata
if(!sort) return addVotesAndCommentDataToNewsItems(newsItems, user, callback);

Expand Down Expand Up @@ -457,10 +458,10 @@ function addLatestCommentTimeForNewsItems(items, callback) {
item = typeof item.toObject === 'function' ? item.toObject() : item;
item.latestCommentAt = comments.created;
item.latestCommentBy = comments.poster;
}
}

cb(null, item);
});
});

}, callback);
}
Expand Down Expand Up @@ -607,7 +608,7 @@ exports.postNews = function(req, res, next) {

var posttype = req.body.posttype;

req.assert('title', 'Title cannot be blank.').notEmpty();
req.assert('title', 'Title cannot be blank.').notEmpty();
if (posttype === 'self') {
req.assert('summary', 'Post summary cannot be blank.').notEmpty();
} else {
Expand Down
10 changes: 5 additions & 5 deletions views/news/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ block content
br
dt Contributions:
dd
span#contribution-count
span#contribution-count
br
if userProfile.location
dt Location:
Expand All @@ -41,7 +41,7 @@ block content
dd
if (!userProfile.website.match(/^http[s]?:\/\//))
- userProfile.website = 'http://' + userProfile.website

a(href='#{userProfile.website}', target='_blank') #{userProfile.website}
.page-header
ul.nav.nav-tabs
Expand Down Expand Up @@ -127,10 +127,10 @@ block content
div.col-sm-7
.visible-xs
small.timeago(title="#{comment.created}")= timeago(comment.created)
small on
small on
a(href=comment.newsItem.url)= comment.newsItem.title
a(href='/news/' + comment.newsItem._id + (comment.newsItem.latestCommentAt ? "?last_comment=#{comment.newsItem.latestCommentAt}" : ""), class='comments')
small #{comment.newsItem.comment_count}
small #{comment.newsItem.comment_count}
i.fa.fa-comment-o
blockquote.content!= comment.contents
+delete(comment.poster, '/news/' + comment.newsItem._id + '/comments/' + comment._id + '/delete')
Expand All @@ -157,6 +157,6 @@ block content
a(href=(page-1), class='btn btn-sm btn-default')='Previous Page'
if items.length === newsItemsPerPage
a(href= (filteredSource ? '/news/source/' + filteredSource : '/news') + '/page/' + (page+1), class='btn btn-sm btn-default pull-right')='Next Page'

div(id='filtered-user' data-val=filteredUser)
script(src='/js/newsIndex.js?v#{cacheBuster}')

0 comments on commit d962195

Please sign in to comment.