mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
tmp fix for nested if
This commit is contained in:
@@ -105,18 +105,18 @@ define(['taskbar'], function(taskbar) {
|
|||||||
|
|
||||||
if (parseInt(postData.tid) > 0) {
|
if (parseInt(postData.tid) > 0) {
|
||||||
titleEl.val('Replying to: ' + postData.title);
|
titleEl.val('Replying to: ' + postData.title);
|
||||||
titleEl.prop('readOnly', true);
|
titleEl.prop('disabled', true);
|
||||||
} else if (parseInt(postData.pid) > 0) {
|
} else if (parseInt(postData.pid) > 0) {
|
||||||
titleEl.val(postData.title);
|
titleEl.val(postData.title);
|
||||||
titleEl.prop('readOnly', true);
|
titleEl.prop('disabled', true);
|
||||||
socket.emit('modules.composer.editCheck', postData.pid, function(err, editCheck) {
|
socket.emit('modules.composer.editCheck', postData.pid, function(err, editCheck) {
|
||||||
if (!err && editCheck.titleEditable) {
|
if (!err && editCheck.titleEditable) {
|
||||||
postContainer.find('input').prop('readonly', false);
|
titleEl.prop('disabled', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
titleEl.val(postData.title);
|
titleEl.val(postData.title);
|
||||||
titleEl.prop('readOnly', false);
|
titleEl.prop('disabled', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bodyEl.val(postData.body);
|
bodyEl.val(postData.body);
|
||||||
|
|||||||
@@ -106,9 +106,9 @@
|
|||||||
<ul class="dropdown-menu text-center pull-right" role="menu" aria-labelledby="dLabel">
|
<ul class="dropdown-menu text-center pull-right" role="menu" aria-labelledby="dLabel">
|
||||||
<button class="btn btn-sm btn-default edit" type="button" title="[[topic:edit]]"><i class="fa fa-pencil"></i></button>
|
<button class="btn btn-sm btn-default edit" type="button" title="[[topic:edit]]"><i class="fa fa-pencil"></i></button>
|
||||||
<button class="btn btn-sm btn-default delete" type="button" title="[[topic:delete]]"><i class="fa fa-trash-o"></i></button>
|
<button class="btn btn-sm btn-default delete" type="button" title="[[topic:delete]]"><i class="fa fa-trash-o"></i></button>
|
||||||
<!-- IF posts.display_move_tools -->
|
|
||||||
<button class="btn btn-sm btn-default move" type="button" title="[[topic:move]]"><i class="fa fa-arrows"></i></button>
|
<button class="btn btn-sm btn-default move {posts.display_move_tools}" type="button" title="[[topic:move]]"><i class="fa fa-arrows"></i></button>
|
||||||
<!-- ENDIF posts.display_move_tools -->
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ CategoryTools.privileges = function(cid, uid, callback) {
|
|||||||
editable: privileges.moderator || privileges.admin,
|
editable: privileges.moderator || privileges.admin,
|
||||||
view_deleted: privileges.moderator || privileges.admin,
|
view_deleted: privileges.moderator || privileges.admin,
|
||||||
moderator: privileges.moderator,
|
moderator: privileges.moderator,
|
||||||
admin: privileges.moderator
|
admin: privileges.admin
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ var async = require('async'),
|
|||||||
var pid = postData[i].pid;
|
var pid = postData[i].pid;
|
||||||
postData[i].favourited = fav_data[pid];
|
postData[i].favourited = fav_data[pid];
|
||||||
postData[i].display_moderator_tools = (current_user != 0) && privileges[pid].editable;
|
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);
|
callback(null, postData);
|
||||||
|
|||||||
@@ -761,9 +761,11 @@ var bcrypt = require('bcrypt'),
|
|||||||
|
|
||||||
User.isAdministrator = function(uid, callback) {
|
User.isAdministrator = function(uid, callback) {
|
||||||
groups.getGidFromName('Administrators', function(err, gid) {
|
groups.getGidFromName('Administrators', function(err, gid) {
|
||||||
groups.isMember(uid, gid, function(err, isAdmin) {
|
if(err) {
|
||||||
callback(err, isAdmin);
|
return callback(err);
|
||||||
});
|
}
|
||||||
|
|
||||||
|
groups.isMember(uid, gid, callback);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user