Isarra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334722 )

Change subject: Remove 'add feature' caction and manage/add buttons in edit mode
......................................................................

Remove 'add feature' caction and manage/add buttons in edit mode

The 'manage project' and 'add feature' buttons on the bottom
of the page no longer appear when already editing. Same with
the add feature caction.

Bug: T149029
Change-Id: I3d0bcc72b84da39bb76e999c344254408e127b91
---
M CollaborationKit.hooks.php
M includes/content/CollaborationHubContent.php
2 files changed, 9 insertions(+), 6 deletions(-)


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

diff --git a/CollaborationKit.hooks.php b/CollaborationKit.hooks.php
index a55e95b..3650353 100644
--- a/CollaborationKit.hooks.php
+++ b/CollaborationKit.hooks.php
@@ -30,7 +30,7 @@
                                        $links['views']['edit']['class'] = 
false;
                                }
                        }
-                       if ( $title->hasContentModel( 'CollaborationHubContent' 
) ) {
+                       if ( !in_array( $request->getVal( 'action' ), [ 'edit', 
'submit' ] ) && $title->hasContentModel( 'CollaborationHubContent' ) ) {
                                // Add feature
                                $links['actions']['addnewfeature'] = [
                                        'class' => '',
diff --git a/includes/content/CollaborationHubContent.php 
b/includes/content/CollaborationHubContent.php
index 2ea7cd1..529260f 100644
--- a/includes/content/CollaborationHubContent.php
+++ b/includes/content/CollaborationHubContent.php
@@ -273,11 +273,14 @@
                                [ 'class' => 'mw-ck-hub-footer' ],
                                $this->getParsedFooter( $title, $options )
                        );
-                       $html .= Html::rawElement(
-                               'div',
-                               [ 'class' => 'mw-ck-hub-footer-actions' ],
-                               $this->getSecondFooter( $title )
-                       );
+                       if ( !$options->getIsPreview() ) {
+                               $html .= Html::rawElement(
+                                       'div',
+                                       [ 'class' => 'mw-ck-hub-footer-actions' 
],
+                                       $this->getSecondFooter( $title )
+                               );
+                       }
+
                        $html .= Html::closeElement( 'div' );
 
                        $output->setText( $html );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d0bcc72b84da39bb76e999c344254408e127b91
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra <zhoris...@gmail.com>

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

Reply via email to