mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
Admin option to allow all users to view votes (#5534)
* Admin option to allow all users to view votes * Fix </strong></strong>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
"reputation": "Reputation Settings",
|
||||
"disable": "Disable Reputation System",
|
||||
"disable-down-voting": "Disable Down Voting",
|
||||
"votes-are-public": "All Votes Are Public",
|
||||
"thresholds": "Activity Thresholds",
|
||||
"min-rep-downvote": "Minimum reputation to downvote posts",
|
||||
"min-rep-flag": "Minimum reputation to flag posts"
|
||||
|
||||
@@ -6,6 +6,7 @@ var db = require('../../database');
|
||||
var user = require('../../user');
|
||||
var posts = require('../../posts');
|
||||
var privileges = require('../../privileges');
|
||||
var meta = require('../../meta');
|
||||
var helpers = require('./helpers');
|
||||
|
||||
module.exports = function (SocketPosts) {
|
||||
@@ -16,6 +17,9 @@ module.exports = function (SocketPosts) {
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
if (parseInt(meta.config.votesArePublic, 10) !== 0) {
|
||||
return next(null, true);
|
||||
}
|
||||
privileges.categories.isAdminOrMod(data.cid, socket.uid, next);
|
||||
},
|
||||
function (isAdminOrMod, next) {
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
<div class="checkbox">
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||
<input type="checkbox" class="mdl-switch__input" data-field="downvote:disabled">
|
||||
<span class="mdl-switch__label"><strong>[[admin/settings/reputation:disable-down-voting]]</trong></strong>
|
||||
<span class="mdl-switch__label"><strong>[[admin/settings/reputation:disable-down-voting]]</strong></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||
<input type="checkbox" class="mdl-switch__input" data-field="votesArePublic">
|
||||
<span class="mdl-switch__label"><strong>[[admin/settings/reputation:votes-are-public]]</strong></span>
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
@@ -32,4 +38,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- IMPORT admin/partials/settings/footer.tpl -->
|
||||
<!-- IMPORT admin/partials/settings/footer.tpl -->
|
||||
|
||||
Reference in New Issue
Block a user