diff --git a/core/modules/views_ui/css/views_ui.admin.theme.css b/core/modules/views_ui/css/views_ui.admin.theme.css index 5dc2e4d..ca24994 100644 --- a/core/modules/views_ui/css/views_ui.admin.theme.css +++ b/core/modules/views_ui/css/views_ui.admin.theme.css @@ -560,20 +560,19 @@ td.group-title { /* The contents of the popup dialog on the views edit form. */ .views-filterable-options .form-type-checkbox { - border: 1px solid #ccc; padding: 5px 8px; border-top: none; } .views-filterable-options { border-top: 1px solid #ccc; } -.views-filterable-options .filterable-option.odd .form-type-checkbox { - background-color: #f3f4ee; -} .filterable-option .form-item { margin-bottom: 0; margin-top: 0; } +.views-filterable-options .filterable-option .title { + font-weight: bold; +} .views-filterable-options .form-type-checkbox .description { margin-top: 0; margin-bottom: 0; diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index 28e2e96..c6b8e0d 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -292,6 +292,7 @@ Drupal.viewsUi.AddItemForm.prototype.handleCheck = function (event) { var $target = $(event.target); var label = $.trim($target.next().html()); + var label = $.trim($target.closest('td').next().html()); // Add/remove the checked item to the list. if ($target.is(':checked')) { this.$selected_div.show().css('display', 'block'); @@ -486,7 +487,7 @@ for (var i = 0; i < length; i++) { $option = $($allOptions[i]); $label = $option.find('label'); - $description = $option.find('div.description'); + $description = $option.find('td.description'); options[i] = { // Search on the lowercase version of the label text + description. searchText: $label.text().toLowerCase() + " " + $description.text().toLowerCase(), diff --git a/core/modules/views_ui/src/Form/Ajax/AddHandler.php b/core/modules/views_ui/src/Form/Ajax/AddHandler.php index 56cb435..31bd325 100644 --- a/core/modules/views_ui/src/Form/Ajax/AddHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/AddHandler.php @@ -107,8 +107,14 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['options']['name'] = array( '#prefix' => '
', '#suffix' => '
', + '#type' => 'table', + '#header' => array( + $this->t('Title'), + $this->t('Category'), + $this->t('Description'), + ), + '#tableselect' => TRUE, '#tree' => TRUE, - '#default_value' => 'all', ); // Group options first to simplify the usage of #states. @@ -138,12 +144,13 @@ public function buildForm(array $form, FormStateInterface $form_state) { foreach ($grouped_options as $group => $group_options) { foreach ($group_options as $key => $option) { $form['options']['name'][$key] = array( - '#type' => 'checkbox', - '#title' => $this->t('@group: @field', array('@group' => $option['group'], '@field' => $option['title'])), - '#description' => $option['help'], - '#return_value' => $key, - '#prefix' => "
", - '#suffix' => '
', + // '#type' => 'checkbox', + // '#title' => $this->t('@group: @field', array('@group' => $option['group'], '@field' => $option['title'])), + // '#description' => $option['help'], + // '#return_value' => $key, + // '#prefix' => "
", + // '#suffix' => '
', + '#tree' => TRUE, '#states' => array( 'visible' => array( array( @@ -152,8 +159,26 @@ public function buildForm(array $form, FormStateInterface $form_state) { array( ':input[name="override[controls][group]"]' => array('value' => $group), ), - ) - ) + ), + ), + '#attributes' => array( + 'class' => array('filterable-option'), + ), + 'title' => array( + '#markup' => $option['title'], + '#wrapper_attributes' => array( + 'class' => array('title'), + ), + ), + 'group' => array( + '#markup' => $option['group'], + ), + 'help' => array( + '#markup' => $option['help'], + '#wrapper_attributes' => array( + 'class' => array('description'), + ), + ), ); } }