Merge pull request #495 from xwiki-labs/differentiate-admin-messages

Differentiate admin messages
pull/1/head
ansuz 5 years ago committed by GitHub
commit 3e3c495e82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,5 +23,26 @@
display: flex; display: flex;
flex-flow: column; 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;
}
}
} }

@ -170,7 +170,9 @@ define([
var privateData = metadataMgr.getPrivateData(); var privateData = metadataMgr.getPrivateData();
// Check content.sender to see if it comes from us or from an admin // 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', [ var userData = h('div.cp-support-showdata', [
Messages.support_showData, Messages.support_showData,
@ -183,7 +185,7 @@ define([
}); });
var name = Util.fixHTML(content.sender.name) || Messages.anonymous; 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 'data-hash': hash
}, [ }, [
h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [ h('div.cp-support-message-from' + (fromMe ? '.cp-support-fromme' : ''), [
@ -219,6 +221,7 @@ define([
common: common, common: common,
isAdmin: isAdmin, isAdmin: isAdmin,
pinUsage: pinUsage || false, pinUsage: pinUsage || false,
adminKeys: Array.isArray(ApiConfig.adminKeys)? ApiConfig.adminKeys.slice(): [],
}; };
ui.sendForm = function (id, form, dest) { ui.sendForm = function (id, form, dest) {

Loading…
Cancel
Save