From 69fb5dc7f7055e67a15994e99cfb5337fd9c7f8c Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Mon, 12 May 2014 10:38:06 +0100 Subject: [PATCH] Issue #2226933 by cs_shadow, tim.plunkett, mandar.harkare, mortendk: Remove odd, even, first & last classes from views-view-unformatted.html.twig. --- .../config/install/views.view.test_bulk_form.yml | 1 - .../comment/config/install/views.view.comments_recent.yml | 1 - core/modules/file/config/install/views.view.files.yml | 2 -- core/modules/node/config/install/views.view.archive.yml | 1 - core/modules/node/config/install/views.view.content.yml | 1 - .../node/config/install/views.view.content_recent.yml | 1 - core/modules/node/config/install/views.view.frontpage.yml | 1 - core/modules/node/config/install/views.view.glossary.yml | 1 - .../test_views/views.view.test_contextual_links.yml | 1 - .../taxonomy/config/install/views.view.taxonomy_term.yml | 1 - .../views.view.test_filter_taxonomy_index_tid.yml | 1 - .../test_views/views.view.test_taxonomy_parent.yml | 1 - .../test_views/views.view.test_tracker_user_uid.yml | 1 - .../user/config/install/views.view.user_admin_people.yml | 1 - .../user/config/install/views.view.who_s_online.yml | 1 - .../views/config/schema/views.data_types.schema.yml | 3 --- .../Drupal/views/Plugin/views/style/StylePluginBase.php | 7 ------- .../test_views/views.view.test_search.yml | 1 - .../test_views/views.view.test_table.yml | 1 - core/modules/views/views.theme.inc | 8 -------- 20 files changed, 36 deletions(-) diff --git a/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml b/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml index b2f66ed46ccd..ea0f50a0dbdb 100644 --- a/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml +++ b/core/modules/action/tests/action_bulk_test/config/install/views.view.test_bulk_form.yml @@ -29,7 +29,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true override: true sticky: false summary: '' diff --git a/core/modules/comment/config/install/views.view.comments_recent.yml b/core/modules/comment/config/install/views.view.comments_recent.yml index 204ef531cb49..22a7ea95964f 100644 --- a/core/modules/comment/config/install/views.view.comments_recent.yml +++ b/core/modules/comment/config/install/views.view.comments_recent.yml @@ -36,7 +36,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true type: ul wrapper_class: item-list class: '' diff --git a/core/modules/file/config/install/views.view.files.yml b/core/modules/file/config/install/views.view.files.yml index cc7d1147ba0a..2d65909205cd 100644 --- a/core/modules/file/config/install/views.view.files.yml +++ b/core/modules/file/config/install/views.view.files.yml @@ -64,7 +64,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true override: true sticky: false caption: '' @@ -989,7 +988,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true override: true sticky: false caption: '' diff --git a/core/modules/node/config/install/views.view.archive.yml b/core/modules/node/config/install/views.view.archive.yml index 943c220b296f..d9b59216ac57 100644 --- a/core/modules/node/config/install/views.view.archive.yml +++ b/core/modules/node/config/install/views.view.archive.yml @@ -110,7 +110,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true uses_fields: false provider: views row: diff --git a/core/modules/node/config/install/views.view.content.yml b/core/modules/node/config/install/views.view.content.yml index 074c5b5a3036..4b95eb3cbc99 100644 --- a/core/modules/node/config/install/views.view.content.yml +++ b/core/modules/node/config/install/views.view.content.yml @@ -39,7 +39,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true override: true sticky: true caption: '' diff --git a/core/modules/node/config/install/views.view.content_recent.yml b/core/modules/node/config/install/views.view.content_recent.yml index 2dec730b4636..1b78d3df45d6 100644 --- a/core/modules/node/config/install/views.view.content_recent.yml +++ b/core/modules/node/config/install/views.view.content_recent.yml @@ -51,7 +51,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true override: true sticky: false caption: '' diff --git a/core/modules/node/config/install/views.view.frontpage.yml b/core/modules/node/config/install/views.view.frontpage.yml index a6928ab08701..0dc004cd8776 100644 --- a/core/modules/node/config/install/views.view.frontpage.yml +++ b/core/modules/node/config/install/views.view.frontpage.yml @@ -183,7 +183,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true uses_fields: false title: '' header: { } diff --git a/core/modules/node/config/install/views.view.glossary.yml b/core/modules/node/config/install/views.view.glossary.yml index 03a7a18548ef..9ddc7b51d2e2 100644 --- a/core/modules/node/config/install/views.view.glossary.yml +++ b/core/modules/node/config/install/views.view.glossary.yml @@ -284,7 +284,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true uses_fields: false order: asc summary: '' diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml index fbb49e395c26..aa0b7199cb4e 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_contextual_links.yml @@ -55,7 +55,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true uses_fields: false title: '' header: { } diff --git a/core/modules/taxonomy/config/install/views.view.taxonomy_term.yml b/core/modules/taxonomy/config/install/views.view.taxonomy_term.yml index 6477894d0350..c39264feee46 100644 --- a/core/modules/taxonomy/config/install/views.view.taxonomy_term.yml +++ b/core/modules/taxonomy/config/install/views.view.taxonomy_term.yml @@ -165,7 +165,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true uses_fields: false provider: views row: diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml index b44debb1c414..716ccdce8989 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_filter_taxonomy_index_tid.yml @@ -62,7 +62,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true uses_fields: false row: type: fields diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_parent.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_parent.yml index 23594d9486bf..129c7194bd0b 100644 --- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_parent.yml +++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_taxonomy_parent.yml @@ -68,7 +68,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true uses_fields: false provider: views row: diff --git a/core/modules/tracker/tests/modules/tracker_test_views/test_views/views.view.test_tracker_user_uid.yml b/core/modules/tracker/tests/modules/tracker_test_views/test_views/views.view.test_tracker_user_uid.yml index 1182ff57b09c..32cfffe14787 100644 --- a/core/modules/tracker/tests/modules/tracker_test_views/test_views/views.view.test_tracker_user_uid.yml +++ b/core/modules/tracker/tests/modules/tracker_test_views/test_views/views.view.test_tracker_user_uid.yml @@ -26,7 +26,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true override: true sticky: false summary: '' diff --git a/core/modules/user/config/install/views.view.user_admin_people.yml b/core/modules/user/config/install/views.view.user_admin_people.yml index 89d1e4ea8278..6ab676df865d 100644 --- a/core/modules/user/config/install/views.view.user_admin_people.yml +++ b/core/modules/user/config/install/views.view.user_admin_people.yml @@ -66,7 +66,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true override: true sticky: false summary: '' diff --git a/core/modules/user/config/install/views.view.who_s_online.yml b/core/modules/user/config/install/views.view.who_s_online.yml index 323825b096c1..911f40f9368a 100644 --- a/core/modules/user/config/install/views.view.who_s_online.yml +++ b/core/modules/user/config/install/views.view.who_s_online.yml @@ -51,7 +51,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true type: ul wrapper_class: item-list class: '' diff --git a/core/modules/views/config/schema/views.data_types.schema.yml b/core/modules/views/config/schema/views.data_types.schema.yml index 53af089313ff..efbf3690cd98 100644 --- a/core/modules/views/config/schema/views.data_types.schema.yml +++ b/core/modules/views/config/schema/views.data_types.schema.yml @@ -665,9 +665,6 @@ views_style: default_row_class: type: boolean label: 'Add views row classes' - row_class_special: - type: boolean - label: 'Add striping (odd/even), first/last row classes' uses_fields: type: boolean label: 'Force using fields' diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php index ee71ed03bffe..64ebe6a3e668 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/style/StylePluginBase.php @@ -227,7 +227,6 @@ protected function defineOptions() { if ($this->usesRowClass()) { $options['row_class'] = array('default' => ''); $options['default_row_class'] = array('default' => TRUE, 'bool' => TRUE); - $options['row_class_special'] = array('default' => TRUE, 'bool' => TRUE); } $options['uses_fields'] = array('default' => FALSE, 'bool' => TRUE); @@ -313,12 +312,6 @@ public function buildOptionsForm(&$form, &$form_state) { '#type' => 'checkbox', '#default_value' => $this->options['default_row_class'], ); - $form['row_class_special'] = array( - '#title' => t('Add striping (odd/even), first/last row classes'), - '#description' => t('Add css classes to the first and last line, as well as odd/even classes for striping.'), - '#type' => 'checkbox', - '#default_value' => $this->options['row_class_special'], - ); } if (!$this->usesFields() || !empty($this->options['uses_fields'])) { diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_search.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_search.yml index b23b62bf77cf..57d96a8ea46a 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_search.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_search.yml @@ -111,7 +111,6 @@ display: grouping: { } row_class: '' default_row_class: true - row_class_special: true row: type: fields fields: diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_table.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_table.yml index 159b4f6d2e59..7ea2f9f586b0 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_table.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_table.yml @@ -52,7 +52,6 @@ display: grouping: { } row_class: '' default_row_class: '1' - row_class_special: '1' override: '1' sticky: '0' summary: summary-text diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index cfcc1625f91e..ae967bdb7760 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -499,8 +499,6 @@ function template_preprocess_views_view_table(&$variables) { $options = $view->style_plugin->options; $handler = $view->style_plugin; - $row_class_special = isset($options['row_class_special']) ? $options['row_class_special'] : TRUE; - $fields = &$view->field; $columns = $handler->sanitizeColumns($options['columns'], $fields); @@ -676,7 +674,6 @@ function template_preprocess_views_view_table(&$variables) { $variables['header'] = array(); } - $count = 0; foreach ($variables['rows'] as $num => $row) { $variables['rows'][$num]['attributes'] = array(); if ($row_class = $handler->getRowClass($num)) { @@ -869,15 +866,10 @@ function template_preprocess_views_view_unformatted(&$variables) { $options = $style->options; $default_row_class = isset($options['default_row_class']) ? $options['default_row_class'] : FALSE; - $row_class_special = isset($options['row_class_special']) ? $options['row_class_special'] : FALSE; - // Set up striping values. - $count = 0; - $max = count($rows); foreach ($rows as $id => $row) { $variables['rows'][$id] = array(); $variables['rows'][$id]['content'] = $row; $variables['rows'][$id]['attributes'] = array(); - $count++; if ($default_row_class) { $variables['rows'][$id]['attributes']['class'][] = 'views-row'; } -- GitLab