jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/399977 )

Change subject: Changes to portlets for greater compatibility with other skins
......................................................................


Changes to portlets for greater compatibility with other skins

Rename `pagetools` to `views`, `pageactions` to `cactions`, and
`cactions` from last commit back to `pagemisc`.
Make empty portlets available on page but hidden (display:none)
 with css class emptyPortlet, which can be removed by scripts
that add links to portlets (mw.util.addPortletLink already does
this).

Bug: T181362
Change-Id: I56d5b9df529abbdfead26cc46b8fe28935b417c3
---
M TimelessTemplate.php
M resources/screen-common.less
2 files changed, 27 insertions(+), 24 deletions(-)

Approvals:
  jenkins-bot: Verified
  Isarra: Looks good to me, approved



diff --git a/TimelessTemplate.php b/TimelessTemplate.php
index ed264ca..d17db29 100644
--- a/TimelessTemplate.php
+++ b/TimelessTemplate.php
@@ -74,7 +74,7 @@
                                                                
'timeless-namespaces'
                                                        ) .
                                                        $this->getPortlet(
-                                                               'pagetools',
+                                                               'views',
                                                                
$this->pileOfTools['page-primary'],
                                                                
'timeless-pagetools'
                                                        )
@@ -176,12 +176,14 @@
 
                if ( is_array( $content ) ) {
                        $contentText = Html::openElement( 'ul' );
-                       foreach ( $content as $key => $item ) {
-                               $contentText .= $this->makeListItem(
-                                       $key,
-                                       $item,
-                                       [ 'text-wrapper' => [ 'tag' => 'span' ] 
]
-                               );
+                       if ( count( $content ) > 0 ) {
+                               foreach ( $content as $key => $item ) {
+                                       $contentText .= $this->makeListItem(
+                                               $key,
+                                               $item,
+                                               [ 'text-wrapper' => [ 'tag' => 
'span' ] ]
+                                       );
+                               }
                        }
                        // Add in SkinTemplateToolboxEnd, if any
                        $contentText .= $hookContents;
@@ -192,7 +194,7 @@
 
                $html = Html::rawElement( 'div', [
                                'role' => 'navigation',
-                               'class' => 'mw-portlet',
+                               'class' => [ 'mw-portlet', 'emptyPortlet' => 
count( $content ) === 0 ],
                                'id' => Sanitizer::escapeId( 'p-' . $name ),
                                'title' => Linker::titleAttrib( 'p-' . $name ),
                                'aria-labelledby' => $labelId
@@ -401,22 +403,18 @@
         */
        protected function getPageToolSidebar() {
                $pageTools = '';
-               if ( count( $this->pileOfTools['page-secondary'] ) > 0 ) {
-                       $pageTools .= $this->getPortlet(
-                               'pageactions',
-                               $this->pileOfTools['page-secondary'],
-                               'timeless-pageactions'
-                       );
-               }
-               if ( count( $this->pileOfTools['user'] ) > 0 ) {
-                       $pageTools .= $this->getPortlet(
-                               'userpagetools',
-                               $this->pileOfTools['user'],
-                               'timeless-userpagetools'
-                       );
-               }
                $pageTools .= $this->getPortlet(
                        'cactions',
+                       $this->pileOfTools['page-secondary'],
+                       'timeless-pageactions'
+               );
+               $pageTools .= $this->getPortlet(
+                       'userpagetools',
+                       $this->pileOfTools['user'],
+                       'timeless-userpagetools'
+               );
+               $pageTools .= $this->getPortlet(
+                       'pagemisc',
                        $this->pileOfTools['page-tertiary'],
                        'timeless-pagemisc'
                );
diff --git a/resources/screen-common.less b/resources/screen-common.less
index a4b76c1..ed570a6 100644
--- a/resources/screen-common.less
+++ b/resources/screen-common.less
@@ -228,7 +228,7 @@
                margin-right: 1em;
        }
 }
-#p-pagetools {
+#p-views {
        float: right;
 
        li {
@@ -522,10 +522,15 @@
        margin-right: @column-right-size + 1em;
 }
 
+/* Portlets */
+.emptyPortlet {
+       display: none;
+}
+
 /* Hidden stuff */
 
 #p-namespaces h3,
-#p-pagetools h3,
+#p-views h3,
 #p-search h3 {
        .hidden;
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/399977
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I56d5b9df529abbdfead26cc46b8fe28935b417c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: Evad37 <eva...@gmail.com>
Gerrit-Reviewer: Isarra <zhoris...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to