diff --git a/CHANGELOG.md b/CHANGELOG.md index 057fd8c..3763a51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Stanford News +8.x-2.7 +-------------------------------------------------------------------------------- +_Release Date: 2020-11-06_ + +- D8CORE-2720 User card display mode for the views (#103) (10433ea) + 8.x-2.6 -------------------------------------------------------------------------------- _Release Date: 2020-10-05_ diff --git a/composer.json b/composer.json index 18c6c02..deaf719 100644 --- a/composer.json +++ b/composer.json @@ -79,6 +79,7 @@ "drupal/ctools": "^3.4", "drupal/default_content": "^1.0-alpha8", "drupal/ds": "^3.5", + "drupal/element_class_formatter": "^1.3", "drupal/entity_print": "^2.1", "drupal/entity_reference_revisions": "^1.8", "drupal/field_formatter_class": "^1.3", diff --git a/config/install/core.entity_view_display.node.stanford_news.stanford_card.yml b/config/install/core.entity_view_display.node.stanford_news.stanford_card.yml new file mode 100644 index 0000000..af4406c --- /dev/null +++ b/config/install/core.entity_view_display.node.stanford_news.stanford_card.yml @@ -0,0 +1,116 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.stanford_card + - field.field.node.stanford_news.layout_builder__layout + - field.field.node.stanford_news.su_news_banner + - field.field.node.stanford_news.su_news_banner_media_caption + - field.field.node.stanford_news.su_news_byline + - field.field.node.stanford_news.su_news_components + - field.field.node.stanford_news.su_news_dek + - field.field.node.stanford_news.su_news_featured_media + - field.field.node.stanford_news.su_news_headline + - field.field.node.stanford_news.su_news_publishing_date + - field.field.node.stanford_news.su_news_source + - field.field.node.stanford_news.su_news_topics + - node.type.stanford_news + module: + - ds + - element_class_formatter + - link + - stanford_media + - user +third_party_settings: + ds: + layout: + id: pattern_news-vertical-teaser + library: null + disable_css: false + entity_classes: all_classes + settings: + pattern: + field_templates: only_content + regions: + news_vertical_teaser_image: + - su_news_featured_media + news_vertical_teaser_headline: + - node_title + news_topics: + - su_news_topics + news_source: + - su_news_source + news_url: + - 'dynamic_token_field:node-news_content_url' + fields: + 'dynamic_token_field:node-news_content_url': + plugin_id: 'dynamic_token_field:node-news_content_url' + weight: 4 + label: hidden + formatter: default + node_title: + plugin_id: node_title + weight: 1 + label: hidden + formatter: default + settings: + wrapper: '' + class: '' + link: false +id: node.stanford_news.stanford_card +targetEntityType: node +bundle: stanford_news +mode: stanford_card +content: + su_news_featured_media: + type: media_multimedia_formatter + weight: 0 + region: news_vertical_teaser_image + label: hidden + settings: + image: + image_formatter: image_style + image_formatter_image_style: su_news_list + image_formatter_responsive_image_style: full_responsive + image_formatter_view_mode: default + video: + video_formatter: entity + video_formatter_view_mode: default + other: + view_mode: default + view_mode: default + link: false + third_party_settings: { } + su_news_source: + type: link + weight: 3 + region: news_source + label: hidden + settings: + trim_length: null + url_only: true + url_plain: true + rel: '0' + target: '0' + third_party_settings: { } + su_news_topics: + type: entity_reference_list_label_class + weight: 2 + region: news_topics + label: hidden + settings: + link: true + list_type: ul + class: '' + third_party_settings: { } +hidden: + layout_builder__layout: true + layout_selection: true + links: true + su_news_banner: true + su_news_banner_media_caption: true + su_news_byline: true + su_news_components: true + su_news_dek: true + su_news_headline: true + su_news_publishing_date: true diff --git a/config/install/core.entity_view_mode.node.stanford_card.yml b/config/install/core.entity_view_mode.node.stanford_card.yml new file mode 100644 index 0000000..384a9e9 --- /dev/null +++ b/config/install/core.entity_view_mode.node.stanford_card.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.stanford_card +label: Card +targetEntityType: node +cache: true diff --git a/config/install/ds.field.news_content_url.yml b/config/install/ds.field.news_content_url.yml new file mode 100644 index 0000000..c716dd3 --- /dev/null +++ b/config/install/ds.field.news_content_url.yml @@ -0,0 +1,11 @@ +id: news_content_url +label: 'News Content URL' +ui_limit: 'stanford_news|*' +properties: + content: + value: "
[node:url]
\r\n" + format: stanford_minimal_html +type: token +type_label: 'Token field' +entities: + node: node diff --git a/config/install/views.view.stanford_news.yml b/config/install/views.view.stanford_news.yml index 2a4cd82..c5b11bd 100644 --- a/config/install/views.view.stanford_news.yml +++ b/config/install/views.view.stanford_news.yml @@ -2,6 +2,7 @@ langcode: en status: true dependencies: config: + - core.entity_view_mode.node.stanford_card - field.storage.node.su_news_dek - field.storage.node.su_news_featured_media - field.storage.node.su_news_headline @@ -19,6 +20,7 @@ dependencies: - ui_patterns_views - user - views_infinite_scroll + - views_taxonomy_term_name_depth id: stanford_news label: News module: views @@ -698,7 +700,46 @@ display: sort_asc_label: Asc sort_desc_label: Desc display_description: 'Term Block - All Results' - arguments: { } + arguments: + term_node_taxonomy_name_depth: + id: term_node_taxonomy_name_depth + table: node_field_data + field: term_node_taxonomy_name_depth + relationship: none + group_type: group + admin_label: '' + default_action: ignore + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: fixed + default_argument_options: + argument: '' + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + items_per_page: 25 + override: false + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + depth: '0' + vocabularies: + stanford_news_topics: stanford_news_topics + break_phrase: true + use_taxonomy_term_path: false + entity_type: node + plugin_id: taxonomy_index_name_depth filters: status: value: '1' @@ -856,6 +897,7 @@ display: contexts: - 'languages:language_content' - 'languages:language_interface' + - url - url.query_args - 'user.node_grants:view' - user.permissions @@ -1273,6 +1315,45 @@ display: display_extenders: { } display_description: 'Vertical Teaser Term' arguments: + term_node_taxonomy_name_depth: + id: term_node_taxonomy_name_depth + table: node_field_data + field: term_node_taxonomy_name_depth + relationship: none + group_type: group + admin_label: '' + default_action: ignore + exception: + value: all + title_enable: false + title: All + title_enable: false + title: '' + default_argument_type: fixed + default_argument_options: + argument: '' + default_argument_skip_url: false + summary_options: + base_path: '' + count: true + items_per_page: 25 + override: false + summary: + sort_order: asc + number_of_records: 0 + format: default_summary + specify_validation: false + validate: + type: none + fail: 'not found' + validate_options: { } + depth: '0' + vocabularies: + stanford_news_topics: stanford_news_topics + break_phrase: true + use_taxonomy_term_path: false + entity_type: node + plugin_id: taxonomy_index_name_depth nid: id: nid table: node_field_data @@ -1327,68 +1408,15 @@ display: columns: 3 automatic_width: false alignment: horizontal - col_class_default: false + col_class_default: true col_class_custom: flex-4-of-12 - row_class_default: false + row_class_default: true row_class_custom: 'flex-container more-news-view' row: - type: ui_patterns + type: 'entity:node' options: - default_field_elements: 0 - inline: - su_news_publishing_date: 0 - su_news_featured_media: 0 - su_news_headline: 0 - su_news_dek: 0 - su_news_topics: 0 - su_news_source: 0 - view_node: 0 - edit_node: 0 - separator: '' - hide_empty: 0 - pattern: news-vertical-teaser - variants: - media: default - lockup: a - hero: default - brandbar: default - link: default - button: default - date-stacked: default - cta: default - alert: default - card: default - pattern_mapping: - 'views_row:su_news_featured_media': - destination: news_vertical_teaser_image - weight: 0 - plugin: views_row - source: su_news_featured_media - 'views_row:su_news_source': - destination: news_source - weight: 1 - plugin: views_row - source: su_news_source - 'views_row:view_node': - destination: news_url - weight: 2 - plugin: views_row - source: view_node - 'views_row:su_news_headline': - destination: news_vertical_teaser_headline - weight: 3 - plugin: views_row - source: su_news_headline - 'views_row:su_news_topics': - destination: news_topics - weight: 4 - plugin: views_row - source: su_news_topics - 'views_row:edit_node': - destination: news_footer - weight: 5 - plugin: views_row - source: edit_node + relationship: none + view_mode: stanford_card pager: type: some options: @@ -1503,63 +1531,10 @@ display: row_class_default: false row_class_custom: 'flex-container more-news-view' row: - type: ui_patterns + type: 'entity:node' options: - default_field_elements: 0 - inline: - su_news_publishing_date: 0 - su_news_featured_media: 0 - su_news_headline: 0 - su_news_dek: 0 - su_news_topics: 0 - su_news_source: 0 - view_node: 0 - edit_node: 0 - separator: '' - hide_empty: 0 - pattern: news-vertical-teaser - variants: - media: default - lockup: a - hero: default - brandbar: default - link: default - button: default - date-stacked: default - cta: default - alert: default - card: default - pattern_mapping: - 'views_row:su_news_featured_media': - destination: news_vertical_teaser_image - weight: 0 - plugin: views_row - source: su_news_featured_media - 'views_row:view_node': - destination: news_url - weight: 1 - plugin: views_row - source: view_node - 'views_row:edit_node': - destination: news_footer - weight: 2 - plugin: views_row - source: edit_node - 'views_row:su_news_source': - destination: news_source - weight: 3 - plugin: views_row - source: su_news_source - 'views_row:su_news_headline': - destination: news_vertical_teaser_headline - weight: 4 - plugin: views_row - source: su_news_headline - 'views_row:su_news_topics': - destination: news_topics - weight: 5 - plugin: views_row - source: su_news_topics + relationship: none + view_mode: stanford_card fields: su_news_publishing_date: id: su_news_publishing_date diff --git a/dist/css/news-vertical-teaser.css b/dist/css/news-vertical-teaser.css index e7bd8d8..2644294 100644 --- a/dist/css/news-vertical-teaser.css +++ b/dist/css/news-vertical-teaser.css @@ -1 +1 @@ -.news-vertical-teaser__footer a,.stanford-news--cards>.more-link a{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;cursor:pointer;display:inline-block;border:0;font-size:2rem;font-weight:400;line-height:1;text-align:center;text-decoration:none;width:auto;-webkit-transition:background-color .25s ease-in-out,color .25s ease-in-out;transition:background-color .25s ease-in-out,color .25s ease-in-out}.news-vertical-teaser__footer a a,.stanford-news--cards>.more-link a a{font-weight:400;text-decoration:none}.news-vertical-teaser__footer a:active,.news-vertical-teaser__footer a:focus,.news-vertical-teaser__footer a:hover,.stanford-news--cards>.more-link a:active,.stanford-news--cards>.more-link a:focus,.stanford-news--cards>.more-link a:hover{text-decoration:underline}@media (max-width:991px){.stanford-news--cards .flex-container .more-news-view{display:block}.stanford-news--cards .flex-container .more-news-view .flex-4-of-12{max-width:100%}}.stanford-news--cards>.more-link{text-align:center}@media only screen and (min-width:0){.stanford-news--cards>.more-link{margin-top:4rem;margin-bottom:14.4rem}}@media only screen and (min-width:768px){.stanford-news--cards>.more-link{margin-top:4.5rem;margin-bottom:16.2rem}}@media only screen and (min-width:1500px){.stanford-news--cards>.more-link{margin-top:4.75rem;margin-bottom:17.1rem}}.stanford-news--cards>.more-link a{padding:1rem 2rem 1.15rem;background-color:#b1040e;color:#fff}.stanford-news--cards>.more-link a:focus,.stanford-news--cards>.more-link a:hover{background-color:#2e2d29;color:#fff}.stanford-news--cards>.more-link a:focus{-webkit-box-shadow:0 0 3px #4d4f53,0 0 7px #4d4f53;box-shadow:0 0 3px #4d4f53,0 0 7px #4d4f53}.more-news-view>div:nth-child(-n+3){max-width:980px;-webkit-box-flex:0;-ms-flex:none;flex:none}.more-news-view>div:first-child:nth-last-child(2),.more-news-view>div:first-child:nth-last-child(2)~div{width:45%}@media (max-width:991px){.more-news-view>div:first-child:nth-last-child(2),.more-news-view>div:first-child:nth-last-child(2)~div{width:100%}}.more-news-view>div:first-child:nth-last-child(3),.more-news-view>div:first-child:nth-last-child(3)~div{width:30%}@media (max-width:991px){.more-news-view>div:first-child:nth-last-child(3),.more-news-view>div:first-child:nth-last-child(3)~div{width:100%}}.more-news-view>div:only-of-type{margin:0 auto;-webkit-box-flex:0;-ms-flex:none;flex:none;max-width:980px;width:100%}.stanford-news-vertical-teaser-term.block-views .more-news-view>div:only-of-type{margin:unset;max-width:25%;width:100%}.su-news-vertical-teaser.su-card{margin:0 auto;max-width:980px;overflow:auto}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card{margin-bottom:3.2rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card{margin-bottom:3.6rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card{margin-bottom:3.8rem}}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-media__wrapper{margin-bottom:1.6rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-media__wrapper{margin-bottom:1.8rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-media__wrapper{margin-bottom:1.9rem}}.su-news-vertical-teaser.su-card .su-media__wrapper iframe,.su-news-vertical-teaser.su-card .su-media__wrapper img,.su-news-vertical-teaser.su-card .su-media__wrapper picture{min-width:100%;width:100%}@media only screen and (min-width:992px){.su-news-vertical-teaser.su-card .su-media__wrapper iframe{min-height:489px}}.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link{display:block}@media only screen and (max-width:767px) and (min-width:0){.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link{margin-top:2.31rem}}@media only screen and (max-width:767px) and (min-width:768px){.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link{margin-top:2.6rem}}@media only screen and (max-width:767px) and (min-width:1500px){.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link{margin-top:2.74rem}}.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link:hover h2{text-decoration:underline}.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link:focus{outline:none}.su-news-vertical-teaser.su-card .su-link{font-size:1.5625em;letter-spacing:-.012em;color:#2e2d29;display:inline-block;font-weight:700}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-link{margin-bottom:2.31rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-link{margin-bottom:2.6rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-link{margin-bottom:2.74rem}}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-link{margin-left:3.2rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-link{margin-left:3.6rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-link{margin-left:3.8rem}}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-link{margin-right:3.2rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-link{margin-right:3.6rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-link{margin-right:3.8rem}}.su-news-vertical-teaser.su-card .su-link:after{font-size:1.5625em;letter-spacing:-.012em;background-color:#b1040e}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-link:after{margin-left:1.07rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-link:after{margin-left:1.2rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-link:after{margin-left:1.27rem}}.su-news-vertical-teaser.su-card .su-link--external:after{height:1.2rem;width:1.2rem}.su-news-vertical-teaser.su-card .su-card__contents:not(.su-card--icon){padding-top:0}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics{font-size:1.8rem;line-height:1.3}@media (max-width:767px){.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics{font-size:1.6rem}}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics a{color:#b1040e;font-weight:400;text-decoration:none}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics a:focus,.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics a:hover{text-decoration:underline}.su-news-vertical-teaser.su-card:focus-within{outline:1px auto -webkit-focus-ring-color}@media only screen and (min-width:0){.news-vertical-teaser__footer{margin:2.31rem}}@media only screen and (min-width:768px){.news-vertical-teaser__footer{margin:2.6rem}}@media only screen and (min-width:1500px){.news-vertical-teaser__footer{margin:2.74rem}}.news-vertical-teaser__footer a{padding:1rem 2rem 1.15rem;background-color:#fff;-webkit-box-shadow:inset 0 0 0 2px #b1040e;box-shadow:inset 0 0 0 2px #b1040e;color:#b1040e}.news-vertical-teaser__footer a:focus,.news-vertical-teaser__footer a:hover{background-color:#fff;color:#2e2d29}.news-vertical-teaser__footer a:hover{-webkit-box-shadow:inset 0 0 0 2px #2e2d29;box-shadow:inset 0 0 0 2px #2e2d29}.news-vertical-teaser__footer a:focus{-webkit-box-shadow:inset 0 0 0 2px #2e2d29,0 0 3px #4d4f53,0 0 7px #4d4f53;box-shadow:inset 0 0 0 2px #2e2d29,0 0 3px #4d4f53,0 0 7px #4d4f53}@media only screen and (min-width:0){.stanford-news-terms--results-for{margin-bottom:4rem}}@media only screen and (min-width:768px){.stanford-news-terms--results-for{margin-bottom:4.5rem}}@media only screen and (min-width:1500px){.stanford-news-terms--results-for{margin-bottom:4.75rem}} \ No newline at end of file +.news-vertical-teaser__footer a,.stanford-news--cards>.more-link a{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Source Sans Pro,Helvetica Neue,Helvetica,Arial,sans-serif;cursor:pointer;display:inline-block;border:0;font-size:2rem;font-weight:400;line-height:1;text-align:center;text-decoration:none;width:auto;-webkit-transition:background-color .25s ease-in-out,color .25s ease-in-out;transition:background-color .25s ease-in-out,color .25s ease-in-out}.news-vertical-teaser__footer a a,.stanford-news--cards>.more-link a a{font-weight:400;text-decoration:none}.news-vertical-teaser__footer a:active,.news-vertical-teaser__footer a:focus,.news-vertical-teaser__footer a:hover,.stanford-news--cards>.more-link a:active,.stanford-news--cards>.more-link a:focus,.stanford-news--cards>.more-link a:hover{text-decoration:underline}@media (max-width:991px){.stanford-news--cards .flex-container .more-news-view{display:block}.stanford-news--cards .flex-container .more-news-view .flex-4-of-12{max-width:100%}}.stanford-news--cards>.more-link{text-align:center}@media only screen and (min-width:0){.stanford-news--cards>.more-link{margin-top:4rem;margin-bottom:14.4rem}}@media only screen and (min-width:768px){.stanford-news--cards>.more-link{margin-top:4.5rem;margin-bottom:16.2rem}}@media only screen and (min-width:1500px){.stanford-news--cards>.more-link{margin-top:4.75rem;margin-bottom:17.1rem}}.stanford-news--cards>.more-link a{padding:1rem 2rem 1.15rem;background-color:#b1040e;color:#fff}.stanford-news--cards>.more-link a:focus,.stanford-news--cards>.more-link a:hover{background-color:#2e2d29;color:#fff}.stanford-news--cards>.more-link a:focus{-webkit-box-shadow:0 0 3px #4d4f53,0 0 7px #4d4f53;box-shadow:0 0 3px #4d4f53,0 0 7px #4d4f53}.more-news-view>div:nth-child(-n+3){max-width:980px;-webkit-box-flex:0;-ms-flex:none;flex:none}.more-news-view>div:first-child:nth-last-child(2),.more-news-view>div:first-child:nth-last-child(2)~div{width:45%}@media (max-width:991px){.more-news-view>div:first-child:nth-last-child(2),.more-news-view>div:first-child:nth-last-child(2)~div{width:100%}}.more-news-view>div:first-child:nth-last-child(3),.more-news-view>div:first-child:nth-last-child(3)~div{width:30%}@media (max-width:991px){.more-news-view>div:first-child:nth-last-child(3),.more-news-view>div:first-child:nth-last-child(3)~div{width:100%}}.more-news-view>div:only-of-type{margin:0 auto;-webkit-box-flex:0;-ms-flex:none;flex:none;max-width:980px;width:100%}.stanford-news-vertical-teaser-term.block-views .more-news-view>div:only-of-type{margin:unset;max-width:25%;width:100%}.su-news-vertical-teaser.su-card{margin:0 auto;max-width:980px;overflow:auto}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card{margin-bottom:3.2rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card{margin-bottom:3.6rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card{margin-bottom:3.8rem}}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-media__wrapper{margin-bottom:1.6rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-media__wrapper{margin-bottom:1.8rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-media__wrapper{margin-bottom:1.9rem}}.su-news-vertical-teaser.su-card .su-media__wrapper iframe,.su-news-vertical-teaser.su-card .su-media__wrapper img,.su-news-vertical-teaser.su-card .su-media__wrapper picture{min-width:100%;width:100%}@media only screen and (min-width:992px){.su-news-vertical-teaser.su-card .su-media__wrapper iframe{min-height:489px}}.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link{display:block}@media only screen and (max-width:767px) and (min-width:0){.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link{margin-top:2.31rem}}@media only screen and (max-width:767px) and (min-width:768px){.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link{margin-top:2.6rem}}@media only screen and (max-width:767px) and (min-width:1500px){.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link{margin-top:2.74rem}}.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link:hover h2{text-decoration:underline}.su-news-vertical-teaser.su-card .su-news-vertical-teaser__link:focus{outline:none}.su-news-vertical-teaser.su-card .su-link{font-size:1.5625em;letter-spacing:-.012em;color:#2e2d29;display:inline-block;font-weight:700}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-link{margin-bottom:2.31rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-link{margin-bottom:2.6rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-link{margin-bottom:2.74rem}}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-link{margin-left:3.2rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-link{margin-left:3.6rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-link{margin-left:3.8rem}}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-link{margin-right:3.2rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-link{margin-right:3.6rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-link{margin-right:3.8rem}}.su-news-vertical-teaser.su-card .su-link:after{font-size:1.5625em;letter-spacing:-.012em;background-color:#b1040e}@media only screen and (min-width:0){.su-news-vertical-teaser.su-card .su-link:after{margin-left:1.07rem}}@media only screen and (min-width:768px){.su-news-vertical-teaser.su-card .su-link:after{margin-left:1.2rem}}@media only screen and (min-width:1500px){.su-news-vertical-teaser.su-card .su-link:after{margin-left:1.27rem}}.su-news-vertical-teaser.su-card .su-link--external:after{height:1.2rem;width:1.2rem}.su-news-vertical-teaser.su-card .su-card__contents:not(.su-card--icon){padding-top:0}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics{font-size:1.8rem;line-height:1.3}@media (max-width:767px){.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics{font-size:1.6rem}}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics a{color:#b1040e;font-weight:400;text-decoration:none}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics a:focus,.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics a:hover{text-decoration:underline}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics ul{list-style:none;margin:0;padding:0}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics li{display:inline-block}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics li:after{content:",";margin-right:5px}.su-news-vertical-teaser.su-card .su-card__contents .news-vertical-teaser__topics li:last-child:after{content:"";margin-right:0}.su-news-vertical-teaser.su-card:focus-within{outline:1px auto -webkit-focus-ring-color}@media only screen and (min-width:0){.news-vertical-teaser__footer{margin:2.31rem}}@media only screen and (min-width:768px){.news-vertical-teaser__footer{margin:2.6rem}}@media only screen and (min-width:1500px){.news-vertical-teaser__footer{margin:2.74rem}}.news-vertical-teaser__footer a{padding:1rem 2rem 1.15rem;background-color:#fff;-webkit-box-shadow:inset 0 0 0 2px #b1040e;box-shadow:inset 0 0 0 2px #b1040e;color:#b1040e}.news-vertical-teaser__footer a:focus,.news-vertical-teaser__footer a:hover{background-color:#fff;color:#2e2d29}.news-vertical-teaser__footer a:hover{-webkit-box-shadow:inset 0 0 0 2px #2e2d29;box-shadow:inset 0 0 0 2px #2e2d29}.news-vertical-teaser__footer a:focus{-webkit-box-shadow:inset 0 0 0 2px #2e2d29,0 0 3px #4d4f53,0 0 7px #4d4f53;box-shadow:inset 0 0 0 2px #2e2d29,0 0 3px #4d4f53,0 0 7px #4d4f53}@media only screen and (min-width:0){.stanford-news-terms--results-for{margin-bottom:4rem}}@media only screen and (min-width:768px){.stanford-news-terms--results-for{margin-bottom:4.5rem}}@media only screen and (min-width:1500px){.stanford-news-terms--results-for{margin-bottom:4.75rem}} \ No newline at end of file diff --git a/dist/js/news-list.behaviors.js b/dist/js/news-list.behaviors.js index 3d27f02..ea58725 100644 --- a/dist/js/news-list.behaviors.js +++ b/dist/js/news-list.behaviors.js @@ -1,2 +1,2 @@ -!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=4)}({4:function(e,t,n){"use strict";n.r(t);n(5)},5:function(e,t,n){window.Drupal.behaviors.stanford_news_list={attach:function(e){var t;(t=jQuery)(".news-topics__collapsable-menu",e).click(function(){t(this).toggleClass("show"),"none"!=t(this).siblings(".menu").css("display")?t(this).attr("aria-expanded","true"):t(this).attr("aria-expanded","false")})}}}}); +!function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=4)}({4:function(e,t,n){"use strict";n.r(t);t=n(5)},5:function(e,t,n){window.Drupal.behaviors.stanford_news_list={attach:function(e){var t;(t=jQuery)(".news-topics__collapsable-menu",e).click(function(){t(this).toggleClass("show"),"none"!=t(this).siblings(".menu").css("display")?t(this).attr("aria-expanded","true"):t(this).attr("aria-expanded","false")})}}}}); //# sourceMappingURL=news-list.behaviors.js.map \ No newline at end of file diff --git a/dist/js/news-node.behaviors.js b/dist/js/news-node.behaviors.js index d245da7..c8e1111 100644 --- a/dist/js/news-node.behaviors.js +++ b/dist/js/news-node.behaviors.js @@ -1,2 +1,2 @@ -!function(t){var a={};function n(e){if(a[e])return a[e].exports;var r=a[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=a,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(r,e){if(1&e&&(r=n(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var a in r)n.d(t,a,function(e){return r[e]}.bind(null,a));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r,t){"use strict";t.r(r);t(1)},function(e,r,t){window.Drupal.behaviors.stanford_news={attach:function(d){!function(e){e(".news-social-media",d).prepend(' "),e(".news-social-media",d).prepend(' "),e(".news-social-media",d).prepend(' "),e(".news-social-media",d).prepend(' "),e(".news-social-media",d).prepend(' ");var r=window.location,t=e('div[property="dc:title"] h1',d).text(),a=e(".share-sub",d).text(),n="https://twitter.com/intent/tweet?url="+encodeURI(r)+"&text="+t+" "+a,i="http://www.facebook.com/sharer.php?u="+r+"&display=popup",s="https://www.linkedin.com/shareArticle?mini=true&url="+r+"&title="+t+"&summary="+a,o="mailto:?subject="+document.title+"&body="+encodeURI(document.location);e(".share-fb",d).attr({href:i}),e(".share-twitter",d).attr({href:n}),e(".share-linkedin",d).attr({href:s}),e(".share-forward",d).attr({href:o}),e(".share-print",d).attr({onclick:"window.print();return false;"})}(jQuery)}}}]); +!function(t){var a={};function n(e){if(a[e])return a[e].exports;var r=a[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=a,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(r,e){if(1&e&&(r=n(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var a in r)n.d(t,a,function(e){return r[e]}.bind(null,a));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=0)}([function(e,r,t){"use strict";t.r(r);r=t(1)},function(e,r,t){window.Drupal.behaviors.stanford_news={attach:function(s){!function(e){e(".news-social-media",s).prepend(' "),e(".news-social-media",s).prepend(' "),e(".news-social-media",s).prepend(' "),e(".news-social-media",s).prepend(' "),e(".news-social-media",s).prepend(' ");var r=window.location,t=e('div[property="dc:title"] h1',s).text(),a=e(".share-sub",s).text(),n="https://twitter.com/intent/tweet?url="+encodeURI(r)+"&text="+t+" "+a,i="http://www.facebook.com/sharer.php?u="+r+"&display=popup",t="https://www.linkedin.com/shareArticle?mini=true&url="+r+"&title="+t+"&summary="+a,a="mailto:?subject="+document.title+"&body="+encodeURI(document.location);e(".share-fb",s).attr({href:i}),e(".share-twitter",s).attr({href:n}),e(".share-linkedin",s).attr({href:t}),e(".share-forward",s).attr({href:a}),e(".share-print",s).attr({onclick:"window.print();return false;"})}(jQuery)}}}]); //# sourceMappingURL=news-node.behaviors.js.map \ No newline at end of file diff --git a/lib/scss/components/news-vertical-teaser/_news-vertical-teaser.scss b/lib/scss/components/news-vertical-teaser/_news-vertical-teaser.scss index 82d4870..91538b0 100644 --- a/lib/scss/components/news-vertical-teaser/_news-vertical-teaser.scss +++ b/lib/scss/components/news-vertical-teaser/_news-vertical-teaser.scss @@ -164,6 +164,26 @@ text-decoration: underline; } } + + ul { + list-style: none; + @include margin(0); + @include padding(0); + } + + li { + display: inline-block; + + &::after { + content: ','; + @include margin(null 5px null null); + } + + &:last-child::after { + content: ''; + @include margin(null 0 null null); + } + } } } diff --git a/stanford_news.info.yml b/stanford_news.info.yml index 2e2b818..98b363b 100644 --- a/stanford_news.info.yml +++ b/stanford_news.info.yml @@ -3,7 +3,7 @@ type: module description: 'Stanford news items and views.' core_version_requirement: ^8.8 || ^9 package: Stanford -version: 8.x-2.6 +version: 8.x-2.7 dependencies: - allowed_formats:allowed_formats - auto_entitylabel:auto_entitylabel @@ -21,6 +21,7 @@ dependencies: - drupal:taxonomy - drupal:text - drupal:user + - element_class_formatter:element_class_formatter - entity_reference_revisions:entity_reference_revisions - field_formatter_class:field_formatter_class - field_group:field_group @@ -42,6 +43,7 @@ dependencies: - ui_patterns:ui_patterns_views - views_block_filter_block:views_block_filter_block - views_infinite_scroll:views_infinite_scroll + - views_taxonomy_term_name_depth:views_taxonomy_term_name_depth component-libraries: news: { paths: [templates/components] } diff --git a/tests/codeception/acceptance/NewsNodeCest.php b/tests/codeception/acceptance/NewsNodeCest.php index b7125f5..10097d4 100644 --- a/tests/codeception/acceptance/NewsNodeCest.php +++ b/tests/codeception/acceptance/NewsNodeCest.php @@ -57,6 +57,15 @@ public function testViewInvalidation(AcceptanceTester $I) { $I->canSee('Cache Buster', 'h2'); } + /** + * The card display mode should be available. + */ + public function testCardDisplayMode(AcceptanceTester $I){ + $I->logInWithRole('administrator'); + $I->amOnPage('/admin/structure/types/manage/stanford_news/display/stanford_card'); + $I->canSeeOptionIsSelected('Select a layout', 'News Vertical Teaser'); + } + protected function createNewsNode(AcceptanceTester $I, $node_title = NULL) { $term = $I->createEntity([ 'name' => 'Foo',