Skip to content
Snippets Groups Projects
Commit 5ad1fb5b authored by Ron Lucke's avatar Ron Lucke
Browse files

fix #5107

parent f14a6d17
No related branches found
No related tags found
No related merge requests found
...@@ -170,11 +170,11 @@ const PersonalNotifications = { ...@@ -170,11 +170,11 @@ const PersonalNotifications = {
if (really_new > 0) { if (really_new > 0) {
$('#notification_marker') $('#notification_marker')
.data('seen', false); .data('seen', false);
$('#avatar-menu-container') $('#notification-wrapper')
.addClass('alert'); .addClass('alert');
PageLayout.title_prefix = '(!) '; PageLayout.title_prefix = '(!) ';
} else { } else {
$('#avatar-menu-container').removeClass('alert'); $('#notification-wrapper').removeClass('alert');
PageLayout.title_prefix = ''; PageLayout.title_prefix = '';
} }
if (count) { if (count) {
...@@ -227,7 +227,7 @@ const PersonalNotifications = { ...@@ -227,7 +227,7 @@ const PersonalNotifications = {
$.get(STUDIP.URLHelper.getURL('dispatch.php/jsupdater/notifications_seen')).then(time => { $.get(STUDIP.URLHelper.getURL('dispatch.php/jsupdater/notifications_seen')).then(time => {
$('#notification_marker') $('#notification_marker')
.data('lastvisit', time); .data('lastvisit', time);
$('#avatar-menu-container') $('#notification-wrapper')
.removeClass('alert'); .removeClass('alert');
}); });
......
...@@ -323,3 +323,5 @@ $color--info: $color--blue-2; ...@@ -323,3 +323,5 @@ $color--info: $color--blue-2;
$color--info-alternative: mix($color--info, $color--white, 20%); $color--info-alternative: mix($color--info, $color--white, 20%);
$color-image-placeholder-background: $color--gray-6; $color-image-placeholder-background: $color--gray-6;
$color-header-inverted: $color--white;
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#globalsearch-searchbar { #globalsearch-searchbar {
display: flex; display: flex;
align-items: center; align-items: center;
border: thin solid var(--color--font-inverted); border: thin solid var(--color--header-inverted);
border-radius: var(--border-radius-search); border-radius: var(--border-radius-search);
background-color: var(--color--brand-primary); background-color: var(--color--brand-primary);
padding: 3px 5px 2px 5px; padding: 3px 5px 2px 5px;
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
// List display // List display
#globalsearch-list { #globalsearch-list {
background-color: var(--white); background-color: var(--color--global-background);
box-shadow: 1px 1px 1px var(--light-gray-color-80); box-shadow: 1px 1px 1px var(--light-gray-color-80);
color: var(--text-color); color: var(--text-color);
display: none; display: none;
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
background-color: var(--white); background-color: var(--white);
#globalsearch-input { #globalsearch-input {
background-color: var(--white); background-color: var(--color--header-inverted);
color: var(--color--font-primary); color: var(--color--font-primary);
&::placeholder { &::placeholder {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
justify-content: space-between; justify-content: space-between;
list-style-type: none; list-style-type: none;
height: 40px; height: 40px;
gap: 20px; gap: 8px;
> li { > li {
...@@ -188,40 +188,26 @@ ...@@ -188,40 +188,26 @@
padding: 0 5px 0 0; padding: 0 5px 0 0;
} }
#avatar-menu-container { #avatar-wrapper {
display: inline-flex;
&.header_avatar_container {
align-items: end;
flex: 0;
border-radius: var(--border-radius-avatar-menu);
background-color: var(--color--global-background);
&.alert,
&.alert #notification_marker {
background-color: var(--color--warning);
color: var(--color--font-inverted);
}
}
#avatar-menu { #avatar-menu {
height: 28px; height: 30px;
width: 30px;
margin: 0; margin: 0;
z-index: 1003; z-index: 1003;
.action-menu.avatar-menu { .action-menu.avatar-menu {
z-index: 1002; z-index: 1002;
padding: 1px 1px 1px 0;
.action-menu-icon { .action-menu-icon {
height: 26px;
position: relative; position: relative;
width: 26px; height: 100%;
width: 100%;
z-index: 1; z-index: 1;
img { img {
height: 26px; height: 28px;
width: 26px; width: 28px;
border: solid 1px var(--color--header-inverted);
border-radius: var(--border-radius-avatar-menu); border-radius: var(--border-radius-avatar-menu);
} }
...@@ -233,7 +219,7 @@ ...@@ -233,7 +219,7 @@
.action-menu-content { .action-menu-content {
position: absolute; position: absolute;
top: 41px; top: 40px;
right: 0; right: 0;
background: var(--white); background: var(--white);
box-shadow: 1px 1px 1px var(--dark-gray-color-60); box-shadow: 1px 1px 1px var(--dark-gray-color-60);
...@@ -255,13 +241,6 @@ ...@@ -255,13 +241,6 @@
} }
} }
} }
#notification-container + #avatar-menu {
.action-menu-icon img {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
} }
// Fix header covering relevant other areas // Fix header covering relevant other areas
......
#notification_marker { #notification_marker {
margin-left: 0px; padding: 0 8px;
padding-left: 0px;
margin-right: 0px;
padding-right: 0px;
width: 100%; width: 100%;
height: 100%; height: 100%;
font-size: 12px;
color: var(--color--font-primary); color: var(--color--font-primary);
text-align: center; text-align: center;
line-height: 28px; line-height: 30px;
border: none; border: none;
border-radius: var(--border-radius-avatar-menu); border-radius: var(--border-radius-avatar-menu);
background-color: var(--color--global-background); background-color: var(--color--header-inverted);
&.alert {
background-color: var(--color--warning);
color: var(--color--font-inverted);
}
.count {
padding: 0 5px;
}
img {
vertical-align: middle;
margin-top: -3px;
}
} }
#notification-container { #notification-container {
$arrow-height: 10px; $arrow-height: 10px;
border-radius: var(--border-radius-avatar-menu); border-radius: var(--border-radius-avatar-menu);
$list-width: 400px; $list-width: 400px;
height: 30px;
width: 28px;
height: 28px;
color: var(--base-color); color: var(--base-color);
vertical-align: text-bottom; vertical-align: text-bottom;
position: relative; position: relative;
......
...@@ -285,7 +285,8 @@ $sidebarOut: -330px; ...@@ -285,7 +285,8 @@ $sidebarOut: -330px;
} }
#quicksearch_item, #quicksearch_item,
#avatar-menu-container, #notification-wrapper,
#avatar-wrapper,
#current-page-structure { #current-page-structure {
display: none; display: none;
} }
...@@ -302,8 +303,8 @@ $sidebarOut: -330px; ...@@ -302,8 +303,8 @@ $sidebarOut: -330px;
} }
} }
#notification-container, #notification-wrapper,
.header_avatar_container, #avatar-wrapper,
#sidebar-menu { #sidebar-menu {
display: none; display: none;
} }
...@@ -760,21 +761,6 @@ html:not(.responsive-display):not(.fullscreen-mode) { ...@@ -760,21 +761,6 @@ html:not(.responsive-display):not(.fullscreen-mode) {
line-height: 20px; line-height: 20px;
} }
#avatar-menu-container {
position: relative;
bottom: 0px;
right: 0px;
line-height: 20px !important;
#avatar-menu {
display: none;
}
&::after {
display: none !important;
}
}
#top-bar { #top-bar {
box-sizing: border-box; box-sizing: border-box;
height: $header-bar-container-height; height: $header-bar-container-height;
......
...@@ -299,6 +299,8 @@ $grid-gap: 0; ...@@ -299,6 +299,8 @@ $grid-gap: 0;
--color-image-placeholder-background: #{$color-image-placeholder-background}; --color-image-placeholder-background: #{$color-image-placeholder-background};
--color--header-inverted: #{$color-header-inverted};
--border-radius-default: #{$border-radius}; --border-radius-default: #{$border-radius};
--border-radius-avatar-menu: #{$border-radius-avatar-menu}; --border-radius-avatar-menu: #{$border-radius-avatar-menu};
--border-radius-search: #{$border-radius-search}; --border-radius-search: #{$border-radius-search};
......
...@@ -122,10 +122,9 @@ if ($navigation) { ...@@ -122,10 +122,9 @@ if ($navigation) {
<? $active = Navigation::getItem('/profile')?->isActive() ?? false; ?> <? $active = Navigation::getItem('/profile')?->isActive() ?? false; ?>
<? if ($GLOBALS['perm']->have_perm('autor')) : ?> <? if ($GLOBALS['perm']->have_perm('autor')) : ?>
<li id="avatar-menu-container"
class="header_avatar_container <?= PersonalNotifications::hasUnseenNotifications() ? 'alert' : '' ?>"
>
<? if (PersonalNotifications::isActivated()): ?> <? if (PersonalNotifications::isActivated()): ?>
<li id="notification-wrapper">
<? $notifications = PersonalNotifications::getMyNotifications() ?> <? $notifications = PersonalNotifications::getMyNotifications() ?>
<div id="notification-container" <?= count($notifications) > 0 ? ' class="hoverable"' : '' ?>> <div id="notification-container" <?= count($notifications) > 0 ? ' class="hoverable"' : '' ?>>
<button id="notification_marker" <button id="notification_marker"
...@@ -137,10 +136,12 @@ if ($navigation) { ...@@ -137,10 +136,12 @@ if ($navigation) {
aria-controls="notification-list" aria-controls="notification-list"
data-lastvisit="<?= UserConfig::get($GLOBALS['user']->id)->getValue('NOTIFICATIONS_SEEN_LAST_DATE') ?>" data-lastvisit="<?= UserConfig::get($GLOBALS['user']->id)->getValue('NOTIFICATIONS_SEEN_LAST_DATE') ?>"
<? if (count($notifications) === 0) echo 'disabled'; ?> <? if (count($notifications) === 0) echo 'disabled'; ?>
<? if (PersonalNotifications::hasUnseenNotifications()) echo 'class="alert"'; ?> class="<?= PersonalNotifications::hasUnseenNotifications() ? 'alert' : '' ?>"
aria-expanded="false" aria-expanded="false"
> >
<span class="count" aria-hidden="true"><?= count($notifications) ?></span> <span class="count" aria-hidden="true"><?= count($notifications) ?></span>
<? $icon_role = PersonalNotifications::hasUnseenNotifications() ? ICON::ROLE_INFO_ALT : ICON::ROLE_CLICKABLE ?>
<?= Icon::create('notification2', $icon_role)->asImg() ?>
</button> </button>
<input type="checkbox" id="notification_checkbox"> <input type="checkbox" id="notification_checkbox">
<div class="list below" id="notification_list"> <div class="list below" id="notification_list">
...@@ -165,9 +166,11 @@ if ($navigation) { ...@@ -165,9 +166,11 @@ if ($navigation) {
</audio> </audio>
<? endif; ?> <? endif; ?>
</div> </div>
</li>
<? endif; ?> <? endif; ?>
<? if (Navigation::hasItem('/avatar')): ?> <? if (Navigation::hasItem('/avatar')): ?>
<li id="avatar-wrapper">
<form id="avatar-menu" method="post"> <form id="avatar-menu" method="post">
<?php <?php
$action_menu = ContentGroupMenu::get(); $action_menu = ContentGroupMenu::get();
...@@ -204,9 +207,10 @@ if ($navigation) { ...@@ -204,9 +207,10 @@ if ($navigation) {
?> ?>
<?= $action_menu->render(); ?> <?= $action_menu->render(); ?>
</form> </form>
<? endif; ?>
</li> </li>
<? endif; ?> <? endif; ?>
<? endif; ?>
<? else: ?> <? else: ?>
<li> <li>
<form method="post" action="<?= URLHelper::getLink(Request::url(), ['cancel_login' => null]) ?>"> <form method="post" action="<?= URLHelper::getLink(Request::url(), ['cancel_login' => null]) ?>">
......
...@@ -55,7 +55,7 @@ test.describe('Loggin In - HTML Web Form @auth', () => { ...@@ -55,7 +55,7 @@ test.describe('Loggin In - HTML Web Form @auth', () => {
await benutzername.fill(credentials.autor.username); await benutzername.fill(credentials.autor.username);
await passwort.fill(credentials.autor.password); await passwort.fill(credentials.autor.password);
await submit.click(); await submit.click();
await expect(page.locator('#avatar-menu-container')).toBeVisible(); await expect(page.locator('#notification-wrapper')).toBeVisible();
await expect(page).toHaveURL(`${baseURL}dispatch.php/start`); await expect(page).toHaveURL(`${baseURL}dispatch.php/start`);
}); });
}); });
......
...@@ -7,7 +7,7 @@ test.describe('Logging Out', () => { ...@@ -7,7 +7,7 @@ test.describe('Logging Out', () => {
test('should take us back to the homepage', async ({ page, baseURL }) => { test('should take us back to the homepage', async ({ page, baseURL }) => {
await page.goto(baseURL); await page.goto(baseURL);
await expect(page.locator('#avatar-menu-container')).toBeVisible(); await expect(page.locator('#notification-wrapper')).toBeVisible();
await page.getByTitle('Testaccount Dozent').click(); await page.getByTitle('Testaccount Dozent').click();
await page.getByRole('link', { name: 'Logout' }).click(); await page.getByRole('link', { name: 'Logout' }).click();
await expect(page).toHaveURL(/index\.php.*logout=true/); await expect(page).toHaveURL(/index\.php.*logout=true/);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment