From ecd35774b185913caadea160a1ab10776b325636 Mon Sep 17 00:00:00 2001 From: bwang Date: Wed, 13 Oct 2021 14:19:34 -0500 Subject: [PATCH] Generate Minerva search HTML with SkinMustache data Bug: T290525 Depends-on: I175ae29310a7432212a7b9c1c68dac9923665536 Change-Id: I53ea154b815a52e1e2e80a2e7b7114e310e74d47 --- includes/Skins/MinervaTemplate.php | 14 -------------- includes/Skins/skin.mustache | 20 +++++++++++++++----- skin.json | 2 +- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/includes/Skins/MinervaTemplate.php b/includes/Skins/MinervaTemplate.php index eebbfa7a9..49d647049 100644 --- a/includes/Skins/MinervaTemplate.php +++ b/includes/Skins/MinervaTemplate.php @@ -194,20 +194,7 @@ class MinervaTemplate extends BaseTemplate { // prepare template data return [ 'banners' => $data['banners'], - 'wgScript' => $data['wgScript'], 'isAnon' => $data['username'] === null, - 'search' => $data['search'], - // A button when clicked will submit the form - // This is used so that on tablet devices with JS disabled the search button - // passes the value of input to the search - // We avoid using input[type=submit] as these cannot be easily styled as mediawiki ui icons - // which is problematic in Opera Mini (see T140490) - 'searchButton' => Html::rawElement( 'button', [ - 'id' => 'searchIcon', - 'class' => MinervaUI::iconClass( - 'search-base20', 'element', 'skin-minerva-search-trigger', 'wikimedia' - ) - ], wfMessage( 'searchbutton' )->escaped() ), 'userNotificationsHTML' => $data['userNotificationsHTML'] ?? '', 'data-main-menu' => $this->getMainMenuData( $data ), 'hasheadingholder' => $hasHeadingHolder, @@ -230,7 +217,6 @@ class MinervaTemplate extends BaseTemplate { $skinOptions->get( SkinOptions::TALK_AT_TOP ) ? [ 'items' => array_values( $data['content_navigation']['namespaces'] ), ] : false, - 'searchPageTitle' => $this->getSkin()->getSearchPageTitle(), ]; } diff --git a/includes/Skins/skin.mustache b/includes/Skins/skin.mustache index 2b7e204d3..c2bba6f05 100644 --- a/includes/Skins/skin.mustache +++ b/includes/Skins/skin.mustache @@ -2,7 +2,8 @@
-
+ {{#data-search-box}} +
+ {{/data-search-box}}