From 3d30c0bd878d91bc2aeeba4403d5ba355f6a93b9 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Sun, 19 Jan 2014 18:18:47 -0500 Subject: [PATCH 1/2] tmp fix for nested if --- public/src/modules/composer.js | 8 ++++---- public/templates/topic.tpl | 6 +++--- src/categoryTools.js | 2 +- src/topics.js | 2 +- src/user.js | 8 +++++--- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index f0bc56f4d5..35fcd16c34 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -105,18 +105,18 @@ define(['taskbar'], function(taskbar) { if (parseInt(postData.tid) > 0) { titleEl.val('Replying to: ' + postData.title); - titleEl.prop('readOnly', true); + titleEl.prop('disabled', true); } else if (parseInt(postData.pid) > 0) { titleEl.val(postData.title); - titleEl.prop('readOnly', true); + titleEl.prop('disabled', true); socket.emit('modules.composer.editCheck', postData.pid, function(err, editCheck) { if (!err && editCheck.titleEditable) { - postContainer.find('input').prop('readonly', false); + titleEl.prop('disabled', false); } }); } else { titleEl.val(postData.title); - titleEl.prop('readOnly', false); + titleEl.prop('disabled', false); } bodyEl.val(postData.body); diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 16a8016e46..2e80e6dacc 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -106,9 +106,9 @@ diff --git a/src/categoryTools.js b/src/categoryTools.js index 853b9c049f..8dd2f6664e 100644 --- a/src/categoryTools.js +++ b/src/categoryTools.js @@ -118,7 +118,7 @@ CategoryTools.privileges = function(cid, uid, callback) { editable: privileges.moderator || privileges.admin, view_deleted: privileges.moderator || privileges.admin, moderator: privileges.moderator, - admin: privileges.moderator + admin: privileges.admin }); }); }; diff --git a/src/topics.js b/src/topics.js index 131e1962e7..7b11c4f972 100644 --- a/src/topics.js +++ b/src/topics.js @@ -410,7 +410,7 @@ var async = require('async'), var pid = postData[i].pid; postData[i].favourited = fav_data[pid]; postData[i].display_moderator_tools = (current_user != 0) && privileges[pid].editable; - postData[i].display_move_tools = privileges[pid].move; + postData[i].display_move_tools = privileges[pid].move ? '' : 'hidden'; } callback(null, postData); diff --git a/src/user.js b/src/user.js index 066cd6eb43..12ff17ed3e 100644 --- a/src/user.js +++ b/src/user.js @@ -761,9 +761,11 @@ var bcrypt = require('bcrypt'), User.isAdministrator = function(uid, callback) { groups.getGidFromName('Administrators', function(err, gid) { - groups.isMember(uid, gid, function(err, isAdmin) { - callback(err, isAdmin); - }); + if(err) { + return callback(err); + } + + groups.isMember(uid, gid, callback); }); }; From d1ccc692aea9401546db54328e2ea145e8e67c9d Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Sun, 19 Jan 2014 18:35:18 -0500 Subject: [PATCH 2/2] pull right dropdowns --- public/templates/topic.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 2e80e6dacc..ee93319e11 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -155,7 +155,7 @@