Skip to content

Commit

Permalink
Adds ifUserIsMe and fixes inverse not being passed back
Browse files Browse the repository at this point in the history
fixes #639
  • Loading branch information
darylhedley authored and brian-learningpool committed Apr 17, 2015
1 parent 11dda7d commit ef19c21
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/core/app/helpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// LICENCE https://github.com/adaptlearning/adapt_authoring/blob/master/LICENSE
define(function(require){
var Handlebars = require('handlebars');
var Origin = require('coreJS/app/origin');

var helpers = {
lowerCase: function(text) {
Expand Down Expand Up @@ -70,9 +71,16 @@ define(function(require){
if (value === text) {
return block.fn(this);
} else {
return block.inverse();
return block.inverse(this);
}
},
ifUserIsMe: function(userId, block) {
if (userId === Origin.sessionModel.get('id')) {
return block.fn(this);
} else {
return block.inverse(this);
}
},
selected: function(option, value){
if (option === value) {
return ' selected';
Expand Down

0 comments on commit ef19c21

Please sign in to comment.