From 5dbc06633a7ad0d6fcbf54a2259f6e1913bb6cde Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 30 Sep 2019 17:51:44 +0200 Subject: [PATCH] Show the current displayed team in the leftside menu --- www/teams/app-team.less | 17 +++++++++++++++++ www/teams/inner.js | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/www/teams/app-team.less b/www/teams/app-team.less index 633482452..41d03640a 100644 --- a/www/teams/app-team.less +++ b/www/teams/app-team.less @@ -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-container { display: flex; diff --git a/www/teams/inner.js b/www/teams/inner.js index 0b097db39..5e9bdc7a8 100644 --- a/www/teams/inner.js +++ b/www/teams/inner.js @@ -145,6 +145,23 @@ define([ var categories = team ? teamCategories : mainCategories; var active = team ? 'drive' : 'list'; + if (team && APP.team) { + var $category = $('
', {'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) { if (key === 'admin' && !teamAdmin) { return; }