diff --git a/www/admin/app-admin.less b/www/admin/app-admin.less index 10e178308..eb2a8c0f8 100644 --- a/www/admin/app-admin.less +++ b/www/admin/app-admin.less @@ -23,5 +23,26 @@ display: flex; flex-flow: column; } + + .cp-support-list-actions { + margin: 10px 0px 10px 2px; + } + .cp-support-list-message { + &:last-child:not(.cp-support-fromadmin) { + color: @colortheme_cp-red; + background-color: lighten(@colortheme_cp-red, 25%); + .cp-support-showdata { + background-color: lighten(@colortheme_cp-red, 30%); + } + } + } + + .cp-support-fromadmin { + color: @colortheme_logo-2; + background-color: #FFF; + .cp-support-message-content { + color: @colortheme_logo-2; + } + } } diff --git a/www/common/outer/userObject.js b/www/common/outer/userObject.js index 5a2693fd9..004018c12 100644 --- a/www/common/outer/userObject.js +++ b/www/common/outer/userObject.js @@ -438,14 +438,24 @@ define([ parentEl.push(id); return; } - // Add to root if path is ROOT or if no path + // Add to root if no path var filesList = exp.getFiles([ROOT, TRASH, 'hrefArray']); - if (path && exp.isPathIn(newPath, [ROOT]) || filesList.indexOf(id) === -1) { - parentEl = exp.find(newPath || [ROOT]); + if (filesList.indexOf(id) === -1 && !newPath) { + newPath = [ROOT]; + } + // Add to root + if (path && exp.isPathIn(newPath, [ROOT])) { + var parentEl = exp.find(newPath); if (parentEl) { var newName = exp.getAvailableName(parentEl, Hash.createChannelId()); parentEl[newName] = id; return; + } else { + parentEl = exp.find([ROOT]); + newPath.slice(1).forEach(function (folderName) { + parentEl = parentEl[folderName] = parentEl[folderName] || {}; + }); + parentEl[Hash.createChannelId()] = id; } } }; diff --git a/www/support/ui.js b/www/support/ui.js index 42ee89c94..c008e219c 100644 --- a/www/support/ui.js +++ b/www/support/ui.js @@ -170,7 +170,9 @@ define([ var privateData = metadataMgr.getPrivateData(); // Check content.sender to see if it comes from us or from an admin - var fromMe = content.sender && content.sender.edPublic === privateData.edPublic; + var senderKey = content.sender && content.sender.edPublic; + var fromMe = senderKey === privateData.edPublic; + var fromAdmin = ctx.adminKeys.indexOf(senderKey) !== -1; var userData = h('div.cp-support-showdata', [ Messages.support_showData, @@ -183,7 +185,7 @@ define([ }); var name = Util.fixHTML(content.sender.name) || Messages.anonymous; - return h('div.cp-support-list-message', { + return h('div.cp-support-list-message' + (fromAdmin? '.cp-support-fromadmin': ''), { 'data-hash': hash }, [ h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [ @@ -219,6 +221,7 @@ define([ common: common, isAdmin: isAdmin, pinUsage: pinUsage || false, + adminKeys: Array.isArray(ApiConfig.adminKeys)? ApiConfig.adminKeys.slice(): [], }; ui.sendForm = function (id, form, dest) {