mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-07 21:22:36 +02:00
Merge branch 'master' of https://github.com/designcreateplay/NodeBB
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
/**
|
||||
* READ ME!
|
||||
* The config directives here are all different based on where NodeBB is installed.
|
||||
* This config file system will be deprecated soon, and all configs will be moved
|
||||
* to the redis db, under the hash "config"
|
||||
*
|
||||
* As of May 22nd, 2013, this migration hasn't started yet
|
||||
*/
|
||||
|
||||
var config = {
|
||||
// The "secret" is used to encrypt cookie sessions, change this to any random string
|
||||
"secret": 'nodebb-secret',
|
||||
@@ -47,7 +56,10 @@ var config = {
|
||||
"privilege_thresholds": {
|
||||
"manage_thread": 1000,
|
||||
"manage_content": 2000
|
||||
}
|
||||
},
|
||||
|
||||
"show_motd": true,
|
||||
"motd": undefined
|
||||
}
|
||||
|
||||
config.url = config.base_url + (config.use_port ? ':' + config.port : '') + '/';
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
(function (module) {
|
||||
|
||||
var ready_callback,
|
||||
config = {},
|
||||
var config = {},
|
||||
templates,
|
||||
fs = null,
|
||||
available_templates = [];
|
||||
@@ -35,8 +34,19 @@
|
||||
};
|
||||
|
||||
templates.ready = function(callback) {
|
||||
if (callback == null && ready_callback) ready_callback();
|
||||
else ready_callback = callback;
|
||||
if (callback == null) {
|
||||
if (this.ready_callback) {
|
||||
this.ready_callback();
|
||||
} else {
|
||||
this.loaded = true;
|
||||
}
|
||||
} else {
|
||||
if (this.loaded == true) {
|
||||
callback();
|
||||
} else {
|
||||
this.ready_callback = callback;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
templates.prepare = function(raw_tpl, data) {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<title>NodeBB</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" CONTENT="NodeBB">
|
||||
<meta name="description" content="Node.js/Redis/Socket.io powered forums for a new generation">
|
||||
<link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
||||
<link href="/vendor/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
|
||||
<link rel="stylesheet" href="/vendor/fontawesome/css/font-awesome.min.css">
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
<div class="hero-unit">
|
||||
<h1>NodeBB</h1>
|
||||
<p>Welcome to NodeBB, the discussion platform of the future.</p>
|
||||
<p>
|
||||
<a target="_blank" href="http://www.nodebb.org" class="btn btn-large"><i class="icon-comment"></i> Get NodeBB</a>
|
||||
<a target="_blank" href="https://github.com/psychobunny/NodeBB" class="btn btn-large"><i class="icon-github-alt"></i> Fork us on Github</a>
|
||||
<a target="_blank" href="https://twitter.com/dcplabs" class="btn btn-large"><i class="icon-twitter"></i> @dcplabs</a>
|
||||
</p>
|
||||
<div class="hero-unit {motd_class}">
|
||||
{motd}
|
||||
</div>
|
||||
|
||||
<div class="row category-row">
|
||||
|
||||
@@ -6,9 +6,9 @@ var express = require('express'),
|
||||
config = require('../config.js'),
|
||||
redis = require('redis'),
|
||||
redisServer = redis.createClient(config.redis.port, config.redis.host, config.redis.options),
|
||||
marked = require('marked'),
|
||||
|
||||
user = require('./user.js'),
|
||||
|
||||
categories = require('./categories.js'),
|
||||
posts = require('./posts.js'),
|
||||
topics = require('./topics.js'),
|
||||
@@ -18,7 +18,6 @@ var express = require('express'),
|
||||
userRoute = require('./routes/user.js'),
|
||||
auth = require('./routes/authentication.js');
|
||||
|
||||
|
||||
(function(app) {
|
||||
var templates = null;
|
||||
|
||||
@@ -115,6 +114,8 @@ var express = require('express'),
|
||||
break;
|
||||
case 'home' :
|
||||
categories.getAllCategories(function(data) {
|
||||
data.motd_class = (config.show_motd || config.show_motd === undefined) ? '' : 'none';
|
||||
data.motd = marked(config.motd || "# NodeBB v0.1\nWelcome to NodeBB, the discussion platform of the future.\n\n<a target=\"_blank\" href=\"http://www.nodebb.org\" class=\"btn btn-large\"><i class=\"icon-comment\"></i> Get NodeBB</a> <a target=\"_blank\" href=\"https://github.com/psychobunny/NodeBB\" class=\"btn btn-large\"><i class=\"icon-github-alt\"></i> Fork us on Github</a> <a target=\"_blank\" href=\"https://twitter.com/dcplabs\" class=\"btn btn-large\"><i class=\"icon-twitter\"></i> @dcplabs</a>");
|
||||
res.send(JSON.stringify(data));
|
||||
}, (req.user) ? req.user.uid : 0);
|
||||
break;
|
||||
@@ -191,6 +192,7 @@ var express = require('express'),
|
||||
break;
|
||||
case 'popular' :
|
||||
categories.get(function(data) {
|
||||
console.log(data);
|
||||
if(!data) {
|
||||
res.send(false);
|
||||
return;
|
||||
@@ -239,7 +241,7 @@ var express = require('express'),
|
||||
app.get('/test', function(req, res) {
|
||||
categories.get(function(category) {
|
||||
res.send(JSON.stringify(category, null, 4));
|
||||
}, 2, 2, null, null);
|
||||
}, null, 2, null, null);
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user