merging from stash

v1.18.x
Julian Lam 12 years ago
parent 97c1819dc4
commit d7c5a3c150

@ -36,6 +36,11 @@ var config = {
"facebook": {
"app_id": '',
"secret": ''
},
// Privileged Actions Reputation Thresholds
"privilege_thresholds": {
"manage_thread": 2000
}
}

@ -34,27 +34,45 @@
</ul>
<hr />
<button id="post_reply" class="btn btn-primary btn-large post_reply">Reply</button>
<div class="btn-group pull-right">
<div class="btn-group pull-right" id="thread-tools" style="visibility: hidden;">
<button class="btn dropdown-toggle" data-toggle="dropdown">Thread Tools <span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">Lock/Unlock Thread</a></li>
<li class="divider"></li>
<li><a href="#"><span class="text-error">Delete Thread</span></a></li>
<li><a href="#" id="delete_thread"><span class="text-error">Delete Thread</span></a></li>
</ul>
</div>
<script type="text/javascript">
(function() {
var locked = '{locked}';
var locked = '{locked}',
expose_tools = '{expose_tools}';
console.log(expose_tools);
jQuery('document').ready(function() {
var room = 'topic_' + '{topic_id}';
var room = 'topic_' + '{topic_id}',
adminTools = document.getElementById('thread-tools');
app.enter_room(room);
set_up_posts();
if (locked === '1') set_locked_state(true);
if (expose_tools === '1') {
var deleteThreadEl = document.getElementById('delete-thread');
adminTools.style.visibility = 'inherit';
// Add events to the thread tools
deleteThreadEl.addEventListener('click', function(e) {
e.preventDefault();
if (confirm('really delete thread? (THIS DIALOG TO BE REPLACED WITH BOOTBOX)')) {
console.log('socket shiz');
}
});
}
});

@ -1,7 +1,8 @@
var RDB = require('./redis.js'),
utils = require('./utils.js'),
marked = require('marked'),
user = require('./user.js');
user = require('./user.js'),
config = require('../config.js');
(function(Posts) {
@ -41,6 +42,7 @@ var RDB = require('./redis.js'),
'topic_name':thread_data.topic_name,
'locked': parseInt(thread_data.locked) || 0,
'topic_id': tid,
'expose_tools': user_data[uid].reputation >= config.privilege_thresholds.manage_thread ? 1 : 0,
'posts': posts
});
}

@ -356,8 +356,8 @@ passport.deserializeUser(function(uid, done) {
});
app.get('/test', function(req, res) {
global.modules.posts.get(function(data) {
res.send('<pre>' + JSON.stringify(data, null, 4) + '</pre>');
global.modules.posts.create(2, 2, 'test', function(pid) {
res.send('<pre>' + pid + '</pre>');
}, 1, 1);
});
}(WebServer));

Loading…
Cancel
Save