From 1ecb61fe852d45b405c980be3ed3365f3c931dec Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 24 Jan 2020 10:30:23 -0500 Subject: [PATCH 1/2] put an ugly red border on support thread messages from admins --- www/admin/app-admin.less | 3 +++ www/support/ui.js | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/www/admin/app-admin.less b/www/admin/app-admin.less index 10e178308..e9ba67325 100644 --- a/www/admin/app-admin.less +++ b/www/admin/app-admin.less @@ -23,5 +23,8 @@ display: flex; flex-flow: column; } + .cp-support-fromadmin { + border: 1px solid red !important; // XXX + } } 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) { From 9a53b3b9fd69d03e1f1f2341bcc9b8dec0f3b171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Benqu=C3=A9?= Date: Fri, 24 Jan 2020 16:52:44 +0000 Subject: [PATCH 2/2] style messages - blue text for messages from admins - red text and background for messages needing a response. --- www/admin/app-admin.less | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/www/admin/app-admin.less b/www/admin/app-admin.less index e9ba67325..eb2a8c0f8 100644 --- a/www/admin/app-admin.less +++ b/www/admin/app-admin.less @@ -23,8 +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 { - border: 1px solid red !important; // XXX + color: @colortheme_logo-2; + background-color: #FFF; + .cp-support-message-content { + color: @colortheme_logo-2; + } } }