diff --git a/modules/mrc_events/config/install/core.entity_view_display.node.stanford_event.default.yml b/modules/mrc_events/config/install/core.entity_view_display.node.stanford_event.default.yml index 307886e7..4930bb1d 100644 --- a/modules/mrc_events/config/install/core.entity_view_display.node.stanford_event.default.yml +++ b/modules/mrc_events/config/install/core.entity_view_display.node.stanford_event.default.yml @@ -17,15 +17,48 @@ dependencies: - field.field.node.stanford_event.field_s_event_status - field.field.node.stanford_event.field_s_event_type - field.field.node.stanford_event.field_s_event_video_recap + - image.style.large - node.type.stanford_event module: - datetime_range + - ds - image - link - telephone - text - user - video_embed_field +third_party_settings: + ds: + layout: + id: pattern_node_event + library: null + disable_css: false + entity_classes: all_classes + settings: + pattern: + field_templates: only_content + regions: + date: + - field_s_event_date + image: + - field_s_event_image + description: + - body + location: + - field_s_event_location + map: + - field_s_event_map_link + sponsor: + - field_s_event_sponsor + email: + - field_s_event_contact_email + phone: + - field_s_event_contact_phone + admission: + - field_s_event_admission + embed_video: + - field_s_event_video_recap _core: default_config_hash: '--Z_oePhErkaBTiWo881iUr_LbanS3gn3S1XXxQDkW0' id: node.stanford_event.default @@ -36,7 +69,7 @@ content: body: type: text_default weight: 4 - region: content + region: description label: hidden settings: { } third_party_settings: { } @@ -46,14 +79,14 @@ content: settings: { } third_party_settings: { } type: text_default - region: content + region: admission field_s_event_contact_email: weight: 8 label: hidden settings: { } third_party_settings: { } type: basic_string - region: content + region: email field_s_event_contact_phone: weight: 9 label: hidden @@ -61,45 +94,33 @@ content: title: '' third_party_settings: { } type: telephone_link - region: content + region: phone field_s_event_date: weight: 1 label: hidden settings: timezone_override: '' - format_type: events_date + date_format: 'l, F j, Y g:i A' separator: To third_party_settings: { } - type: daterange_default - region: content + type: daterange_custom + region: date field_s_event_image: type: image weight: 2 - region: content + region: image label: hidden settings: - image_style: '' + image_style: large image_link: '' third_party_settings: { } - field_s_event_link: - type: link - weight: 3 - region: content - label: hidden - settings: - trim_length: 80 - url_only: false - url_plain: false - rel: '' - target: '' - third_party_settings: { } field_s_event_location: weight: 5 label: hidden settings: { } third_party_settings: { } type: basic_string - region: content + region: location field_s_event_map_link: weight: 6 label: hidden @@ -111,14 +132,14 @@ content: target: '' third_party_settings: { } type: link - region: content + region: map field_s_event_sponsor: weight: 7 label: hidden settings: { } third_party_settings: { } type: basic_string - region: content + region: sponsor field_s_event_video_recap: weight: 11 label: hidden @@ -129,14 +150,11 @@ content: autoplay: false third_party_settings: { } type: video_embed_field_video - region: content - links: - weight: 0 - region: content - settings: { } - third_party_settings: { } + region: embed_video hidden: field_s_event_audience: true field_s_event_category: true + field_s_event_link: true field_s_event_status: true field_s_event_type: true + links: true diff --git a/modules/mrc_events/mrc_events.info.yml b/modules/mrc_events/mrc_events.info.yml index 520f12ee..d0d8ce35 100644 --- a/modules/mrc_events/mrc_events.info.yml +++ b/modules/mrc_events/mrc_events.info.yml @@ -15,4 +15,5 @@ dependencies: - pathauto - datetime_range - allowed_formats - - video_embed_field \ No newline at end of file + - video_embed_field + - ui_patterns_ds \ No newline at end of file diff --git a/modules/mrc_events/mrc_events.install b/modules/mrc_events/mrc_events.install index ba19d5c8..52f68386 100644 --- a/modules/mrc_events/mrc_events.install +++ b/modules/mrc_events/mrc_events.install @@ -32,3 +32,15 @@ function mrc_events_update_8001() { $path = drupal_get_path('module', 'mrc_events') . '/config/install'; stanford_mrc_update_configs(TRUE, 'all', $path); } + +/** + * Reverts the entity display. + */ +function mrc_events_update_8002() { + if (!\Drupal::moduleHandler()->moduleExists('ui_patterns_ds')) { + \Drupal::service('module_installer')->install(['ui_patterns_ds']); + } + module_load_install('stanford_mrc'); + $path = drupal_get_path('module', 'mrc_events') . '/config/install'; + stanford_mrc_update_configs(TRUE, 'all', $path); +} diff --git a/modules/mrc_events/mrc_events.module b/modules/mrc_events/mrc_events.module index 29ceee18..5e187481 100644 --- a/modules/mrc_events/mrc_events.module +++ b/modules/mrc_events/mrc_events.module @@ -6,6 +6,9 @@ */ use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\Display\EntityViewDisplayInterface; +use Drupal\node\Entity\Node; /** * Implements hook_field_widget_form_alter(). @@ -48,3 +51,14 @@ function mrc_events_node_validate_date($form, FormStateInterface $form_state) { $form_state->setValue('field_s_event_date', $date); } } + +/** + * Implements hook_entity_view_alter(). + */ +function mrc_events_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) { + // Don't show the end date on the event node page. + if ($entity instanceof Node && $entity->bundle() == 'stanford_event') { + unset($build['field_s_event_date'][0]['end_date']); + unset($build['field_s_event_date'][0]['separator']); + } +} diff --git a/themes/math_research_center/math_research_center.info.yml b/themes/math_research_center/math_research_center.info.yml index f06c537b..710ed0e3 100755 --- a/themes/math_research_center/math_research_center.info.yml +++ b/themes/math_research_center/math_research_center.info.yml @@ -7,7 +7,7 @@ version: VERSION core: 8.x libraries: - core/normalize - - math_research_center/mrc + - math_research_center/fontawesome regions: page_top: 'Page top' diff --git a/themes/math_research_center/math_research_center.libraries.yml b/themes/math_research_center/math_research_center.libraries.yml index acc9f62c..84494b40 100755 --- a/themes/math_research_center/math_research_center.libraries.yml +++ b/themes/math_research_center/math_research_center.libraries.yml @@ -87,8 +87,13 @@ # css/pattern-library/theme/print.css: { media: print } # CHANGE THE LIBRARY BELOW -mrc: - version: VERSION + +fontawesome: + version: 4.7.0 + remote: https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css + license: + name: FontAwesome + url: http://fontawesome.io/license/ css: - component: - css/components/components.css: {} + base: + https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css: {} \ No newline at end of file diff --git a/themes/math_research_center/patterns/molecules/event-card/css/event-card.css b/themes/math_research_center/patterns/molecules/event-card/css/event-card.css index f35e3e5e..e51e21d0 100644 --- a/themes/math_research_center/patterns/molecules/event-card/css/event-card.css +++ b/themes/math_research_center/patterns/molecules/event-card/css/event-card.css @@ -1,3 +1,3 @@ -.decanter-sr-only{position:absolute;left:-999em}.mrc-event-card{background:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,0.2);padding:3rem;display:block}@media screen and (min-width: 600px){.mrc-event-card{display:flex}}.mrc-event-card .mrc-event-card__img{margin-right:0}.mrc-event-card .mrc-event-card__img img{width:100%}@media screen and (min-width: 600px){.mrc-event-card .mrc-event-card__img{margin-right:30px}.mrc-event-card .mrc-event-card__img img{width:auto}}.mrc-event-card .mrc-event-card__content .mrc-event-card__date{margin:0 0 0.25em 0}.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent{flex-wrap:wrap;display:block}@media screen and (min-width: 600px){.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent{display:flex}}.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent .mrc-event-card__time{margin:0 0 0.25em 0}@media screen and (min-width: 600px){.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent .mrc-event-card__time{margin:0}.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent .mrc-event-card__time:after{content:"|";padding:0 0.25em}}.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent .mrc-event-card__location{margin-top:0}.mrc-event-card .mrc-event-card__content .mrc-event-card__title{margin-top:0} +.decanter-sr-only{position:absolute;left:-999em}.mrc-event-card{background:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,0.2);padding:3rem;display:block}@media screen and (min-width: 600px){.mrc-event-card{display:flex}}.mrc-event-card .mrc-event-card__img{margin-right:0}.mrc-event-card .mrc-event-card__img img{width:100%}@media screen and (min-width: 600px){.mrc-event-card .mrc-event-card__img{margin-right:30px}.mrc-event-card .mrc-event-card__img img{width:auto}}.mrc-event-card .mrc-event-card__content .mrc-event-card__date{margin:0 0 0.25em 0}.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent{flex-wrap:wrap;display:block}@media screen and (min-width: 600px){.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent{display:flex}}.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent .mrc-event-card__time{margin:0 0 0.25em 0}@media screen and (min-width: 600px){.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent .mrc-event-card__time{margin:0}.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent .mrc-event-card__time:after{content:"|";padding:0 0.25em}}.mrc-event-card .mrc-event-card__content .mrc-event-card__subcontent .mrc-event-card__location{margin-top:0}.mrc-event-card .mrc-event-card__content .mrc-event-card__title{margin-top:0.5em} /*# sourceMappingURL=event-card.css.map */ \ No newline at end of file diff --git a/themes/math_research_center/patterns/molecules/event-card/event-card.ui_patterns.yml b/themes/math_research_center/patterns/molecules/event-card/event-card.ui_patterns.yml index cbe1e219..86095711 100644 --- a/themes/math_research_center/patterns/molecules/event-card/event-card.ui_patterns.yml +++ b/themes/math_research_center/patterns/molecules/event-card/event-card.ui_patterns.yml @@ -4,7 +4,7 @@ event_card: fields: title: label: "Title" - preview: "Card Title" + preview: "Card Title" image: label: "Image" preview: @@ -25,4 +25,4 @@ event_card: css: component: css/event-card.css: {} - use: "@math_research_center/molecules/event-card/event-card.html.twig" \ No newline at end of file + use: "@math_research_center/molecules/event-card/event-card.html.twig" diff --git a/themes/math_research_center/patterns/molecules/event-card/scss/event-card.scss b/themes/math_research_center/patterns/molecules/event-card/scss/event-card.scss index ddbeb01d..fbc99fa2 100644 --- a/themes/math_research_center/patterns/molecules/event-card/scss/event-card.scss +++ b/themes/math_research_center/patterns/molecules/event-card/scss/event-card.scss @@ -63,7 +63,7 @@ } .mrc-event-card__title { - margin-top: 0; + margin-top: 0.5em; } } } diff --git a/themes/math_research_center/patterns/molecules/featured-event-card/css/featured-event-card.css b/themes/math_research_center/patterns/molecules/featured-event-card/css/featured-event-card.css index 4cce40a9..00b3e5e0 100644 --- a/themes/math_research_center/patterns/molecules/featured-event-card/css/featured-event-card.css +++ b/themes/math_research_center/patterns/molecules/featured-event-card/css/featured-event-card.css @@ -1,3 +1,3 @@ -.decanter-sr-only{position:absolute;left:-999em}.mrc-featured-event-card{background:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,0.2);padding:3rem;display:block}@media screen and (min-width: 600px){.mrc-featured-event-card{display:flex}}.mrc-featured-event-card .mrc-featured-event-card__img{margin-right:0}.mrc-featured-event-card .mrc-featured-event-card__img img{width:100%}@media screen and (min-width: 600px){.mrc-featured-event-card .mrc-featured-event-card__img{margin-right:30px}.mrc-featured-event-card .mrc-featured-event-card__img img{width:auto}}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__date{color:#fff;background:#2e2d29;height:75px;width:75px;text-align:center}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__date .mrc-date-stacked__month{font-weight:100;line-height:2.5em;text-transform:uppercase}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__date .mrc-date-stacked__day{font-size:3.3rem;font-weight:700;margin-top:-22px}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent{flex-wrap:wrap;margin-top:1em;display:block}@media screen and (min-width: 600px){.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent{display:flex}}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent .mrc-featured-event-card__time{margin:0 0 0.25em 0}@media screen and (min-width: 600px){.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent .mrc-featured-event-card__time{margin:0}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent .mrc-featured-event-card__time:after{content:"|";padding:0 0.25em}}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent .mrc-featured-event-card__location{margin-top:0}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__title{margin-top:0}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__teaser{margin-top:1em} +.decanter-sr-only{position:absolute;left:-999em}.mrc-featured-event-card{background:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,0.2);padding:3rem;display:block}@media screen and (min-width: 600px){.mrc-featured-event-card{display:flex}}.mrc-featured-event-card .mrc-featured-event-card__img{margin-right:0}.mrc-featured-event-card .mrc-featured-event-card__img img{width:100%}@media screen and (min-width: 600px){.mrc-featured-event-card .mrc-featured-event-card__img{margin-right:30px}.mrc-featured-event-card .mrc-featured-event-card__img img{width:auto}}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__date{color:#fff;background:#2e2d29;height:75px;width:75px;text-align:center}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__date .mrc-date-stacked__month{font-weight:100;line-height:2.5em;text-transform:uppercase}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__date .mrc-date-stacked__day{font-size:3.3rem;font-weight:700;margin-top:-22px}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent{flex-wrap:wrap;margin-top:1em;display:block}@media screen and (min-width: 600px){.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent{display:flex}}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent .mrc-featured-event-card__time{margin:0 0 0.25em 0}@media screen and (min-width: 600px){.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent .mrc-featured-event-card__time{margin:0}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent .mrc-featured-event-card__time:after{content:"|";padding:0 0.25em}}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__subcontent .mrc-featured-event-card__location{margin-top:0}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__title{margin-top:0.75em}.mrc-featured-event-card .mrc-featured-event-card__content .mrc-featured-event-card__teaser{margin-top:1em} /*# sourceMappingURL=featured-event-card.css.map */ \ No newline at end of file diff --git a/themes/math_research_center/patterns/molecules/featured-event-card/scss/featured-event-card.scss b/themes/math_research_center/patterns/molecules/featured-event-card/scss/featured-event-card.scss index af1cc5d2..53e32b7b 100644 --- a/themes/math_research_center/patterns/molecules/featured-event-card/scss/featured-event-card.scss +++ b/themes/math_research_center/patterns/molecules/featured-event-card/scss/featured-event-card.scss @@ -67,7 +67,7 @@ } .mrc-featured-event-card__title { - margin-top: 0; + margin-top: 0.75em; } .mrc-featured-event-card__teaser { diff --git a/themes/math_research_center/patterns/molecules/news-card/css/news-card.css b/themes/math_research_center/patterns/molecules/news-card/css/news-card.css index ece3cbea..b5b4f6ca 100644 --- a/themes/math_research_center/patterns/molecules/news-card/css/news-card.css +++ b/themes/math_research_center/patterns/molecules/news-card/css/news-card.css @@ -1,3 +1,3 @@ -.decanter-sr-only{position:absolute;left:-999em}.mrc-news-card{background:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,0.2);padding:3rem;display:block}@media screen and (min-width: 600px){.mrc-news-card{display:flex}}.mrc-news-card .mrc-news-card__img{margin-right:0}.mrc-news-card .mrc-news-card__img img{width:100%}@media screen and (min-width: 600px){.mrc-news-card .mrc-news-card__img{margin-right:30px}.mrc-news-card .mrc-news-card__img img{width:auto}}.mrc-news-card .mrc-news-card__content .mrc-news-card__date{margin:0 0 0.25em 0}.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent{flex-wrap:wrap;display:block}@media screen and (min-width: 600px){.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent{display:flex}}.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent .mrc-news-card__source{margin:0 0 0.25em 0}@media screen and (min-width: 600px){.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent .mrc-news-card__source{margin:0}}.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent .mrc-news-card__program{margin-top:0}.mrc-news-card .mrc-news-card__content .mrc-news-card__title{margin-top:0} +.decanter-sr-only{position:absolute;left:-999em}.mrc-news-card{background:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,0.2);padding:3rem;display:block}@media screen and (min-width: 600px){.mrc-news-card{display:flex}}.mrc-news-card .mrc-news-card__img{margin-right:0}.mrc-news-card .mrc-news-card__img img{width:100%}@media screen and (min-width: 600px){.mrc-news-card .mrc-news-card__img{margin-right:30px}.mrc-news-card .mrc-news-card__img img{width:auto}}.mrc-news-card .mrc-news-card__content .mrc-news-card__date{margin:0 0 0.25em 0}.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent{flex-wrap:wrap;display:block}@media screen and (min-width: 600px){.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent{display:flex}}.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent .mrc-news-card__source{margin:0 0 0.25em 0}@media screen and (min-width: 600px){.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent .mrc-news-card__source{margin:0}}.mrc-news-card .mrc-news-card__content .mrc-news-card__subcontent .mrc-news-card__program{margin-top:0}.mrc-news-card .mrc-news-card__content .mrc-news-card__title{margin-top:0.5em} /*# sourceMappingURL=news-card.css.map */ \ No newline at end of file diff --git a/themes/math_research_center/patterns/molecules/news-card/news-card.ui_patterns.yml b/themes/math_research_center/patterns/molecules/news-card/news-card.ui_patterns.yml index 026800bf..e52e779f 100644 --- a/themes/math_research_center/patterns/molecules/news-card/news-card.ui_patterns.yml +++ b/themes/math_research_center/patterns/molecules/news-card/news-card.ui_patterns.yml @@ -3,7 +3,7 @@ news_card: fields: title: label: "Title" - preview: "Title" + preview: "Card Title" image: label: "Image" preview: @@ -24,4 +24,4 @@ news_card: css: component: css/news-card.css: {} - use: "@math_research_center/molecules/news-card/news-card.html.twig" \ No newline at end of file + use: "@math_research_center/molecules/news-card/news-card.html.twig" diff --git a/themes/math_research_center/patterns/molecules/news-card/scss/news-card.scss b/themes/math_research_center/patterns/molecules/news-card/scss/news-card.scss index 72ec6a80..9d1e6e9a 100644 --- a/themes/math_research_center/patterns/molecules/news-card/scss/news-card.scss +++ b/themes/math_research_center/patterns/molecules/news-card/scss/news-card.scss @@ -58,7 +58,7 @@ } .mrc-news-card__title { - margin-top: 0; + margin-top: 0.5em; } } } diff --git a/themes/math_research_center/patterns/molecules/postcard-horizontal/css/postcard-horizontal.css b/themes/math_research_center/patterns/molecules/postcard-horizontal/css/postcard-horizontal.css index d1b8acdc..7580d2c3 100644 --- a/themes/math_research_center/patterns/molecules/postcard-horizontal/css/postcard-horizontal.css +++ b/themes/math_research_center/patterns/molecules/postcard-horizontal/css/postcard-horizontal.css @@ -1,3 +1,3 @@ -.decanter-sr-only{position:absolute;left:-999em}.mrc-postcard--horizontal{display:block}@media screen and (min-width: 600px){.mrc-postcard--horizontal{display:flex}}.mrc-postcard--horizontal .mrc-postcard--horizontal__img{margin-right:0}.mrc-postcard--horizontal .mrc-postcard--horizontal__img img{width:100%}@media screen and (min-width: 600px){.mrc-postcard--horizontal .mrc-postcard--horizontal__img{margin-right:30px}.mrc-postcard--horizontal .mrc-postcard--horizontal__img img{width:auto}} +.decanter-sr-only{position:absolute;left:-999em}.mrc-postcard--horizontal{display:block}@media screen and (min-width: 600px){.mrc-postcard--horizontal{display:flex}}.mrc-postcard--horizontal .mrc-postcard__img{margin-right:0}@media screen and (min-width: 600px){.mrc-postcard--horizontal .mrc-postcard__img{margin-right:30px}.mrc-postcard--horizontal .mrc-postcard__img img{width:auto}}.mrc-postcard--horizontal .mrc-postcard__title{margin-top:0} /*# sourceMappingURL=postcard-horizontal.css.map */ \ No newline at end of file diff --git a/themes/math_research_center/patterns/molecules/postcard-horizontal/postcard-horizontal.html.twig b/themes/math_research_center/patterns/molecules/postcard-horizontal/postcard-horizontal.html.twig index 2fd2a6c4..615cbff7 100644 --- a/themes/math_research_center/patterns/molecules/postcard-horizontal/postcard-horizontal.html.twig +++ b/themes/math_research_center/patterns/molecules/postcard-horizontal/postcard-horizontal.html.twig @@ -1,6 +1,6 @@