Widget settings to show staff notes under avatar instead of in name

This commit is contained in:
Robin Ward 2018-06-20 14:40:32 -04:00
parent 4724ae1223
commit 166937b9c2
1 changed files with 15 additions and 0 deletions

View File

@ -61,6 +61,21 @@ export default {
const mobileView = api.container.lookup("site:main").mobileView;
const loc = mobileView ? "before" : "after";
api.decorateWidget(`poster-name:${loc}`, dec => {
if (dec.widget.settings.hideNotes) {
return;
}
const cfs = dec.attrs.userCustomFields || {};
if (cfs.staff_notes_count > 0) {
return dec.attach("staff-notes-icon");
}
});
api.decorateWidget(`post-avatar:after`, dec => {
if (!dec.widget.settings.showNotes) {
return;
}
const cfs = dec.attrs.userCustomFields || {};
if (cfs.staff_notes_count > 0) {
return dec.attach("staff-notes-icon");