mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 23:52:58 +01:00
display less derpy chat list
This commit is contained in:
@@ -113,16 +113,16 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
||||
'<img src="' + userObj.picture + '" title="' + userObj.username +'" />' :
|
||||
'<div class="user-icon" style="background-color: ' + userObj['icon:bgColor'] + '">' + userObj['icon:text'] + '</div>') +
|
||||
'<i class="fa fa-circle status ' + userObj.status + '"></i> ' +
|
||||
userObj.username + '</a>';
|
||||
roomObj.usernames + '</a>';
|
||||
}
|
||||
|
||||
dropdownEl = $('<li class="' + (roomObj.unread ? 'unread' : '') + '"/>')
|
||||
.attr('data-roomId', roomObj.roomId)
|
||||
.appendTo(chatsListEl);
|
||||
|
||||
roomObj.users.forEach(function(userObj) {
|
||||
dropdownEl.append(createUserImage(userObj));
|
||||
});
|
||||
if (roomObj.lastUser) {
|
||||
dropdownEl.append(createUserImage(roomObj.lastUser));
|
||||
}
|
||||
|
||||
dropdownEl.click(function() {
|
||||
if (!ajaxify.currentPage.match(/^chats\//)) {
|
||||
|
||||
@@ -68,7 +68,7 @@ chatsController.get = function(req, res, callback) {
|
||||
data.rooms = recentChats.rooms;
|
||||
data.nextStart = recentChats.nextStart;
|
||||
data.title = '[[pages:chat, ' + data.usernames + ']]';
|
||||
data.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[pages:chats]]', url: '/chats'}, {text: data.usernames}]);
|
||||
data.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[pages:chats]]', url: '/chats'}, {text: data.roomId}]);
|
||||
|
||||
res.render('chats', data);
|
||||
});
|
||||
|
||||
@@ -224,7 +224,7 @@ var async = require('async'),
|
||||
} else {
|
||||
next(null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -288,6 +288,10 @@ var async = require('async'),
|
||||
data.users = data.users.filter(function(user) {
|
||||
return user && parseInt(user.uid, 10);
|
||||
});
|
||||
data.lastUser = data.users[0];
|
||||
data.usernames = data.users.map(function(user) {
|
||||
return user.username;
|
||||
}).join(', ');
|
||||
return data;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user