display less derpy chat list

v1.18.x
barisusakli 9 years ago
parent f71fd0a3ec
commit d2b54ae0f8

@ -113,16 +113,16 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
'<img src="' + userObj.picture + '" title="' + userObj.username +'" />' : '<img src="' + userObj.picture + '" title="' + userObj.username +'" />' :
'<div class="user-icon" style="background-color: ' + userObj['icon:bgColor'] + '">' + userObj['icon:text'] + '</div>') + '<div class="user-icon" style="background-color: ' + userObj['icon:bgColor'] + '">' + userObj['icon:text'] + '</div>') +
'<i class="fa fa-circle status ' + userObj.status + '"></i> ' + '<i class="fa fa-circle status ' + userObj.status + '"></i> ' +
userObj.username + '</a>'; roomObj.usernames + '</a>';
} }
dropdownEl = $('<li class="' + (roomObj.unread ? 'unread' : '') + '"/>') dropdownEl = $('<li class="' + (roomObj.unread ? 'unread' : '') + '"/>')
.attr('data-roomId', roomObj.roomId) .attr('data-roomId', roomObj.roomId)
.appendTo(chatsListEl); .appendTo(chatsListEl);
roomObj.users.forEach(function(userObj) { if (roomObj.lastUser) {
dropdownEl.append(createUserImage(userObj)); dropdownEl.append(createUserImage(roomObj.lastUser));
}); }
dropdownEl.click(function() { dropdownEl.click(function() {
if (!ajaxify.currentPage.match(/^chats\//)) { if (!ajaxify.currentPage.match(/^chats\//)) {

@ -68,7 +68,7 @@ chatsController.get = function(req, res, callback) {
data.rooms = recentChats.rooms; data.rooms = recentChats.rooms;
data.nextStart = recentChats.nextStart; data.nextStart = recentChats.nextStart;
data.title = '[[pages:chat, ' + data.usernames + ']]'; 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); res.render('chats', data);
}); });

@ -288,6 +288,10 @@ var async = require('async'),
data.users = data.users.filter(function(user) { data.users = data.users.filter(function(user) {
return user && parseInt(user.uid, 10); return user && parseInt(user.uid, 10);
}); });
data.lastUser = data.users[0];
data.usernames = data.users.map(function(user) {
return user.username;
}).join(', ');
return data; return data;
}); });

Loading…
Cancel
Save