diff --git a/field-collection-item.tpl.php b/field-collection-item.tpl.php deleted file mode 100644 index 8d345cb..0000000 --- a/field-collection-item.tpl.php +++ /dev/null @@ -1,37 +0,0 @@ - -
> -
> - -
-
diff --git a/field_collection.module b/field_collection.module index bf6a005..90f3f38 100644 --- a/field_collection.module +++ b/field_collection.module @@ -753,7 +753,7 @@ function field_collection_permission() { * Determines whether the given user has access to a field collection. * * @param $op - * The operation being performed. One of 'view', 'update', 'create', 'delete'. + * The operation being performed. One of 'view', 'edit', 'add', or 'delete'. * @param $item * Optionally a field collection item. If nothing is given, access for all * items is determined. @@ -775,25 +775,44 @@ function field_collection_item_access($op, FieldCollectionItemEntity $item = NUL if (!isset($item)) { return FALSE; } - $op = $op == 'view' ? 'view' : 'edit'; + + // Op coming from $settings is 'add', 'edit', or 'delete'. + // Field access only takes 'view' or 'edit' operations. + $field_op = ($op == 'view') ? 'view' : 'edit'; + + // Entity access takes 'view', 'edit', 'add', or 'delete' operations. + if ($op = 'edit') { + $entity_op = 'update'; + } + elseif ($op = 'add') { + $entity_op = 'create'; + } + // Access is determined by the entity and field containing the reference. $field = field_info_field($item->field_name); - $entity_access = entity_access($op == 'view' ? 'view' : 'update', $item->hostEntityType(), $item->hostEntity(), $account); - return $entity_access && field_access($op, $field, $item->hostEntityType(), $item->hostEntity(), $account); + + $entity_access = entity_access($entity_op, $item->hostEntityType(), $item->hostEntity(), $account); + $field_access = field_access($field_op, $field, $item->hostEntityType(), $item->hostEntity(), $account); + + return $entity_access && $field_access; } /** * Implements hook_theme(). */ -function field_collection_theme() { +function field_collection_theme($existing, $type, $theme, $path) { + $path = drupal_get_path('module', 'field_collection'); + + // RW: Do we still need both of these? return array( 'field_collection_item' => array( 'render element' => 'elements', + 'path' => $path . '/theme', 'template' => 'field-collection-item', ), - 'field_collection_view' => array( - 'render element' => 'element', - ), +// 'field_collection_view' => array( +// 'render element' => 'element', +// ), ); } @@ -807,7 +826,7 @@ function field_collection_field_info() { 'description' => t('This field stores references to embedded entities, which itself may contain any number of fields.'), 'instance_settings' => array(), 'default_widget' => 'field_collection_hidden', - 'default_formatter' => 'field_collection_view', + 'default_formatter' => 'field_collection_items', // As of now there is no UI for setting the path. 'settings' => array( 'path' => '', @@ -840,7 +859,7 @@ function field_collection_field_instance_settings_form($field, $instance) { '#value' => NULL, ); $element['fieldset']['content'] = array( - '#pre' => '

', + '#prefix' => '

', '#markup' => t('To specify a default value, configure it via the regular default value setting of each field that is part of the field collection. To do so, go to the Manage fields screen of the field collection.', array('!url' => url('admin/structure/field-collections/' . strtr($field['field_name'], array('_' => '-')) . '/fields'))), '#suffix' => '

', ); @@ -1060,20 +1079,23 @@ function field_collection_item_is_empty(FieldCollectionItemEntity $item) { */ function field_collection_field_formatter_info() { return array( - 'field_collection_list' => array( - 'label' => t('Links to field collection items'), + 'field_collection_items' => array( + 'label' => t('Field collection items'), 'field types' => array('field_collection'), 'settings' => array( + 'show_op_links' => FALSE, 'edit' => t('Edit'), 'delete' => t('Delete'), 'add' => t('Add'), 'description' => TRUE, + 'view_mode' => 'full', ), ), - 'field_collection_view' => array( - 'label' => t('Field collection items'), + 'field_collection_links' => array( + 'label' => t('Links to field collection items'), 'field types' => array('field_collection'), 'settings' => array( + 'show_op_links' => FALSE, 'edit' => t('Edit'), 'delete' => t('Delete'), 'add' => t('Add'), @@ -1081,13 +1103,6 @@ function field_collection_field_formatter_info() { 'view_mode' => 'full', ), ), - 'field_collection_fields' => array( - 'label' => t('Fields only'), - 'field types' => array('field_collection'), - 'settings' => array( - 'view_mode' => 'full', - ), - ), ); } @@ -1099,51 +1114,74 @@ function field_collection_field_formatter_settings_form($field, $instance, $view $settings = $display['settings']; $elements = array(); - if ($display['type'] != 'field_collection_fields') { - $elements['edit'] = array( - '#type' => 'textfield', - '#title' => t('Edit link title'), - '#default_value' => $settings['edit'], - '#description' => t('Leave the title empty, to hide the link.'), - ); - $elements['delete'] = array( - '#type' => 'textfield', - '#title' => t('Delete link title'), - '#default_value' => $settings['delete'], - '#description' => t('Leave the title empty, to hide the link.'), - ); - $elements['add'] = array( - '#type' => 'textfield', - '#title' => t('Add link title'), - '#default_value' => $settings['add'], - '#description' => t('Leave the title empty, to hide the link.'), - ); - $elements['description'] = array( - '#type' => 'checkbox', - '#title' => t('Show the field description beside the add link.'), - '#default_value' => $settings['description'], - '#description' => t('If enabled and the add link is shown, the field description is shown in front of the add link.'), - ); - } - - // Add a select form element for view_mode if viewing the rendered field_collection. - if ($display['type'] !== 'field_collection_list') { - - $entity_type = entity_get_info('field_collection_item'); - $options = array(); - foreach ($entity_type['view modes'] as $mode => $info) { - $options[$mode] = $info['label']; - } + $elements['show_op_links'] = array( + '#type' => 'checkbox', + '#title' => t('Show operation links for field collection items'), + '#default_value' => $settings['show_op_links'], + ); + $elements['edit'] = array( + '#type' => 'textfield', + '#title' => t('Edit link title'), + '#default_value' => $settings['edit'], + '#description' => t('Leave the title empty to hide the link.'), + '#states' => array( + 'invisible' => array( + ':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][show_op_links]"]' => array('checked' => FALSE), + ), + ), + ); + $elements['delete'] = array( + '#type' => 'textfield', + '#title' => t('Delete link title'), + '#default_value' => $settings['delete'], + '#description' => t('Leave the title empty to hide the link.'), + '#states' => array( + 'invisible' => array( + ':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][show_op_links]"]' => array('checked' => FALSE), + ), + ), + ); + $elements['add'] = array( + '#type' => 'textfield', + '#title' => t('Add link title'), + '#default_value' => $settings['add'], + '#description' => t('Leave the title empty to hide the link.'), + '#states' => array( + 'invisible' => array( + ':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][show_op_links]"]' => array('checked' => FALSE), + ), + ), + ); + $elements['description'] = array( + '#type' => 'checkbox', + '#title' => t('Show the field help text next to the add link.'), + '#default_value' => $settings['description'], + '#states' => array( + 'invisible' => array( + ':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][show_op_links]"]' => array('checked' => FALSE), + ), + 'disabled' => array( + ':input[name="fields[' . $field['field_name'] . '][settings_edit_form][settings][add]"]' => array('value' => ''), + ), + ), + ); - $elements['view_mode'] = array( - '#type' => 'select', - '#title' => t('View mode'), - '#options' => $options, - '#default_value' => $settings['view_mode'], - '#description' => t('Select the view mode'), - ); + // @TODO: Apply view modes of field collection parent entity directly, + // with no formatter. + $entity_type = entity_get_info('field_collection_item'); + $options = array(); + foreach ($entity_type['view modes'] as $mode => $info) { + $options[$mode] = $info['label']; } + $elements['view_mode'] = array( + '#type' => 'select', + '#title' => t('View mode'), + '#options' => $options, + '#default_value' => $settings['view_mode'], + '#description' => t('Select the view mode to render field collection fields with.'), + ); + return $elements; } @@ -1155,24 +1193,22 @@ function field_collection_field_formatter_settings_summary($field, $instance, $v $settings = $display['settings']; $output = array(); - if ($display['type'] !== 'field_collection_fields') { + if ($settings['show_op_links']) { $links = array_filter(array_intersect_key($settings, array_flip(array('add', 'edit', 'delete')))); + if ($links) { - $output[] = t('Links: @links', array('@links' => check_plain(implode(', ', $links)))); - } - else { - $output[] = t('Links: none'); + $help_text = (isset($links['add']) && isset($settings['description'])) ? ' with field help text' : ''; + $output[] = t('Links: @links@help_text', array('@links' => check_plain(implode(', ', $links)), '@help_text' => $help_text)); } } - if ($display['type'] !== 'field_collection_list') { - $entity_type = entity_get_info('field_collection_item'); - if (!empty($entity_type['view modes'][$settings['view_mode']]['label'])) { - $output[] = t('View mode: @mode', array('@mode' => $entity_type['view modes'][$settings['view_mode']]['label'])); - } + $entity_type = entity_get_info('field_collection_item'); + if (!empty($entity_type['view modes'][$settings['view_mode']]['label'])) { + $output[] = t('View mode: @mode', array('@mode' => $entity_type['view modes'][$settings['view_mode']]['label'])); } - return implode('
', $output); + // Add linebreaks if we have more than one summary item. + return count($output) > 1 ? implode('
', $output) : implode('', $output); } /** @@ -1183,65 +1219,54 @@ function field_collection_field_formatter_view($entity_type, $entity, $field, $i $settings = $display['settings']; switch ($display['type']) { - case 'field_collection_list': + case 'field_collection_items': + case 'field_collection_links': + // Get view mode for template suggestions. + $view_mode = !empty($display['settings']['view_mode']) ? $display['settings']['view_mode'] : 'full'; foreach ($items as $delta => $item) { - if ($field_collection = field_collection_field_get_entity($item)) { - $output = l($field_collection->label(), $field_collection->path()); - $links = array(); - foreach (array('edit', 'delete') as $op) { - if ($settings[$op] && field_collection_item_access($op == 'edit' ? 'update' : $op, $field_collection)) { - $title = entity_i18n_string("field:{$field['field_name']}:{$instance['bundle']}:setting_$op", $settings[$op]); - $links[] = l($title, $field_collection->path() . '/' . $op, array('query' => drupal_get_destination())); + // Check field collection items exist and load entity info. + if ($field_collection_item = field_collection_field_get_entity($item)) { + $item_id = implode($item); + + // Load render arrays of the collected fields. + $field_collection_item_render = $field_collection_item->view($view_mode); + + if ($display['type'] == 'field_collection_links') { + // Remove fields and add links to the field collection item entities. + foreach ($field_collection_item_render['field_collection_item'] as $eid => $render_array) { + // Remove all non-properties from the render array. + foreach($render_array as $property => $value) { + if(strpos($property, '#') !== 0) { + unset($field_collection_item_render['field_collection_item'][$eid][$property]); + } + } + // Add the link and some extra properties for themers to work with. + $link_array = array( + '#title' => $field_collection_item->label(), + '#path' => $field_collection_item->path(), + '#markup' => l($field_collection_item->label(), $field_collection_item->path()), + ); + $field_collection_item_render['field_collection_item'][$eid]['link'] = $link_array; } } - if ($links) { - $output .= ' (' . implode('|', $links) . ')'; - } - $element[$delta] = array('#markup' => $output); - } - } - field_collection_field_formatter_links($element, $entity_type, $entity, $field, $instance, $langcode, $items, $display); - break; - case 'field_collection_view': + // Attach fields to the collection. + $element[$delta]['entity'] = $field_collection_item_render; - $element['#attached']['css'][] = drupal_get_path('module', 'field_collection') . '/field_collection.theme.css'; - $view_mode = !empty($display['settings']['view_mode']) ? $display['settings']['view_mode'] : 'full'; - foreach ($items as $delta => $item) { - if ($field_collection = field_collection_field_get_entity($item)) { - $element[$delta]['entity'] = $field_collection->view($view_mode); - $element[$delta]['#theme_wrappers'] = array('field_collection_view'); - $element[$delta]['#attributes']['class'][] = 'field-collection-view'; - $element[$delta]['#attributes']['class'][] = 'clearfix'; - $element[$delta]['#attributes']['class'][] = drupal_clean_css_identifier('view-mode-' . $view_mode); - - $links = array( - '#theme' => 'links__field_collection_view', - ); - $links['#attributes']['class'][] = 'field-collection-view-links'; - foreach (array('edit', 'delete') as $op) { - if ($settings[$op] && field_collection_item_access($op == 'edit' ? 'update' : $op, $field_collection)) { - $links['#links'][$op] = array( - 'title' => entity_i18n_string("field:{$field['field_name']}:{$instance['bundle']}:setting_$op", $settings[$op]), - 'href' => $field_collection->path() . '/' . $op, - 'query' => drupal_get_destination(), - ); - } - } - $element[$delta]['links'] = $links; + // Attach operation links if available. + field_collection_field_formatter_op_links($element, $entity_type, $entity, $field, $instance, $langcode, $items, $display, $field_collection_item, $delta, $item_id); } } - field_collection_field_formatter_links($element, $entity_type, $entity, $field, $instance, $langcode, $items, $display); - break; - case 'field_collection_fields': + if (!$items) { + // If a field collection has no items, attach the add link if available. + field_collection_field_formatter_op_links($element, $entity_type, $entity, $field, $instance, $langcode, $items, $display); + } - $view_mode = !empty($display['settings']['view_mode']) ? $display['settings']['view_mode'] : 'full'; - foreach ($items as $delta => $item) { - if ($field_collection = field_collection_field_get_entity($item)) { - $element[$delta]['entity'] = $field_collection->view($view_mode); - } + // Add css if the field collection will be displayed. + if (!empty($element)) { + $element['#attached']['css'][] = drupal_get_path('module', 'field_collection') . '/theme/field_collection.theme.css'; } break; } @@ -1250,49 +1275,132 @@ function field_collection_field_formatter_view($entity_type, $entity, $field, $i } /** - * Helper function to add links to a field collection field. + * Operation links helper function and formatter. + * + * Adds available links as properties of the field collection item render + * array. Properties are then preprocessed into template variables by + * field_collection_preprocess_entity(). */ -function field_collection_field_formatter_links(&$element, $entity_type, $entity, $field, $instance, $langcode, $items, $display) { +function field_collection_field_formatter_op_links(&$element, $entity_type, $entity, $field, $instance, $langcode, $items, $display, $field_collection_item = NULL, $delta = NULL, $item_id = NULL) { $settings = $display['settings']; - if ($settings['add'] && ($field['cardinality'] == FIELD_CARDINALITY_UNLIMITED || count($items) < $field['cardinality'])) { - // Check whether the current is allowed to create a new item. + if (!$settings['show_op_links']) { + return NULL; + } + + // Determine what ops a field collection item can have. + $last_item = count($items) > 0 ? count($items) - 1 : 'no items'; + + if ($delta == $last_item) { + $ops = array('add', 'edit', 'delete'); + } + elseif ($last_item == 'no items') { + $ops = array('add'); + $delta = '0'; + $item_id = '0'; $field_collection_item = entity_create('field_collection_item', array('field_name' => $field['field_name'])); $field_collection_item->setHostEntity($entity_type, $entity, LANGUAGE_NONE, FALSE); + $field_collection_item->item_id = $item_id; - if (field_collection_item_access('create', $field_collection_item)) { - $path = field_collection_field_get_path($field); - list($id) = entity_extract_ids($entity_type, $entity); - $element['#suffix'] = ''; - if (!empty($settings['description'])) { - $element['#suffix'] .= '
' . field_filter_xss($instance['description']) . '
'; + // Create a dummy field collection item render array if the field + // collection is empty. + // Get the view mode from settings. This will probably break when + // we have direct inheritance of view mode from the field collection + // parent entity. + $field_collection_item_render = $field_collection_item->view($settings['view_mode']); + } + else { + $ops = array('edit', 'delete'); + } + + foreach ($ops as $op) { + if ($op == 'add') { + // Check if there's room for another field collection item. If not, + // continue to next op. + if (!($field['cardinality'] == FIELD_CARDINALITY_UNLIMITED || count($items) < $field['cardinality'])) { + continue; } - $title = entity_i18n_string("field:{$field['field_name']}:{$instance['bundle']}:setting_add", $settings['add']); - $add_path = $path . '/add/' . $entity_type . '/' . $id; - $element['#suffix'] .= ''; } - } - // If there is no add link, add a special class to the last item. - if (empty($element['#suffix'])) { - $index = count(element_children($element)) - 1; - $element[$index]['#attributes']['class'][] = 'field-collection-view-final'; + + if (!empty($settings[$op]) && field_collection_item_access($op, $field_collection_item)) { + // Build link components. + $title = entity_i18n_string("field:{$field['field_name']}:{$instance['bundle']}:setting_$op", $settings[$op]); + + if ($op == 'add') { + list($entity_id) = entity_extract_ids($entity_type, $entity); + $path = url(field_collection_field_get_path($field) . '/add/' . $entity_type . '/' . $entity_id, array('query' => drupal_get_destination())); + } + else { + $path = url($field_collection_item->path() . '/' . $op, array('query' => drupal_get_destination())); + } + + $op_links['#links'][$op] = array( + '#title' => $title, + '#path' => $path, + ); + + // Add help text. + $op_links['#description'] = $settings['add'] && $settings['description'] ? field_filter_xss($instance['description']) : FALSE; + } } - $element += array('#prefix' => '', '#suffix' => ''); - $element['#prefix'] .= '
'; - $element['#suffix'] .= '
'; + // Attach links to render array. + if (!empty($op_links)) { + if (isset($field_collection_item_render)) { + $element[$delta]['entity'] = $field_collection_item_render; + // Fake the #items property in the field render array so that field + // renders our empty collection. + $element['#items'] = array(0 => 'not empty'); + } - return $element; + $element[$delta]['entity']['field_collection_item'][$item_id]['#op_links'] = $op_links; + + return $op_links; + } } /** - * Themes field collection items printed using the field_collection_view formatter. + * Implements hook_preprocess_HOOK(). */ -function theme_field_collection_view($variables) { - $element = $variables['element']; - return '' . $element['#children'] . ''; +function field_collection_preprocess_entity(&$variables) { + // Use the elements array in case template_preprocess_entity changes. + if ($variables['elements']['#entity_type'] == 'field_collection_item') { + // Add op link properties as template variables. + foreach (array('add', 'edit', 'delete') as $op) { + if (isset($variables['elements']['#op_links']['#links'][$op])) { + $variables[$op] = $variables['elements']['#op_links']['#links'][$op]['#title']; + $variables[$op . '_path'] = $variables['elements']['#op_links']['#links'][$op]['#path']; + } + else { + $variables[$op] = FALSE; + } + } + $variables['help_text'] = !empty($variables['elements']['#op_links']['#description']) ? $variables['elements']['#op_links']['#description'] : FALSE; + + // Replace the default entity classes with something simpler. + $variables['classes_array'] = array(); + $variables['classes_array'][] = drupal_html_class($variables['elements']['#entity_type']); + $variables['classes_array'][] = drupal_html_class('view-mode-' . $variables['elements']['#view_mode']); + isset($variables['content']['link']) ? $variables['classes_array'][] = 'field-collection-item-link' : ''; + + // Replace the default entity theme suggestions with field collection + // specific suggestions. + $entity_type = $variables['elements']['#entity_type']; + $view_mode = $variables['elements']['#view_mode']; + $field_collection_name = $variables['elements']['#bundle']; + $instance = $variables['elements']['#entity']->instanceInfo(); + $parent_bundle = $instance['bundle']; + + $variables['theme_hook_suggestions'] = array(); + $variables['theme_hook_suggestions'][] = $entity_type; + $variables['theme_hook_suggestions'][] = $entity_type . '__' . $view_mode; + $variables['theme_hook_suggestions'][] = $entity_type . '__' . $parent_bundle; + $variables['theme_hook_suggestions'][] = $entity_type . '__' . $field_collection_name; + $variables['theme_hook_suggestions'][] = $entity_type . '__' . $parent_bundle . '__' . $view_mode; + $variables['theme_hook_suggestions'][] = $entity_type . '__' . $field_collection_name . '__' . $view_mode; + $variables['theme_hook_suggestions'][] = $entity_type . '__' . $field_collection_name . '__' . $parent_bundle; + $variables['theme_hook_suggestions'][] = $entity_type . '__' . $field_collection_name . '__' . $parent_bundle . '__' . $view_mode; + } } /** @@ -1736,24 +1844,25 @@ function field_collection_i18n_string_list_field_alter(&$properties, $type, $ins $field = field_info_field($instance['field_name']); if ($field['type'] == 'field_collection' && !empty($instance['display'])) { - foreach ($instance['display'] as $view_mode => $display) { - if ($display['type'] != 'field_collection_fields') { - $display['settings'] += array('edit' => 'edit', 'delete' => 'delete', 'add' => 'add'); - - $properties['field'][$instance['field_name']][$instance['bundle']]['setting_edit'] = array( - 'title' => t('Edit link title'), - 'string' => $display['settings']['edit'], - ); - $properties['field'][$instance['field_name']][$instance['bundle']]['setting_delete'] = array( - 'title' => t('Delete link title'), - 'string' => $display['settings']['delete'], - ); - $properties['field'][$instance['field_name']][$instance['bundle']]['setting_add'] = array( - 'title' => t('Add link title'), - 'string' => $display['settings']['add'], - ); - } + $display['settings'] += array( + 'edit' => 'edit', + 'delete' => 'delete', + 'add' => 'add', + ); + + $properties['field'][$instance['field_name']][$instance['bundle']]['setting_edit'] = array( + 'title' => t('Edit link title'), + 'string' => $display['settings']['edit'], + ); + $properties['field'][$instance['field_name']][$instance['bundle']]['setting_delete'] = array( + 'title' => t('Delete link title'), + 'string' => $display['settings']['delete'], + ); + $properties['field'][$instance['field_name']][$instance['bundle']]['setting_add'] = array( + 'title' => t('Add link title'), + 'string' => $display['settings']['add'], + ); } } } diff --git a/field_collection.theme.css b/field_collection.theme.css deleted file mode 100644 index b619185..0000000 --- a/field_collection.theme.css +++ /dev/null @@ -1,66 +0,0 @@ -@CHARSET "UTF-8"; - -.field-collection-container { - border-bottom: 1px solid #D3D7D9; - margin-bottom: 1em; -} - -.field-collection-container .field-items .field-item { - margin-bottom: 10px; -} - -.field-collection-container .field-items .field-items .field-item { - margin-bottom: 0; -} - -.field-collection-view { - padding: 1em 0 0.3em 0; - margin: 0 1em 0 1em; - border-bottom: 1px dotted #D3D7D9; -} - -/* If there is no add link, don't show the final border. */ -.field-collection-view-final { - border-bottom: none; -} - -.field-collection-view .entity-field-collection-item { - float: left; -} - -.field-collection-view ul.field-collection-view-links { - float: right; - font-size: 0.821em; - list-style-type: none; - width: auto; - margin: 0 1em; - padding: 0; -} - -.field-collection-view .field-label { - width: 25%; -} - -.field-collection-view .content { - margin-top: 0; - width: 100%; -} - -.field-collection-view .entity-field-collection-item { - width: 100%; -} - -ul.field-collection-view-links li { - float: left; -} - -ul.field-collection-view-links li a { - margin-right: 1em; -} - -.field-collection-container ul.action-links-field-collection-add { - float: right; - padding: 0 0.5em 0 0; - margin: 0 0 1em 2em; - font-size: 0.821em; -} diff --git a/theme/field-collection-item.tpl.php b/theme/field-collection-item.tpl.php new file mode 100644 index 0000000..e4a355d --- /dev/null +++ b/theme/field-collection-item.tpl.php @@ -0,0 +1,80 @@ + + + +
> + +
> + +
+ + + + + +
+ + + + + diff --git a/theme/field_collection.theme.css b/theme/field_collection.theme.css new file mode 100644 index 0000000..3237e74 --- /dev/null +++ b/theme/field_collection.theme.css @@ -0,0 +1,49 @@ +@CHARSET "UTF-8"; + +.field-collection-item, +.field-collection-op-links-add { + margin-bottom: 1em; +} + +.field-collection-op-links { + font-size: 0.821em; + margin-bottom: 1em; + text-align: right; +} + +.field-collection-op-links-add { + border-top: 1px dotted #D3D7D9; + padding: 1em 0em; +} + +.field-collection-op-link { + padding-right: 0.3em; +} + +.field-collection-op-link:after { + border-right: 1px solid #8F8F8F; + content: ''; + padding-left: 0.6em; +} + +.field-collection-op-link:last-child { + padding-right: 0; +} + +.field-collection-op-link:last-child:after { + content: none; +} + +.field-collection-op-links .description { + margin: 0.5em 0; +} + +.field-collection-add-link:before { + color: #8F8F8F; + content: '+ '; + font-weight: bold; +} + +.field-collection-item-link .field-collection-op-links { + text-align: left; +}