diff --git a/core/modules/views/css/views.base.css b/core/modules/views/css/views.base.css index 7ca2f49..a29083c 100644 --- a/core/modules/views/css/views.base.css +++ b/core/modules/views/css/views.base.css @@ -1,13 +1,3 @@ -.views-exposed-form .views-exposed-widget { - display: inline-block; -} - -.views-exposed-form .form-item, -.views-exposed-form .form-submit { - margin-top: 0; - margin-bottom: 0; -} - /* table style column align */ .views-align-left { text-align: left; diff --git a/core/modules/views/css/views.exposed_form.css b/core/modules/views/css/views.exposed_form.css new file mode 100644 index 0000000..e33962e --- /dev/null +++ b/core/modules/views/css/views.exposed_form.css @@ -0,0 +1,15 @@ +.views-exposed-form label { + float: left; + font-weight: normal; + width: 10em; +} + +.views-exposed-form .form-item { + margin: 0 0 0.1em 0; + padding: 0; +} + +.views-exposed-form .views-exposed-widgets { + float: left; + margin-right: 1em; +} diff --git a/core/modules/views/templates/views-exposed-form.html.twig b/core/modules/views/templates/views-exposed-form.html.twig index 239b67d..48dd55a 100644 --- a/core/modules/views/templates/views-exposed-form.html.twig +++ b/core/modules/views/templates/views-exposed-form.html.twig @@ -35,53 +35,8 @@ {% endif %}
- {% for index, widget in widgets %} -
- {% if widget.label %} - - {% endif %} - {% if widget.operator %} -
- {{ widget.operator }} -
- {% endif %} -
- {{ widget.widget }} -
- {% if widget.description %} -
- {{ widget.description }} -
- {% endif %} -
- {% endfor %} - {% if form.sort_by %} -
- {{ form.sort_by }} -
-
- {{ form.sort_order }} -
- {% endif %} - {% if form.items_per_page %} -
- {{ form.items_per_page }} -
- {% endif %} - {% if form.offset %} -
- {{ form.offset }} -
- {% endif %} -
- {{ form }} -
- {% if form.reset_button %} -
- {{ form.reset_button }} -
- {% endif %} + {% hide(form.submit) %} + {{ form }}
+ {{ form.submit }}
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index bd9500d..29f8d19 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -1049,52 +1049,17 @@ function template_preprocess_views_view_row_rss(&$vars) { function template_preprocess_views_exposed_form(&$vars) { $form = &$vars['form']; - // Put all single checkboxes together in the last spot. - $checkboxes = array(); - if (!empty($form['q'])) { $vars['q'] = $form['q']; } - $vars['widgets'] = array(); - foreach ($form['#info'] as $id => $info) { - // Set aside checkboxes. - if (isset($form[$info['value']]['#type']) && $form[$info['value']]['#type'] == 'checkbox') { - $checkboxes[] = $form[$info['value']]; - continue; - } - $widget = new stdClass(); - // set up defaults so that there's always something there. - $widget->label = $widget->operator = $widget->widget = $widget->description = ''; - - $widget->id = isset($form[$info['value']]['#id']) ? $form[$info['value']]['#id'] : ''; + // Include basic theming for exposed forms. + @$form['#attached']['css'][] = drupal_get_path('module', 'views') . '/css/views.exposed_form.css'; + foreach ($form['#info'] as $id => $info) { if (!empty($info['label'])) { - $widget->label = check_plain($info['label']); - } - if (!empty($info['operator']) && isset($form[$info['operator']])) { - $widget->operator = $form[$info['operator']]; + $form[$info['value']]['#title'] = $info['label']; } - - $widget->widget = $form[$info['value']]; - - if (!empty($info['description'])) { - $widget->description = check_plain($info['description']); - } - - $vars['widgets'][$id] = $widget; - // Unset the widget, so that it doesn't get rendered twice. - unset($form[$info['value']]); - } - - // Wrap up all the checkboxes we set aside into a widget. - if (!empty($checkboxes)) { - $widget = new stdClass(); - // set up defaults so that there's always something there. - $widget->label = $widget->operator = $widget->widget = NULL; - $widget->id = 'checkboxes'; - $widget->widget = $checkboxes; - $vars['widgets']['checkboxes'] = $widget; } }