Skip to content

Commit

Permalink
Merge branch 'jerone-headings'
Browse files Browse the repository at this point in the history
  • Loading branch information
sizzlemctwizzle committed Jun 18, 2014
2 parents cab2330 + 9faa4f5 commit 4900e85
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ exports.home = function (req, res) {
} else if (options.isUserScriptListPage) {
options.scriptListIsEmptyMessage = 'This user hasn\'t added any scripts yet.';
}

// Heading
if (options.librariesOnly) {
options.pageHeading = options.isFlagged ? 'Flagged Libraries' : 'Libraries';
} else {
options.pageHeading = options.isFlagged ? 'Flagged Scripts' : 'Scripts';
}
};
function render(){ res.render('pages/scriptListPage', options); }
function asyncComplete(){ preRender(); render(); }
Expand Down
3 changes: 3 additions & 0 deletions controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ exports.userListPage = function (req, res, next) {
} else if (options.searchBarValue) {
options.userListIsEmptyMessage = 'We couldn\'t find any users by this name.';
}

// Heading
options.pageHeading = options.isFlagged ? 'Flagged Users' : 'Users';
};
function render(){ res.render('pages/userListPage', options); }
function asyncComplete(err){ if (err) { return next(); } else { preRender(); render(); } };
Expand Down
2 changes: 1 addition & 1 deletion libs/modelQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ var applyModelListQueryFlaggedFilter = function(modelListQuery, options, flagged
if (flaggedQuery) {
if (flaggedQuery == 'true') {
options.isFlagged = true;
modelListQuery.and({flags: {$gt: 0 }});
modelListQuery.and({ flags: { $gt: 0 } });
} else if (flaggedQuery == false) {
// modelListQuery.and({$or: [
// {flags: {$exists: false}},
Expand Down
3 changes: 1 addition & 2 deletions views/pages/scriptListPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
<div class="row">
<div class="col-sm-8">
<h2 class="page-heading">
{{^librariesOnly}}Scripts{{/librariesOnly}}
{{#librariesOnly}}Libraries{{/librariesOnly}}
{{pageHeading}}
</h2>
<div class="panel panel-default">
{{> includes/scriptList.html }}
Expand Down
2 changes: 1 addition & 1 deletion views/pages/userListPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="row">
<div class="col-sm-8">
<h2 class="page-heading">
Users
{{pageHeading}}
</h2>
<div class="panel panel-default">
{{> includes/userList.html }}
Expand Down

0 comments on commit 4900e85

Please sign in to comment.