diff --git a/assets/less/classes/header.less b/assets/less/classes/header.less index 5bb7dd4f..22e0b3a9 100644 --- a/assets/less/classes/header.less +++ b/assets/less/classes/header.less @@ -92,6 +92,7 @@ display: none; font-size: 1.6em; line-height: 1.5em; + margin-top: 4px; &-toggle:checked ~ .header__menu { display: block; @@ -185,6 +186,7 @@ display: flex; flex-direction: row-reverse; order: 3; + align-items: center; &-toggle { display: none; @@ -193,8 +195,7 @@ @media (max-width: @site-mobile-width) { display: none; width: 100%; - background: var(--header-accent-colour); - font-size: 1.1em; + margin-top: 4px; &-toggle:checked ~ .header__user { display: flex; @@ -204,6 +205,7 @@ &__avatar { width: 60px; height: 60px; + margin-left: 5px; @media (max-width: @site-mobile-width) { display: none; @@ -212,7 +214,6 @@ &__info { padding: 1px; - padding-right: 5px; display: flex; flex-direction: column; align-items: flex-end; @@ -222,6 +223,8 @@ padding: 0; display: block; width: 100%; + background: var(--header-accent-colour); + font-size: 1.1em; } } @@ -301,5 +304,35 @@ } } } + + &__button { + margin: 2px; + color: inherit; + text-decoration: none; + font-size: 1.5em; + line-height: 1.7em; + width: 32px; + height: 32px; + display: inline-flex; + align-items: center; + justify-content: center; + transition: background-color .2s; + border-radius: 4px; + + &:hover, + &:focus { + background-color: fade(#fff, 20%); + } + + &:active { + background-color: fade(#fff, 10%); + } + + @media (max-width: @site-mobile-width) { + width: 40px; + height: 40px; + font-size: 2em; + } + } } } diff --git a/misuzu.php b/misuzu.php index 140381c7..848ce915 100644 --- a/misuzu.php +++ b/misuzu.php @@ -306,9 +306,9 @@ MIG; $getUserDisplayInfo = db_prepare(' SELECT u.`user_id`, u.`username`, u.`user_background_settings`, - COALESCE(u.`user_colour`, r.`role_colour`) as `user_colour` - FROM `msz_users` as u - LEFT JOIN `msz_roles` as r + COALESCE(u.`user_colour`, r.`role_colour`) AS `user_colour` + FROM `msz_users` AS u + LEFT JOIN `msz_roles` AS r ON u.`display_role` = r.`role_id` WHERE `user_id` = :user_id '); @@ -316,7 +316,8 @@ MIG; $userDisplayInfo = $getUserDisplayInfo->execute() ? $getUserDisplayInfo->fetch(\PDO::FETCH_ASSOC) : []; if ($userDisplayInfo) { - $userDisplayInfo['comments_perms'] = perms_get_user(MSZ_PERMS_COMMENTS, $mszUserId); + $userDisplayInfo['general_perms'] = perms_get_user(MSZ_PERMS_GENERAL, $userDisplayInfo['user_id']); + $userDisplayInfo['comments_perms'] = perms_get_user(MSZ_PERMS_COMMENTS, $userDisplayInfo['user_id']); $userDisplayInfo['ban_expiration'] = user_warning_check_expiration($userDisplayInfo['user_id'], MSZ_WARN_BAN); $userDisplayInfo['silence_expiration'] = $userDisplayInfo['ban_expiration'] > 0 ? 0 : user_warning_check_expiration($userDisplayInfo['user_id'], MSZ_WARN_SILENCE); } diff --git a/templates/_layout/header.twig b/templates/_layout/header.twig index 3df4ea5b..442e051c 100644 --- a/templates/_layout/header.twig +++ b/templates/_layout/header.twig @@ -44,58 +44,96 @@ {{ input_checkbox_raw('', false, 'header__user-toggle', '', false, {'id':'toggle-mobile-header-user'}) }}