mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
fixed a bug in templates, introduced categories, added default setup script onload, moved home.tpl code over to category, created hierachies
This commit is contained in:
@@ -147,6 +147,10 @@ passport.deserializeUser(function(uid, done) {
|
||||
res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("' + 'topic/' + req.params.topic_id + '");});</script>' + templates['footer']);
|
||||
});
|
||||
|
||||
app.get('/category/:category_id/:slug?', function(req, res) {
|
||||
res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("' + 'category/' + req.params.category_id + '");});</script>' + templates['footer']);
|
||||
});
|
||||
|
||||
app.get('/confirm/:code', function(req, res) {
|
||||
res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("' + 'confirm/' + req.params.code + '");});</script>' + templates['footer']);
|
||||
});
|
||||
@@ -155,7 +159,7 @@ passport.deserializeUser(function(uid, done) {
|
||||
function api_method(req, res) {
|
||||
switch(req.params.method) {
|
||||
case 'home' :
|
||||
global.modules.topics.get(function(data) {
|
||||
global.modules.categories.get(function(data) {
|
||||
res.send(JSON.stringify(data));
|
||||
});
|
||||
break;
|
||||
@@ -185,6 +189,12 @@ passport.deserializeUser(function(uid, done) {
|
||||
res.send(JSON.stringify(data));
|
||||
}, req.params.id, (req.user) ? req.user.uid : 0);
|
||||
break;
|
||||
case 'category' :
|
||||
global.modules.topics.get(function(data) {
|
||||
console.log(data);
|
||||
res.send(JSON.stringify(data));
|
||||
}, req.params.id);
|
||||
break;
|
||||
case 'account' :
|
||||
get_account_fn(req, res, function(userData) {
|
||||
res.send(JSON.stringify(userData));
|
||||
|
||||
Reference in New Issue
Block a user