Skip to content

Node.js based forum software built for the modern web

Merge branch 'master' of github.com:psychobunny/node-forum

Julian Lamc7fb07e2e510
diff --cc nodebb
index 90ffe6d3c3,90ffe6d3c3..90ffe6d3c3
mode 100644,100644..100755
--- a/nodebb
+++ b/nodebb
diff --cc public/templates/header.tpl
index 0d9007c3e3,1f517a7b4f..0fbdf2ff3e
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@@ -109,8 -140,6 +140,7 @@@
#user_label img {
border: 1px solid #999;
margin-right: 8px;
+ margin-top: -2px;
- float: left;
}
#user_label span {
@@@ -132,13 -166,13 +167,10 @@@
</button>
<div class="nav-collapse collapse">
<ul class="nav">
- <li class="active"><a href="/">Home</a></li>
- <li><a href="/register">Register</a></li>
- <li><a href="/login">Login</a></li>
+ <li class="active"><a href="/">Forum</a></li>
- <!-- <li><a href="/register">Register</a></li>
- <li><a href="/login">Login</a></li> -->
</ul>
- <ul class="nav pull-right">
- <li><a href="#" id="user_label"></a></li>
- <li><a href="/logout">Log out</a></li>
+ <ul class="nav pull-right" id="right-menu">
+ <li><p class="navbar-text" id="user_label"></p></li>
- <!-- <li><a href="/logout">Log out</a></li> -->
</ul>
</div>
</div>
diff --cc src/webserver.js
index c4da2ac510,05268c36ec..da96c649c3
--- a/src/webserver.js
+++ b/src/webserver.js
@@@ -59,28 -88,28 +88,32 @@@ passport.deserializeUser(function(uid,
// Useful if you want to use app.put and app.delete (instead of app.post all the time)
// app.use(express.methodOverride());
- app.get('/', function(req, res) {
- global.modules.topics.generate_forum_body(function(forum_body) {
- res.send(templates['header'] + forum_body + templates['footer']);
- });
- });
+ app.get('/403', function(req, res) {
+ res.send(templates['header'] + templates['403'] + templates['footer']);
+ });
+
+ // Basic Routes (entirely client-side parsed, goal is to move the rest of the crap in this file into this one section)
+ (function() {
+ var routes = ['', 'login', 'register'];
- // need a proper way to combine these two routes together
- app.get('/topics/:topic_id', function(req, res) {
- global.modules.topics.generate_topic_body(function(topic_body) {
- res.send(templates['header'] + topic_body + templates['footer']);
- }, req.params.topic_id)
- });
- app.get('/topics/:topic_id/:slug', function(req, res) {
+ for (var i=0, ii=routes.length; i<ii; i++) {
+ (function(route) {
+ app.get('/' + route, function(req, res) {
+ res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("' + route + '");});</script>' + templates['footer']);
+ });
+ }(routes[i]));
+ }
+ }());
+
+
+ function generate_topic_body(req, res) {
global.modules.topics.generate_topic_body(function(topic_body) {
res.send(templates['header'] + topic_body + templates['footer']);
- }, req.params.topic_id)
- });
+ }, req.params.topic_id);
+ }
+ app.get('/topic/:topic_id', generate_topic_body);
+ app.get('/topic/:topic_id*', generate_topic_body);