Skip to content

Commit

Permalink
Mentions: Show initials when no picture for contact
Browse files Browse the repository at this point in the history
  • Loading branch information
Molkobain committed Apr 5, 2021
1 parent 8b25679 commit 5fa2caa
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion application/utils.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2581,7 +2581,7 @@ public static function GetCkeditorPref()
$sMentionItemUrl = utils::GetAbsoluteUrlAppRoot().'pages/UI.php?operation=details&class='.$sMentionClass.'&id={id}';

$sMentionItemPictureTemplate = (empty(MetaModel::GetImageAttributeCode($sMentionClass))) ? '' : <<<HTML
<span class="ibo-vendors-ckeditor--autocomplete-item-image" style="background-image: url('{picture_url}');"></span>
<span class="ibo-vendors-ckeditor--autocomplete-item-image" style="background-image: url('{picture_url}');">{initials}</span>
HTML;
$sMentionItemTemplate = <<<HTML
<li class="ibo-vendors-ckeditor--autocomplete-item" data-id="{id}">{$sMentionItemPictureTemplate}<span class="ibo-vendors-ckeditor--autocomplete-item-title">{friendlyname}</span></li>
Expand Down
20 changes: 11 additions & 9 deletions css/backoffice/vendors/_ckeditor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,17 @@ ul.cke_autocomplete_panel{
align-items: center;
}
.ibo-vendors-ckeditor--autocomplete-item-image{
width: $ibo-vendors-ckeditor--autocomplete-item-image--size;
height: $ibo-vendors-ckeditor--autocomplete-item-image--size;
background-position: center center;
background-size: 100%;
border-radius: 100%;
margin-right: $ibo-vendors-ckeditor--autocomplete-item-image--margin-right;
background-color: $ibo-vendors-ckeditor--autocomplete-item-image--background-color;
border: $ibo-vendors-ckeditor--autocomplete-item-image--border;
}
width: $ibo-vendors-ckeditor--autocomplete-item-image--size;
height: $ibo-vendors-ckeditor--autocomplete-item-image--size;
background-position: center center;
background-size: 100%;
border-radius: 100%;
margin-right: $ibo-vendors-ckeditor--autocomplete-item-image--margin-right;
background-color: $ibo-vendors-ckeditor--autocomplete-item-image--background-color;
border: $ibo-vendors-ckeditor--autocomplete-item-image--border;

@extend %ibo-fully-centered-content;
}
.ibo-vendors-ckeditor--autocomplete-item-title{
color: $ibo-vendors-ckeditor--autocomplete-item-title--text-color;
@extend %ibo-font-ral-bol-100;
Expand Down
Loading

0 comments on commit 5fa2caa

Please sign in to comment.