Merge branch 'master' of github.com:designcreateplay/NodeBB

v1.18.x
Julian Lam 11 years ago
commit cfe46f38ee

@ -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);

@ -106,9 +106,9 @@
<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 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>
<!-- ENDIF posts.display_move_tools -->
<button class="btn btn-sm btn-default move {posts.display_move_tools}" type="button" title="[[topic:move]]"><i class="fa fa-arrows"></i></button>
</ul>
</div>
</div>
@ -155,7 +155,7 @@
<button class="btn btn-primary post_reply" type="button">[[topic:reply]]</button>
<div class="btn-group thread-tools hide">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">[[topic:thread_tools.title]] <span class="caret"></span></button>
<ul class="dropdown-menu">
<ul class="dropdown-menu pull-right">
<li><a href="#" class="markAsUnreadForAll"><i class="fa fa-inbox"></i> [[topic:thread_tools.markAsUnreadForAll]]</a></li>
<li><a href="#" class="pin_thread"><i class="fa fa-thumb-tack"></i> [[topic:thread_tools.pin]]</a></li>
<li><a href="#" class="lock_thread"><i class="fa fa-lock"></i> [[topic:thread_tools.lock]]</a></li>
@ -181,7 +181,7 @@
<button class="btn btn-primary post_reply" type="button">[[topic:reply]]</button>
<div class="btn-group thread-tools hide">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">[[topic:thread_tools.title]] <span class="caret"></span></button>
<ul class="dropdown-menu">
<ul class="dropdown-menu pull-right">
<li><a href="#" class="markAsUnreadForAll"><i class="fa fa-inbox"></i> [[topic:thread_tools.markAsUnreadForAll]]</a></li>
<li><a href="#" class="pin_thread"><i class="fa fa-thumb-tack"></i> [[topic:thread_tools.pin]]</a></li>
<li><a href="#" class="lock_thread"><i class="fa fa-lock"></i> [[topic:thread_tools.lock]]</a></li>

@ -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
});
});
};

@ -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);

@ -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);
});
};

Loading…
Cancel
Save