Baris Usakli 12 years ago
commit 85acabf1f6

@ -28,7 +28,6 @@ var templates = {};
$.getJSON('/templates/config.json', function(data) {
config = data;
console.log('loaded');
});
for (var t in templatesToLoad) {

@ -1,4 +1,4 @@
<button id="new_post" class="btn btn-primary btn-large">New Topic</button>
<button id="new_post" class="btn btn-primary btn-large {show_topic_button}">New Topic</button>
<ul class="topic-container">
<!-- BEGIN topics -->
<a href="../../topic/{topics.slug}"><li class="topic-row">

@ -1,5 +1,8 @@
{
"custom_mapping": {
"users": "account"
"users": "account",
"latest": "category",
"popular": "category",
"active": "category"
}
}

@ -27,15 +27,15 @@
</button>
<div class="nav-collapse collapse">
<ul class="nav">
<li id="fat-menu" class="active dropdown">
<a href="#" id="topic_dropdown" role="button" class="dropdown-toggle" data-toggle="dropdown">Topics <span class="badge badge-inverse">3</span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="topic_dropdown">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">latest post</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">another latest post</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#">moar latest posts</a></li>
</ul>
<li>
<a href="/latest">Recent <span class="badge badge-inverse">3</span></a>
</li>
<li>
<a href="/popular">Popular</a>
</li>
<li>
<a href="/active">Active</a>
</li>
</ul>
<ul class="nav pull-right" id="right-menu">
<li><a href="/users" id="user_label"></a></li>

@ -66,7 +66,11 @@ var RDB = require('./redis.js'),
});
}
callback({'category_id': category_id, 'topics': topics});
callback({
'show_topic_button' : category_id ? 'show' : 'hidden',
'category_id': category_id,
'topics': topics
});
});

@ -125,7 +125,7 @@ passport.deserializeUser(function(uid, done) {
// 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', 'account'];
var routes = ['', 'login', 'register', 'account', 'latest', 'popular', 'active'];
for (var i=0, ii=routes.length; i<ii; i++) {
(function(route) {
@ -192,10 +192,24 @@ passport.deserializeUser(function(uid, done) {
break;
case 'category' :
global.modules.topics.get(function(data) {
console.log(data);
res.send(JSON.stringify(data));
}, req.params.id);
break;
case 'latest' :
global.modules.topics.get(function(data) {
res.send(JSON.stringify(data));
});
break;
case 'popular' :
global.modules.topics.get(function(data) {
res.send(JSON.stringify(data));
});
break;
case 'active' :
global.modules.topics.get(function(data) {
res.send(JSON.stringify(data));
});
break;
case 'users' :
get_account_fn(req, res, function(userData) {
res.send(JSON.stringify(userData));

Loading…
Cancel
Save