Event venue name on event form and upcoming event block
Add venue name to the event content type and upcoming events block. Change-Id: Ib9d8b812d56560b00b69945d16f4ea17f36e94c8
This commit is contained in:
parent
200595c5ac
commit
f4a3682a04
@ -170,7 +170,7 @@ function commons_groups_views_default_views() {
|
||||
|
||||
/* Display: Master */
|
||||
$handler = $view->new_display('default', 'Master', 'default');
|
||||
$handler->display->display_options['title'] = 'Group contributors';
|
||||
$handler->display->display_options['title'] = 'Group members';
|
||||
$handler->display->display_options['use_more'] = TRUE;
|
||||
$handler->display->display_options['use_more_always'] = FALSE;
|
||||
$handler->display->display_options['access']['type'] = 'perm';
|
||||
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* groups_events.features.field_base.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_field_default_field_bases().
|
||||
*/
|
||||
function groups_events_field_default_field_bases() {
|
||||
$field_bases = array();
|
||||
|
||||
// Exported field_base: 'field_venue_name'
|
||||
$field_bases['field_venue_name'] = array(
|
||||
'active' => 1,
|
||||
'cardinality' => 1,
|
||||
'deleted' => 0,
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_venue_name',
|
||||
'foreign keys' => array(
|
||||
'format' => array(
|
||||
'columns' => array(
|
||||
'format' => 'format',
|
||||
),
|
||||
'table' => 'filter_format',
|
||||
),
|
||||
),
|
||||
'indexes' => array(
|
||||
'format' => array(
|
||||
0 => 'format',
|
||||
),
|
||||
),
|
||||
'locked' => 0,
|
||||
'module' => 'text',
|
||||
'settings' => array(
|
||||
'max_length' => 60,
|
||||
),
|
||||
'translatable' => 0,
|
||||
'type' => 'text',
|
||||
);
|
||||
|
||||
return $field_bases;
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @file
|
||||
* groups_events.features.field_instance.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_field_default_field_instances().
|
||||
*/
|
||||
function groups_events_field_default_field_instances() {
|
||||
$field_instances = array();
|
||||
|
||||
// Exported field_instance: 'node-event-field_venue_name'
|
||||
$field_instances['node-event-field_venue_name'] = array(
|
||||
'bundle' => 'event',
|
||||
'default_value' => NULL,
|
||||
'deleted' => 0,
|
||||
'description' => '',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'above',
|
||||
'module' => 'text',
|
||||
'settings' => array(),
|
||||
'type' => 'text_default',
|
||||
'weight' => 13,
|
||||
),
|
||||
'teaser' => array(
|
||||
'label' => 'above',
|
||||
'settings' => array(),
|
||||
'type' => 'hidden',
|
||||
'weight' => 0,
|
||||
),
|
||||
),
|
||||
'display_in_partial_form' => 0,
|
||||
'entity_type' => 'node',
|
||||
'field_name' => 'field_venue_name',
|
||||
'label' => 'Venue name',
|
||||
'required' => 0,
|
||||
'settings' => array(
|
||||
'text_processing' => 0,
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 1,
|
||||
'module' => 'text',
|
||||
'settings' => array(
|
||||
'size' => 60,
|
||||
),
|
||||
'type' => 'text_textfield',
|
||||
'weight' => 7,
|
||||
),
|
||||
);
|
||||
|
||||
// Translatables
|
||||
// Included for use with string extractors like potx.
|
||||
t('Venue name');
|
||||
|
||||
return $field_instances;
|
||||
}
|
@ -4,10 +4,14 @@ core = 7.x
|
||||
package = Groups - Building Blocks
|
||||
version = 7.x-1.0
|
||||
project = groups_events
|
||||
dependencies[] = features
|
||||
dependencies[] = text
|
||||
dependencies[] = views
|
||||
dependencies[] = views_content
|
||||
dependencies[] = views_load_more
|
||||
features[ctools][] = views:views_default:3.0
|
||||
features[features_api][] = api:2
|
||||
features[field_base][] = field_venue_name
|
||||
features[field_instance][] = node-event-field_venue_name
|
||||
features[views_view][] = groups_events_upcoming_events
|
||||
features_exclude[dependencies][ctools] = ctools
|
||||
|
@ -5,3 +5,12 @@
|
||||
*/
|
||||
|
||||
include_once 'groups_events.features.inc';
|
||||
|
||||
/**
|
||||
* Implements hook_ctools_plugin_directory().
|
||||
*/
|
||||
function groups_events_ctools_plugin_directory($module, $plugin) {
|
||||
if ($module == 'addressfield') {
|
||||
return 'plugins/' . $plugin;
|
||||
}
|
||||
}
|
||||
|
@ -196,6 +196,30 @@ function groups_events_views_default_views() {
|
||||
$handler->display->display_options['fields']['body']['settings'] = array(
|
||||
'trim_length' => '600',
|
||||
);
|
||||
/* Field: Content: Date */
|
||||
$handler->display->display_options['fields']['field_date_1']['id'] = 'field_date_1';
|
||||
$handler->display->display_options['fields']['field_date_1']['table'] = 'field_data_field_date';
|
||||
$handler->display->display_options['fields']['field_date_1']['field'] = 'field_date';
|
||||
/* Field: Content: Venue name */
|
||||
$handler->display->display_options['fields']['field_venue_name']['id'] = 'field_venue_name';
|
||||
$handler->display->display_options['fields']['field_venue_name']['table'] = 'field_data_field_venue_name';
|
||||
$handler->display->display_options['fields']['field_venue_name']['field'] = 'field_venue_name';
|
||||
$handler->display->display_options['fields']['field_venue_name']['label'] = '';
|
||||
$handler->display->display_options['fields']['field_venue_name']['element_label_colon'] = FALSE;
|
||||
/* Field: Content: Address */
|
||||
$handler->display->display_options['fields']['field_address']['id'] = 'field_address';
|
||||
$handler->display->display_options['fields']['field_address']['table'] = 'field_data_field_address';
|
||||
$handler->display->display_options['fields']['field_address']['field'] = 'field_address';
|
||||
$handler->display->display_options['fields']['field_address']['label'] = '';
|
||||
$handler->display->display_options['fields']['field_address']['element_label_colon'] = FALSE;
|
||||
$handler->display->display_options['fields']['field_address']['click_sort_column'] = 'country';
|
||||
$handler->display->display_options['fields']['field_address']['type'] = 'addressfield_linear';
|
||||
$handler->display->display_options['fields']['field_address']['settings'] = array(
|
||||
'use_widget_handlers' => 1,
|
||||
'format_handlers' => array(
|
||||
'address' => 'address',
|
||||
),
|
||||
);
|
||||
$handler->display->display_options['defaults']['arguments'] = FALSE;
|
||||
/* Contextual filter: OG membership: Group ID */
|
||||
$handler->display->display_options['arguments']['gid']['id'] = 'gid';
|
||||
|
@ -76,6 +76,29 @@ function groups_pages_panelizer_defaults() {
|
||||
$display->content['new-D535E2E0-1D0E-4B62-9093-D9DE4722EB29'] = $pane;
|
||||
$display->panels['two_66_33_first'][0] = 'new-D535E2E0-1D0E-4B62-9093-D9DE4722EB29';
|
||||
$pane = new stdClass();
|
||||
$pane->pid = 'new-54C2DF39-C222-48D2-A1E6-31E4C9D18B4F';
|
||||
$pane->panel = 'two_66_33_first';
|
||||
$pane->type = 'views_panes';
|
||||
$pane->subtype = 'groups_events_upcoming_events-panel_pane_1';
|
||||
$pane->shown = TRUE;
|
||||
$pane->access = array();
|
||||
$pane->configuration = array(
|
||||
'context' => array(
|
||||
0 => 'panelizer',
|
||||
),
|
||||
);
|
||||
$pane->cache = array();
|
||||
$pane->style = array(
|
||||
'settings' => NULL,
|
||||
);
|
||||
$pane->css = array();
|
||||
$pane->extras = array();
|
||||
$pane->position = 1;
|
||||
$pane->locks = array();
|
||||
$pane->uuid = '54C2DF39-C222-48D2-A1E6-31E4C9D18B4F';
|
||||
$display->content['new-54C2DF39-C222-48D2-A1E6-31E4C9D18B4F'] = $pane;
|
||||
$display->panels['two_66_33_first'][1] = 'new-54C2DF39-C222-48D2-A1E6-31E4C9D18B4F';
|
||||
$pane = new stdClass();
|
||||
$pane->pid = 'new-4D07DA83-5650-4EE6-AA34-DEBDE8467ADB';
|
||||
$pane->panel = 'two_66_33_first';
|
||||
$pane->type = 'entity_field';
|
||||
@ -99,34 +122,11 @@ function groups_pages_panelizer_defaults() {
|
||||
);
|
||||
$pane->css = array();
|
||||
$pane->extras = array();
|
||||
$pane->position = 1;
|
||||
$pane->position = 2;
|
||||
$pane->locks = array();
|
||||
$pane->uuid = '4D07DA83-5650-4EE6-AA34-DEBDE8467ADB';
|
||||
$display->content['new-4D07DA83-5650-4EE6-AA34-DEBDE8467ADB'] = $pane;
|
||||
$display->panels['two_66_33_first'][1] = 'new-4D07DA83-5650-4EE6-AA34-DEBDE8467ADB';
|
||||
$pane = new stdClass();
|
||||
$pane->pid = 'new-54C2DF39-C222-48D2-A1E6-31E4C9D18B4F';
|
||||
$pane->panel = 'two_66_33_first';
|
||||
$pane->type = 'views_panes';
|
||||
$pane->subtype = 'groups_events_upcoming_events-panel_pane_1';
|
||||
$pane->shown = TRUE;
|
||||
$pane->access = array();
|
||||
$pane->configuration = array(
|
||||
'context' => array(
|
||||
0 => 'panelizer',
|
||||
),
|
||||
);
|
||||
$pane->cache = array();
|
||||
$pane->style = array(
|
||||
'settings' => NULL,
|
||||
);
|
||||
$pane->css = array();
|
||||
$pane->extras = array();
|
||||
$pane->position = 2;
|
||||
$pane->locks = array();
|
||||
$pane->uuid = '54C2DF39-C222-48D2-A1E6-31E4C9D18B4F';
|
||||
$display->content['new-54C2DF39-C222-48D2-A1E6-31E4C9D18B4F'] = $pane;
|
||||
$display->panels['two_66_33_first'][2] = 'new-54C2DF39-C222-48D2-A1E6-31E4C9D18B4F';
|
||||
$display->panels['two_66_33_first'][2] = 'new-4D07DA83-5650-4EE6-AA34-DEBDE8467ADB';
|
||||
$pane = new stdClass();
|
||||
$pane->pid = 'new-0702E7C9-CCB9-4EA3-B2C5-7D1ACDF55BD5';
|
||||
$pane->panel = 'two_66_33_second';
|
||||
|
@ -245,9 +245,15 @@
|
||||
}
|
||||
.pane-groups-events-upcoming-events-panel-pane-1 h2.pane-title {
|
||||
display: inline-block;
|
||||
line-height: 16px;
|
||||
line-height: 20px;
|
||||
font-size: 80%;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 0px;
|
||||
background: #C4E0E9;
|
||||
display: inline-block;
|
||||
color: #254C7C;
|
||||
padding: 0px 10px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.region-two-66-33-second h2.pane-title {
|
||||
color: #2A4E68;
|
||||
@ -275,6 +281,7 @@
|
||||
display: inline-block;
|
||||
color: #254C7C;
|
||||
padding: 0px 10px;
|
||||
font-weight: 400;
|
||||
}
|
||||
a {
|
||||
color: #30739C;
|
||||
@ -323,14 +330,15 @@
|
||||
/* === Event large teaser === */
|
||||
|
||||
.event--large-teaser {
|
||||
@extend .clearfix;
|
||||
@extend .row;
|
||||
.container-header {
|
||||
@extend .col-md-8;
|
||||
}
|
||||
.container-first {
|
||||
float: left;
|
||||
width: 60%;
|
||||
@extend .col-md-8;
|
||||
}
|
||||
.container-second {
|
||||
float: left;
|
||||
width: 40%;
|
||||
@extend .col-md-2;
|
||||
}
|
||||
h3 {
|
||||
margin-bottom: 5px;
|
||||
@ -343,24 +351,17 @@
|
||||
.field-name-field-address {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.field-venue {
|
||||
.field-content {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.field-body {
|
||||
color: #888;
|
||||
line-height: 1.4;
|
||||
font-size: 16px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.field-date {
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
font-weight: 300;
|
||||
.date-part {
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
}
|
||||
.date-display-start {
|
||||
}
|
||||
.date-display-end {
|
||||
}
|
||||
padding-top: 10px;
|
||||
}
|
||||
.field-name-field-organizers .field-label {
|
||||
font-weight: 400;
|
||||
|
@ -11,23 +11,16 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php dpm($fields); ?>
|
||||
|
||||
<div class="event--large-teaser">
|
||||
<div class="container-header">
|
||||
<h3><?php print $fields['title_field']->content; ?></h3>
|
||||
</div>
|
||||
<div class="container-first">
|
||||
<div class="field-date"><?php print $fields['field_date']->content; ?></div>
|
||||
<div class="field-venue"><?php print $fields['field_venue_name']->content; ?> (<?php print $fields['field_address']->content; ?>)</div>
|
||||
<div class="field-body"><?php print $fields['body']->content; ?></div>
|
||||
</div>
|
||||
<div class="container-second">
|
||||
<div class="field-date"><?php
|
||||
// TODO: rewrite this part into a custom date field formatter.
|
||||
$date_str = $fields['field_date']->content;
|
||||
$date_str = str_replace('<div class="field-content">', '<div class="field-content"><div class="date-part">', $date_str);
|
||||
$date_str = str_replace(',', '</div>', $date_str);
|
||||
print $date_str;
|
||||
?></div>
|
||||
<div class="field-capacity"><?php print $fields['capacity_used']->content; ?></div>
|
||||
<div class="field-comment-count"><?php print $fields['comment_count']->content; ?></div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user