Jhernandez has uploaded a new change for review.

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

Change subject: Hygiene: Merge .collection-cards and .collection-items
......................................................................

Hygiene: Merge .collection-cards and .collection-items

And .collection-card and .collection-item.

Same concept, different style depending on .collection / .collections-list

Bug: T91384
Change-Id: I681c52a03a6efb6e3423caece0f52a2421b27313
---
M includes/views/Collection.php
M includes/views/CollectionItemCard.php
M resources/ext.gather.styles/collections.less
M resources/ext.gather.styles/vector.less
M tests/browser/features/support/pages/gather_page.rb
5 files changed, 35 insertions(+), 35 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather 
refs/changes/18/202018/1

diff --git a/includes/views/Collection.php b/includes/views/Collection.php
index e67fc9a..73f1c01 100644
--- a/includes/views/Collection.php
+++ b/includes/views/Collection.php
@@ -151,7 +151,7 @@
         * @return string HTML
         */
        public function getCollectionItems( models\Collection $collection ) {
-               $html = Html::openElement( 'div', array( 'class' => 
'collection-items' ) );
+               $html = Html::openElement( 'div', array( 'class' => 
'collection-cards' ) );
                foreach ( $collection as $item ) {
                        if ( $item->getTitle()->getNamespace() === NS_MAIN ) {
                                $view = new CollectionItemCard( $item );
diff --git a/includes/views/CollectionItemCard.php 
b/includes/views/CollectionItemCard.php
index 303f7cd..839cbfc 100644
--- a/includes/views/CollectionItemCard.php
+++ b/includes/views/CollectionItemCard.php
@@ -47,11 +47,11 @@
        protected function getHtml() {
                $item = $this->item;
                $title = $item->getTitle();
-               $html = Html::openElement( 'div', array( 'class' => 
'collection-item' ) ) .
+               $html = Html::openElement( 'div', array( 'class' => 
'collection-card' ) ) .
                        Html::openElement( 'a', array( 'href' => 
$title->getLocalUrl() ) ) .
                        $this->image->getHtml() .
                        Html::closeElement( 'a' ) .
-                       Html::openElement( 'h2', array( 'class' => 
'collection-item-title' ) ) .
+                       Html::openElement( 'h2', array( 'class' => 
'collection-card-title' ) ) .
                        Linker::link( $title ) .
                        Html::closeElement( 'h2' );
                // Handle excerpt for titles with an extract or unknown pages
@@ -62,10 +62,10 @@
                                $itemExcerpt = wfMessage( 
'gather-page-not-found' )->escaped();
                        }
                        $html .= Html::element(
-                               'p', array( 'class' => 
'collection-item-excerpt' ), $itemExcerpt
+                               'p', array( 'class' => 
'collection-card-excerpt' ), $itemExcerpt
                        );
                }
-               $html .= Html::openElement( 'div', array( 'class' => 
'collection-item-footer' ) )
+               $html .= Html::openElement( 'div', array( 'class' => 
'collection-card-footer' ) )
                        . Html::openElement( 'a',
                                array(
                                        'href' => $title->getLocalUrl(),
diff --git a/resources/ext.gather.styles/collections.less 
b/resources/ext.gather.styles/collections.less
index f409a34..02fa624 100644
--- a/resources/ext.gather.styles/collections.less
+++ b/resources/ext.gather.styles/collections.less
@@ -16,6 +16,30 @@
        }
 }
 
+
+/**
+ * Common components to Collection page and List of collections page.
+ */
+
+.collections-pagination {
+       text-align: center;
+}
+
+// Cards responsive behavior
+@columns: 2;
+@media all and (min-width: @wgMFDeviceWidthTablet) {
+       .collection-cards {
+               -webkit-columns: @columns;
+               -moz-columns: @columns;
+               columns: @columns;
+       }
+}
+.collection-card {
+       // Don't split items between css columns
+       display: inline-block;
+       width: 100%;
+}
+
 /*
  *  Collection page
  */
@@ -79,7 +103,7 @@
                }
        }
 
-       .collection-item {
+       .collection-card {
                @collectionItemPadding: 1em;
 
                border: 1px solid @grayLightest;
@@ -92,7 +116,7 @@
                        background-size: cover;
                }
 
-               .collection-item-title {
+               .collection-card-title {
                        font-size: 2em;
                        padding-bottom: 0;
                        .reset-special-page-heading-styles();
@@ -106,7 +130,7 @@
                        }
                }
 
-               .collection-item-footer {
+               .collection-card-footer {
                        // Make footer run to edges
                        margin: 1em -@collectionItemPadding 0;
                        padding: @collectionItemPadding;
@@ -199,28 +223,4 @@
                text-align: center;
        }
 
-}
-
-/**
- * Common components (pagination, tablet columns, etc)
- */
-
-.collections-pagination {
-       text-align: center;
-}
-
-@columns: 2;
-@media all and (min-width: @wgMFDeviceWidthTablet) {
-       .collection-items,
-       .collection-cards {
-               -webkit-columns: @columns;
-               -moz-columns: @columns;
-               columns: @columns;
-       }
-}
-.collection-item,
-.collection-card {
-       // Don't split items between css columns
-       display: inline-block;
-       width: 100%;
 }
diff --git a/resources/ext.gather.styles/vector.less 
b/resources/ext.gather.styles/vector.less
index 5ac2498..4caa2da 100644
--- a/resources/ext.gather.styles/vector.less
+++ b/resources/ext.gather.styles/vector.less
@@ -9,8 +9,8 @@
        }
 }
 
-.collection-item {
-       .collection-item-title {
+.collection .collection-card {
+       .collection-card-title {
                border-bottom: none;
                padding-top: 0.5em;
        }
diff --git a/tests/browser/features/support/pages/gather_page.rb 
b/tests/browser/features/support/pages/gather_page.rb
index c739103..073a2ea 100644
--- a/tests/browser/features/support/pages/gather_page.rb
+++ b/tests/browser/features/support/pages/gather_page.rb
@@ -8,6 +8,6 @@
   div(:edit_overlay, css: '.collection-editor-overlay')
   text_field(:edit_overlay_description, css: '.collection-editor-overlay 
.description')
   button(:edit_overlay_done, css: '.collection-editor-overlay .save')
-  div(:collection_items, css: '.collection-items')
+  div(:collection_items, css: '.collection-cards')
   div(:collection_description, css: '.collection-description')
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I681c52a03a6efb6e3423caece0f52a2421b27313
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to