mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 13:57:24 +02:00
decimal places for rep and post count
This commit is contained in:
@@ -28,11 +28,11 @@
|
||||
<br/>
|
||||
|
||||
<span class="account-bio-label">reputation</span>
|
||||
<span>{user.reputation}</span>
|
||||
<span id='reputation'>{user.reputation}</span>
|
||||
<br/>
|
||||
|
||||
<span class="account-bio-label">posts</span>
|
||||
<span>{user.postcount}</span>
|
||||
<span id='postcount'>{user.postcount}</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -47,6 +47,20 @@
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
// ...
|
||||
|
||||
function addCommas(text) {
|
||||
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var rep = $('#reputation');
|
||||
rep.html(addCommas(rep.html()));
|
||||
|
||||
var postcount = $('#postcount');
|
||||
postcount.html(addCommas(postcount.html()));
|
||||
|
||||
});
|
||||
|
||||
|
||||
}());
|
||||
</script>
|
||||
@@ -11,15 +11,35 @@
|
||||
<a href="/users/{users.username}">{users.username}</a>
|
||||
<br/>
|
||||
<div title="reputation">
|
||||
<span>{users.reputation}</span>
|
||||
<span id='reputation'>{users.reputation}</span>
|
||||
<i class='icon-star'></i>
|
||||
</div>
|
||||
<div title="post count">
|
||||
<span>{users.postcount}</span>
|
||||
<span id='postcount'>{users.postcount}</span>
|
||||
<i class='icon-pencil'></i>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- END users -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
function addCommas(text) {
|
||||
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var rep = $('#reputation');
|
||||
rep.html(addCommas(rep.html()));
|
||||
|
||||
var postcount = $('#postcount');
|
||||
postcount.html(addCommas(postcount.html()));
|
||||
|
||||
});
|
||||
|
||||
|
||||
}());
|
||||
</script>
|
||||
@@ -436,7 +436,8 @@ passport.deserializeUser(function(uid, done) {
|
||||
|
||||
user.getUserData(uid, function(data) {
|
||||
if(data) {
|
||||
res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("users/'+data.username + '");});</script>' + templates['footer']);
|
||||
//res.send(templates['header'] + '<script>templates.ready(function(){ajaxify.go("users/'+data.username + '");});</script>' + templates['footer']);
|
||||
res.send(templates['header'] + create_route('users/'+data.username,'users') + templates['footer']);
|
||||
}
|
||||
else {
|
||||
res.send("User doesn't exist! /users/"+req.params.username);
|
||||
|
||||
Reference in New Issue
Block a user