diff --git a/public/src/admin/extend/rewards.js b/public/src/admin/extend/rewards.js new file mode 100644 index 0000000000..511a3b6ec3 --- /dev/null +++ b/public/src/admin/extend/rewards.js @@ -0,0 +1,21 @@ +"use strict"; +/* global define, app, socket, bootbox */ + +define('admin/extend/rewards', function() { + var rewards = {}; + + + var available, + active; + + rewards.init = function() { + available = JSON.parse($('#rewards').val()); + active = JSON.parse($('#active').val()); + + $('[data-selected]').each(function() { + $(this).val($(this).attr('data-selected')); + }); + }; + + return rewards; +}); \ No newline at end of file diff --git a/src/rewards/admin.js b/src/rewards/admin.js index 6748515e14..ff0a56ff9c 100644 --- a/src/rewards/admin.js +++ b/src/rewards/admin.js @@ -30,11 +30,11 @@ rewards.get = function(callback) { }, { "name": "<", - "conditional": "smallerthan" + "conditional": "lesserthan" }, { "name": "<=", - "conditional": "smallerorequalthan" + "conditional": "lesserorequalthan" }, { "name": "is string:", @@ -44,18 +44,16 @@ rewards.get = function(callback) { active: [ { "rewardID": 0, - "conditional": { - "condition": ">", - "value": 100 - }, + "condition": "postcount", + "conditional": "greaterthan", + "value": 100, "disabled": 0 }, { - "rewardID": 1, - "conditional": { - "condition": ">", - "value": 100 - }, + "rewardID": 0, + "condition": "lastLoggedIn", + "conditional": "lesserthan", + "value": 10, "disabled": 0 } ], diff --git a/src/views/admin/extend/rewards.tpl b/src/views/admin/extend/rewards.tpl index b0cc48daa2..538ac93b39 100644 --- a/src/views/admin/extend/rewards.tpl +++ b/src/views/admin/extend/rewards.tpl @@ -8,22 +8,30 @@
  • If User's - - + Is - - + + Then +
  • + +