diff --git a/migrations/current_period_end.js b/migrations/current_period_end.js new file mode 100644 index 0000000000..31e33e4a79 --- /dev/null +++ b/migrations/current_period_end.js @@ -0,0 +1,5 @@ +// mongo habitrpg ./node_modules/moment/moment.js ./migrations/current_period_end.js +db.users.update( + {_id:''}, + {$set:{'purchased.plan.dateTerminated':moment().add({days:7}).toDate()}} +) \ No newline at end of file diff --git a/public/css/items.styl b/public/css/items.styl index 213e499835..166ab09321 100644 --- a/public/css/items.styl +++ b/public/css/items.styl @@ -18,7 +18,7 @@ background-color: $better color: #555 - &:hover, &:focus + &:hover, &:focus, &.active background-color: $bad text-decoration: none diff --git a/src/controllers/groups.js b/src/controllers/groups.js index 3891c70618..9ef34b9c67 100644 --- a/src/controllers/groups.js +++ b/src/controllers/groups.js @@ -211,8 +211,23 @@ api.attachGroup = function(req, res, next) { } api.getChat = function(req, res, next) { - return res.json(res.locals.group.chat); -} + // TODO: This code is duplicated from api.get - pull it out into a function to remove duplication. + var user = res.locals.user; + var gid = req.params.gid; + var q = (gid == 'party') + ? Group.findOne({type: 'party', members: {$in:[user._id]}}) + : Group.findOne({$or:[ + {_id:gid, privacy:'public'}, + {_id:gid, privacy:'private', members: {$in:[user._id]}} + ]}); + populateQuery(gid, q); + q.exec(function(err, group){ + if (err) return next(err); + if (!group && gid!=='party') return res.json(404,{err: "Group not found or you don't have access."}); + res.json(res.locals.group.chat); + gid = null; + }); +}; /** * TODO make this it's own ngResource so we don't have to send down group data with each chat post diff --git a/views/shared/tasks/lists.jade b/views/shared/tasks/lists.jade index 0333238b2d..e02ef29de3 100644 --- a/views/shared/tasks/lists.jade +++ b/views/shared/tasks/lists.jade @@ -104,7 +104,7 @@ script(id='templates/habitrpg-tasks.html', type="text/ng-template") span.glyphicon.glyphicon-comment //left-hand size commands .task-controls.task-primary - a.money.btn-buy.item-btn(ng-click='castStart(Content.spells.special.#{k})') + a.money.btn-buy.item-btn(ng-click='castStart(Content.spells.special.#{k})', ng-class='{active: Content.spells.special.#{k}.key == spell.key}') if canceler span.shop_gold span.reward-cost {{Content.spells.special.#{k}.value}} @@ -128,7 +128,7 @@ script(id='templates/habitrpg-tasks.html', type="text/ng-template") span.glyphicon.glyphicon-comment //left-hand size commands .task-controls.task-primary - a.money.btn-buy.item-btn(ng-click='castStart(skill)') + a.money.btn-buy.item-btn(ng-click='castStart(skill)', ng-class='{active: skill.key == spell.key}') span.reward-cost strong {{skill.mana}} =env.t('mp')