N°2847 Add tooltip to user menu picture and rework these dictionary entries

This commit is contained in:
Stephen Abello
2020-08-04 10:02:56 +02:00
parent 7264defc35
commit e22c36c503
4 changed files with 15 additions and 6 deletions

View File

@@ -387,7 +387,7 @@ Dict::Add('EN US', 'English', 'English', array(
'UI:WelcomeMenu:MyIncidents' => 'Incidents assigned to me',
'UI:AllOrganizations' => ' All Organizations ',
'UI:YourSearch' => 'Your Search',
'UI:LoggedAsMessage' => 'Hi %1$s!',
'UI:LoggedAsMessage' => 'Logged in as %1$s',
'UI:LoggedAsMessage+Admin' => 'Logged in as %1$s (Administrator)',
'UI:Button:Logoff' => 'Log off',
'UI:Button:GlobalSearch' => 'Search',

View File

@@ -24,5 +24,7 @@ Dict::Add('EN US', 'English', 'English', array(
'UI:Layout:NavigationMenu:MenuFilter:Input:Placeholder' => 'Filter...',
'UI:Layout:NavigationMenu:MenuFilter:Input:Tooltip' => 'Type your keywords to filter menus',
'UI:Layout:NavigationMenu:MenuFilter:Input:Hotkey' => 'Alt + M',
'UI:Layout:NavigationMenu:UserInfo:Picture:AltText' => 'User picture'
'UI:Layout:NavigationMenu:UserInfo:WelcomeMessage:Text' => 'Hi %1$s\!',
'UI:Layout:NavigationMenu:UserInfo:Picture:AltText' => '%1$s\'s contact picture'
));

View File

@@ -217,11 +217,12 @@ class NavigationMenu extends UIBlock
'sOrganization' => UserRights::GetContactOrganizationFriendlyname(),
'sFirstname' => UserRights::GetContactFirstname(),
'sPictureUrl' => UserRights::GetContactPicture(),
'sWelcomeMessage' => Dict::Format('UI:Layout:NavigationMenu:UserInfo:WelcomeMessage:Text', UserRights::GetContactFirstname())
];
// Logon message
$sLogonMessageDictCode = (UserRights::IsAdministrator()) ? 'UI:LoggedAsMessage' : 'UI:LoggedAsMessage';
$aData['sLogonMessage'] = Dict::Format($sLogonMessageDictCode, UserRights::GetContactFirstname());
$sLogonMessageDictCode = (UserRights::IsAdministrator()) ? 'UI:LoggedAsMessage+Admin' : 'UI:LoggedAsMessage';
$aData['sLogonMessage'] = Dict::Format($sLogonMessageDictCode, UserRights::GetContactObject()->Get('friendlyname'));
$this->aUserData = $aData;

View File

@@ -28,11 +28,17 @@
{% endif %}
<div class="ibo-navigation-menu--user-info">
<div class="ibo-navigation-menu--user-picture">
<img class="ibo-navigation-menu--user-picture--image" src="{{ oNavigationMenu.UserData.sPictureUrl }}" alt="{{ 'UI:Layout:NavigationMenu:UserInfo:Picture:AltText'|dict_s }}" />
<img class="ibo-navigation-menu--user-picture--image"
src="{{ oNavigationMenu.UserData.sPictureUrl }}"
alt="{{ 'UI:Layout:NavigationMenu:UserInfo:Picture:AltText'|dict_format(oNavigationMenu.UserData.sFirstname) }}"
data-tooltip-content="{{ oNavigationMenu.UserData.sLogonMessage }}"
data-tooltip-placement="right"
data-tooltip-distance-offset="20"
/>
</div>
<div class="ibo-navigation-menu--user-welcome-message">
<div class="ibo-navigation-menu--user-welcome-message--text">
{{ oNavigationMenu.UserData.sLogonMessage }}
{{ oNavigationMenu.UserData.sWelcomeMessage }}
<span class="ibo-navigation-menu--user-welcome-message--toggler">
<i class="fas fa-caret-down"></i>
</span>