mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
breadcrumbs, and changed home in nav to 'forum'
This commit is contained in:
@@ -85,12 +85,14 @@ var socket,
|
||||
var post_window = null,
|
||||
submit_post_btn = null,
|
||||
post_title = null,
|
||||
reply_title = null,
|
||||
post_content = null;
|
||||
|
||||
|
||||
app.open_post_window = function(post_mode, id) {
|
||||
app.open_post_window = function(post_mode, id, title) {
|
||||
submit_post_btn = submit_post_btn || document.getElementById('submit_post_btn');
|
||||
post_title = post_title || document.getElementById('post_title');
|
||||
reply_title = reply_title || document.getElementById('reply_title');
|
||||
post_content = post_content || document.getElementById('post_content');
|
||||
|
||||
|
||||
@@ -98,13 +100,16 @@ var socket,
|
||||
jQuery(post_window).slideToggle(250);
|
||||
|
||||
if (post_mode == null || post_mode == 'topic') {
|
||||
post_title.style.display = 'block';
|
||||
post_title.style.display = "block";
|
||||
reply_title.style.display = "none";
|
||||
post_title.focus();
|
||||
submit_post_btn.onclick = function() {
|
||||
app.post_topic();
|
||||
}
|
||||
} else {
|
||||
post_title.style.display = 'none';
|
||||
post_title.style.display = "none";
|
||||
reply_title.style.display = "block";
|
||||
reply_title.innerHTML = 'You are replying to "' + title + '"';
|
||||
post_content.focus();
|
||||
submit_post_btn.onclick = function() {
|
||||
app.post_reply(id)
|
||||
|
||||
@@ -119,7 +119,6 @@ function load_template(callback) {
|
||||
url = (url === '') ? 'home' : url;
|
||||
|
||||
jQuery.get(API_URL + url, function(data) {
|
||||
|
||||
document.getElementById('content').innerHTML = templates[url.split('/')[0]].parse(JSON.parse(data));
|
||||
if (callback) callback();
|
||||
});
|
||||
|
||||
@@ -117,6 +117,11 @@
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
}
|
||||
#reply_title {
|
||||
font-size: 17px;
|
||||
padding-top: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -132,7 +137,7 @@
|
||||
</button>
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
<li class="active"><a href="/">Home</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>
|
||||
@@ -148,6 +153,7 @@
|
||||
<div class="post-title-container">
|
||||
<div class="container">
|
||||
<input id="post_title" placeholder="Enter your topic title here." />
|
||||
<span id="reply_title"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="post-content-container">
|
||||
@@ -172,4 +178,5 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="notification_window"></div>
|
||||
|
||||
<div class="container" id="content">
|
||||
@@ -1,3 +1,10 @@
|
||||
<div class="container">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/">Home</a> <span class="divider">/</span></li>
|
||||
<li class="active">{TOPIC_NAME}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<ul class="topic-container">
|
||||
<!-- BEGIN posts -->
|
||||
<li class="topic-row">
|
||||
@@ -11,6 +18,6 @@
|
||||
<script type="text/javascript">
|
||||
var post_reply = document.getElementById('post_reply');
|
||||
post_reply.onclick = function() {
|
||||
app.open_post_window('reply', {TOPIC_ID});
|
||||
app.open_post_window('reply', "{TOPIC_ID}", "{TOPIC_NAME}");
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -16,8 +16,8 @@ var RDB = require('./redis.js'),
|
||||
if (start == null) start = 0;
|
||||
if (end == null) end = start + 10;
|
||||
|
||||
RDB.get('tid:' + tid + ':title', function(topic_name) { //do these asynch later
|
||||
RDB.lrange('tid:' + tid + ':posts', start, end, function(pids) {
|
||||
|
||||
var content = [],
|
||||
uid = [],
|
||||
timestamp = [];
|
||||
@@ -48,14 +48,14 @@ var RDB = require('./redis.js'),
|
||||
});
|
||||
}
|
||||
|
||||
callback({'TOPIC_ID': tid, 'posts': posts});
|
||||
callback({'TOPIC_NAME':topic_name, 'TOPIC_ID': tid, 'posts': posts});
|
||||
});
|
||||
} else {
|
||||
callback({});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user