jenkins-bot has submitted this change and it was merged. 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, 28 insertions(+), 24 deletions(-) Approvals: Jdlrobson: Looks good to me, approved jenkins-bot: Verified 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 9966389..d09955e 100644 --- a/includes/views/CollectionItemCard.php +++ b/includes/views/CollectionItemCard.php @@ -53,9 +53,9 @@ $img . Html::closeElement( 'a' ); } - $html = Html::openElement( 'div', array( 'class' => 'collection-item' ) ) . + $html = Html::openElement( 'div', array( 'class' => 'collection-card' ) ) . $img . - 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 @@ -66,10 +66,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 6ea2635..ae0b5ae 100644 --- a/resources/ext.gather.styles/collections.less +++ b/resources/ext.gather.styles/collections.less @@ -16,6 +16,21 @@ } } + +/** + * Common components to Collection page and List of collections page. + */ + +.collections-pagination { + text-align: center; +} + +.collection-card { + // Don't split items between css columns + display: inline-block; + width: 100%; +} + /* * Collection page */ @@ -79,7 +94,7 @@ } } - .collection-item { + .collection-card { @collectionItemPadding: 1em; border: 1px solid @grayLightest; @@ -92,7 +107,7 @@ background-size: cover; } - .collection-item-title { + .collection-card-title { font-size: 2em; padding-bottom: 0; .reset-special-page-heading-styles(); @@ -106,7 +121,7 @@ } } - .collection-item-footer { + .collection-card-footer { // Make footer run to edges margin: 1em -@collectionItemPadding 0; padding: @collectionItemPadding; @@ -202,23 +217,12 @@ } /** - * Common components (pagination, tablet columns, etc) + * Tablet styles */ -.collections-pagination { - text-align: center; -} - -.collection-item, -.collection-card { - // Don't split items between css columns - display: inline-block; - width: 100%; -} - +// Cards responsive behavior @columns: 2; @media all and (min-width: @wgMFDeviceWidthTablet) { - .collection-items, .collection-cards { -webkit-columns: @columns; -moz-columns: @columns; 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: merged Gerrit-Change-Id: I681c52a03a6efb6e3423caece0f52a2421b27313 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Gather Gerrit-Branch: master Gerrit-Owner: Jhernandez <jhernan...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits