Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/330359 )
Change subject: Brand beta differently ...................................................................... Brand beta differently When in beta the logo copyright-beta/copyright or the site heading will show with the text "beta" in a box to its right Bug: T152458 Change-Id: I5f3d3678264fadba792fa239d5a8b84cf5663f5e --- M includes/MobileFrontend.skin.hooks.php M includes/skins/MinervaTemplate.php M resources/skins.minerva.base.styles/ui.less 3 files changed, 25 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/59/330359/1 diff --git a/includes/MobileFrontend.skin.hooks.php b/includes/MobileFrontend.skin.hooks.php index b555978..ce68692 100644 --- a/includes/MobileFrontend.skin.hooks.php +++ b/includes/MobileFrontend.skin.hooks.php @@ -274,6 +274,17 @@ $tpl->set( 'mobile-switcher', $switcherHtml ); $tpl->set( 'footer-site-heading-html', $sitename ); + if ( $inBeta ) { + $tpl->set( 'site-heading-html', + Html::rawElement( 'span', [], + self::getSitename( true, 'copyright-beta' ) + ) . + Html::element( 'div', [ 'class' => 'beta' ], + wfMessage( 'mobile-frontend-settings-beta' ) ) + ); + } else { + $tpl->set( 'site-heading-html', $sitename ); + } $tpl->set( 'desktop-toggle', $desktopToggler ); $tpl->set( 'mobile-license', $licenseText ); $tpl->set( 'privacy', $sk->footerLink( 'mobile-frontend-privacy-link-text', 'privacypage' ) ); @@ -310,7 +321,7 @@ * contexts, for example, the footer, but not in others. See bug T95007. * @return string */ - public static function getSitename( $withPossibleTrademark = false ) { + public static function getSitename( $withPossibleTrademark = false, $logoName = 'copyright' ) { $ctx = MobileContext::singleton(); $config = $ctx->getMFConfig(); $customLogos = $config->get( 'MFCustomLogos' ); @@ -330,17 +341,22 @@ } } + // If the requested logo doesn't exist revert back to the known logo + if ( !isset( $customLogos[$logoName] ) ) { + $logoName = 'copyright'; + } + // If there's a custom site logo, use that instead of text - if ( isset( $customLogos['copyright'] ) ) { + if ( isset( $customLogos[$logoName] ) ) { $attributes = [ - 'src' => $customLogos['copyright'], + 'src' => $customLogos[$logoName], 'alt' => $footerSitename, ]; - if ( isset( $customLogos['copyright-height'] ) ) { - $attributes['height'] = $customLogos['copyright-height']; + if ( isset( $customLogos["$logoName-height"] ) ) { + $attributes['height'] = $customLogos["$logoName-height"]; } - if ( isset( $customLogos['copyright-width'] ) ) { - $attributes['width'] = $customLogos['copyright-width']; + if ( isset( $customLogos["$logoName-width"] ) ) { + $attributes['width'] = $customLogos["$logoName-width"]; } $sitename = Html::element( 'img', $attributes ); } else { diff --git a/includes/skins/MinervaTemplate.php b/includes/skins/MinervaTemplate.php index 2c0dfe1..2f6fb43 100644 --- a/includes/skins/MinervaTemplate.php +++ b/includes/skins/MinervaTemplate.php @@ -276,7 +276,7 @@ 'banners' => $data['banners'], 'headelement' => $data[ 'headelement' ], 'menuButton' => $data['menuButton'], - 'headinghtml' => $data['footer-site-heading-html'], + 'headinghtml' => $data['site-heading-html'], 'searchButton' => Html::element( 'a', [ 'href' => SpecialPage::getTitleFor( 'Search' )->getLocalURL(), 'id' => 'searchInput', diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 1bb3d5a..c38a2af 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -127,6 +127,7 @@ letter-spacing: 0.1px; color: @colorGray5; margin-left: 6px; + padding: 3px; text-transform: uppercase; } } -- To view, visit https://gerrit.wikimedia.org/r/330359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f3d3678264fadba792fa239d5a8b84cf5663f5e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: branding Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits