Commit c5ae090e authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents fe992de4 23bd7b4e
......@@ -4,8 +4,6 @@ dependencies:
config:
- core.entity_view_mode.node.teaser
- field.storage.node.field_uw_event_date
- field.storage.node.field_uw_event_listing_page_img
- field.storage.node.field_uw_event_summary
- node.type.uw_ct_event
- taxonomy.vocabulary.uw_tax_event_tags
- taxonomy.vocabulary.uw_tax_event_type
......@@ -15,7 +13,6 @@ dependencies:
- node
- smart_date
- taxonomy
- text
- user
- views_autocomplete_filters
id: uw_view_events
......@@ -300,7 +297,8 @@ display:
display_title: 'Events (page)'
position: 2
display_options:
display_extenders: { }
display_extenders:
metatag_display_extender: { }
display_description: ''
title: Events
defaults:
......@@ -311,6 +309,9 @@ display:
pager: false
sorts: false
empty: false
style: false
row: false
fields: false
path: events
filters:
status:
......@@ -402,7 +403,7 @@ display:
relationship: none
group_type: group
admin_label: ''
operator: '='
operator: '>='
value:
min: ''
max: ''
......@@ -619,7 +620,7 @@ display:
operator: AND
groups:
1: AND
group_by: true
group_by: false
pager:
type: full
options:
......@@ -683,6 +684,147 @@ display:
value: 'No events found using the current filter settings.'
format: uw_tf_standard
plugin_id: text
style:
type: default
options: { }
row:
type: fields
options:
default_field_elements: false
inline: { }
separator: ''
hide_empty: false
fields:
field_uw_event_date:
id: field_uw_event_date
table: node__field_uw_event_date
field: field_uw_event_date
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: smartdate_default
settings:
timezone_override: ''
format: default
force_chronological: false
add_classes: 0
group_column: value
group_columns: { }
group_rows: false
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
plugin_id: field
nid:
id: nid
table: node_field_data
field: nid
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: number_unformatted
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: node
entity_field: nid
plugin_id: field
cache_metadata:
max-age: -1
contexts:
......@@ -693,7 +835,8 @@ display:
- user
- 'user.node_grants:view'
- user.permissions
tags: { }
tags:
- 'config:field.storage.node.field_uw_event_date'
events_listing_block:
display_plugin: block
id: events_listing_block
......@@ -869,6 +1012,51 @@ display:
hierarchy: false
error_message: true
plugin_id: taxonomy_index_tid
field_uw_event_date_end_value:
id: field_uw_event_date_end_value
table: node__field_uw_event_date
field: field_uw_event_date_end_value
relationship: none
group_type: group
admin_label: ''
operator: '>='
value:
min: ''
max: ''
value: now
type: offset
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
operator_limit_selection: false
operator_list: { }
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
placeholder: ''
min_placeholder: ''
max_placeholder: ''
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
plugin_id: date
filter_groups:
operator: AND
groups:
......@@ -890,58 +1078,13 @@ display:
type: default
options: { }
row:
type: 'entity:node'
type: fields
options:
relationship: none
view_mode: teaser
fields:
title:
id: title
table: node_field_data
field: title
entity_type: node
entity_field: title
label: ''
alter:
alter_text: false
make_link: false
absolute: false
trim: false
word_boundary: false
ellipsis: false
strip_tags: false
html: false
default_field_elements: false
inline: { }
separator: ''
hide_empty: false
empty_zero: false
settings:
link_to_entity: true
plugin_id: field
relationship: none
group_type: group
admin_label: ''
exclude: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_alter_empty: true
click_sort_column: value
type: string
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
fields:
field_uw_event_date:
id: field_uw_event_date
table: node__field_uw_event_date
......@@ -1007,77 +1150,15 @@ display:
separator: ', '
field_api_classes: false
plugin_id: field
field_uw_event_listing_page_img:
id: field_uw_event_listing_page_img
table: node__field_uw_event_listing_page_img
field: field_uw_event_listing_page_img
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: target_id
type: entity_reference_entity_id
settings: { }
group_column: target_id
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
plugin_id: field
field_uw_event_summary:
id: field_uw_event_summary
table: node__field_uw_event_summary
field: field_uw_event_summary
nid:
id: nid
table: node_field_data
field: nid
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
exclude: true
alter:
alter_text: false
text: ''
......@@ -1118,7 +1199,7 @@ display:
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: text_default
type: number_unformatted
settings: { }
group_column: value
group_columns: { }
......@@ -1130,6 +1211,8 @@ display:
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: node
entity_field: nid
plugin_id: field
sorts:
sticky:
......@@ -1170,5 +1253,3 @@ display:
- user.permissions
tags:
- 'config:field.storage.node.field_uw_event_date'
- 'config:field.storage.node.field_uw_event_listing_page_img'
- 'config:field.storage.node.field_uw_event_summary'
......@@ -5,8 +5,38 @@
* Provides configuration and settings for events.
*/
use Drupal\node\Entity\Node;
use Drupal\views\ViewExecutable;
/**
* Implements hook_views_pre_view().
*/
function uw_ct_event_views_pre_view(ViewExecutable $view, $display_id, array &$args) {
// If we are on an event listing page view,
// set the default date filter today if no
// filters are already set.
if (
$view->id() == 'uw_view_events' &&
$display_id == 'event_page'
) {
// Get the exposed filters from the view.
$exposed = $view->getExposedInput();
// If there are no exposed filters set, then set
// set the default date to today.
if ($exposed == NULL) {
// Get todays date in the correct format.
$exposed['date']['value'] = date('m/d/Y', time());
// Set the default todays date.
$view->setExposedInput($exposed);
}
}
}
/**
* Implements hook_views_pre_render().
*/
......@@ -28,3 +58,36 @@ function uw_ct_event_geofield_map_latlon_element_alter(array &$map_settings, arr
$complete_form['#attached']['library'][] = 'uw_ct_event/uw_ct_event_edit';
}
}
/**
* Implements hook_preprocess_views_view_unformatted().
*/
function uw_ct_event_preprocess_views_view_unformatted(&$variables) {
// If on an events view, then set the dates.
if ($variables['view']->id() == 'uw_view_events') {
$uwService = \Drupal::service('uw_cfg_common.uw_service');
// For each row, get the data out and the node data.
foreach ($variables['rows'] as $row) {
// Load the node.
$node = Node::load($row['content']['#row']->nid);
// Get the node data.
$node_data = $uwService->uwGetNodeContent($node, 'teaser');
// Get the date info.
$date['value'] = $row['content']['#row']->node__field_uw_event_date_field_uw_event_date_value;
$date['end_value'] = $row['content']['#row']->node__field_uw_event_date_field_uw_event_date_end_value;
$date['duration'] = $row['content']['#row']->node__field_uw_event_date_field_uw_event_date_duration;
// Set the date on the node data.
$node_data['date'] = [$uwService->uwGetDate($date, 'event')];
// Set a variable for the node data.
$variables['node_data'][] = $node_data;
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment