Show the current displayed team in the leftside menu

pull/1/head
yflory 5 years ago
parent 123794fe99
commit 5dbc06633a

@ -49,6 +49,23 @@
} }
} }
.cp-team-cat-header {
.avatar_main(30px);
.cp-avatar {
justify-content: center;
font-size: 20px;
}
media-tag {
order: -1;
margin-right: 3px;
}
cursor: default !important;
font-size: 18px;
&:hover {
background-color: transparent !important;
}
}
.cp-team-list { .cp-team-list {
.cp-team-list-container { .cp-team-list-container {
display: flex; display: flex;

@ -145,6 +145,23 @@ define([
var categories = team ? teamCategories : mainCategories; var categories = team ? teamCategories : mainCategories;
var active = team ? 'drive' : 'list'; var active = team ? 'drive' : 'list';
if (team && APP.team) {
var $category = $('<div>', {'class': 'cp-sidebarlayout-category cp-team-cat-header'}).appendTo($categories);
var avatar = h('div.cp-avatar');
var $avatar = $(avatar);
APP.module.execCommand('GET_TEAM_METADATA', {
teamId: APP.team
}, function (obj) {
if (obj && obj.error) {
return void UI.warn(Messages.error);
}
var val = obj.avatar;
common.displayAvatar($avatar, obj.avatar, obj.name);
$category.append($avatar);
$avatar.append(obj.name);
});
}
Object.keys(categories).forEach(function (key) { Object.keys(categories).forEach(function (key) {
if (key === 'admin' && !teamAdmin) { return; } if (key === 'admin' && !teamAdmin) { return; }

Loading…
Cancel
Save