Harej has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/318491

Change subject: Merge "Clean up css classes as .mw-ck-whatever-stuff"
......................................................................

Merge "Clean up css classes as .mw-ck-whatever-stuff"

Change-Id: Ibe6382d8a09a4c184eee8b91d9abecfa79161aea
---
M CollaborationKit.hooks.php
M includes/content/CollaborationHubContent.php
2 files changed, 14 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/91/318491/1

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index d89ce7b..a1e16e1 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -97,6 +97,7 @@
 
                if ( $parentHub
                        && $out->getProperty( 'CollaborationHubSubpage' ) === 
'in-progress'
+                       && count( Revision::newFromTitle( $parentHub 
)->getContent()->getContent() ) > 0
                ) {
                        $toc = new CollaborationHubTOC();
                        $out->prependHtml( $toc->renderSubpageToC( $parentHub ) 
);
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index d093be8..a8408a0 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -248,17 +248,25 @@
                                $this->getParsedAnnouncements( $title, $options 
)
                        );
                        // get table of contents
-                       $html .= Html::rawElement(
-                               'div',
-                               [ 'class' => 'mw-ck-hub-toc' ],
-                               $this->getTableOfContents( $title, $options )
-                       );
+                       if ( count( $this->getContent() ) > 0 ) {
+                               $html .= Html::rawElement(
+                                       'div',
+                                       [ 'class' => 'mw-ck-hub-toc' ],
+                                       $this->getTableOfContents( $title, 
$options )
+                               );
+                       }
+
+                       $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
                        // get transcluded content
                        $html .= Html::rawElement(
                                'div',
                                [ 'class' => 'mw-ck-hub-content' ],
                                $this->getParsedContent( $title, $options, 
$output )
                        );
+
+                       $html .= Html::element( 'div', [ 'style' => 
'clear:both' ] );
+
                        // get footer
                        $html .= Html::rawElement(
                                'div',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe6382d8a09a4c184eee8b91d9abecfa79161aea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Harej <jamesmh...@gmail.com>

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

Reply via email to