Skip to content

Commit

Permalink
HACK Vector skin hack to hide redundant login btn
Browse files Browse the repository at this point in the history
The user links menu ("..." on the upper right) has a redundant login
button inside it. There's a login button in the overflow menu next to it
that's more visible. I've set this login button to be uncollapsible, so
it should always be visible even on small screens. So we just need to
hide the user links menu for unsigned in users.
  • Loading branch information
ionparticle committed Nov 8, 2023
1 parent 4f1863c commit 4b3aa8d
Show file tree
Hide file tree
Showing 3 changed files with 948 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ COPY ./extensions/DynamicPageList/includes/Query.php /var/www/html/extensions/Dy
# TODO: Remove if >REL1_40, as this is a backport from Vector REL1_40
# Add login button next to "..." menu in top-right corner
COPY skins/Vector/includes/Hooks.php /var/www/html/skins/Vector/includes/Hooks.php
COPY skins/Vector/includes/SkinVector.php /var/www/html/skins/Vector/includes/SkinVector.php

# composer.local.json merges in composer.json from caliper extension, so we
# need to run composer update after getting the extensions.
Expand Down
6 changes: 5 additions & 1 deletion skins/Vector/includes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,16 @@ private static function updateUserLinksOverflowItems( $sk, &$content_navigation
'icon' => '',
] );
}
# TODO: remove customization after 1.40+
# ubc custom: backport from 1.40, add login button to the overflow menu
# we're hiding the user links button, so the login button cannot be
# allowed to collapse
if ( isset( $content_navigation['user-menu']['login'] ) ) {
$content_navigation[$overflow]['login'] = array_merge(
$content_navigation['user-menu']['login'], [
'id' => 'pt-login-2',
'button' => true,
'collapsible' => true,
'collapsible' => false,
// Remove icon
//'icon' => '',
] );
Expand Down
Loading

0 comments on commit 4b3aa8d

Please sign in to comment.