The code for these forms is output in definition lists, which seems like overkill and ends up being problematic for themers that style definition lists.

IMO, they should be removed and output as like any other form for consistency, and we could shed all of this code:

system-behaviors.css

/**
 * Multiselect form
 */
dl.multiselect dd, dl.multiselect dd .form-item, dl.multiselect dd select {
  font-family: inherit;
  font-size: inherit;
  width: 14em;
}
dl.multiselect dt, dl.multiselect dd {
  float: left; /* LTR */
  line-height: 1.75em;
  padding: 0;
  margin: 0 1em 0 0; /* LTR */
}
dl.multiselect .form-item {
  height: 1.75em;
  margin: 0;
}

node.css

/* Override the default multiselect layout in system-behavior.css. */
#node-admin-content dl.multiselect dd, dl.multiselect dd .form-item {
  width: 20em; /* 6em label + 14em select */
}
#node-admin-content dl.multiselect dd .form-item label {
  display: block;
  float: left; /* LTR */
  width: 6em;
  font-weight: normal;
}

user.css

/* Override the default multiselect layout in system-behavior.css. */
#user-filter-form dl.multiselect dd, dl.multiselect dd .form-item {
  width: 20em; /* 6em label + 14em select */
}
#user-filter-form dl.multiselect dd .form-item label {
  display: block;
  float: left; /* LTR */
  width: 6em;
  font-weight: normal;
}
CommentFileSizeAuthor
#98 732914-98.patch557 bytesmgifford
#93 732914-93.patch978 bytespbz1912
#90 argh.png19.94 KBJacine
#90 732914-90.patch1.13 KBJacine
#80 translate-interface.png18.22 KBJacine
#79 locale-bug.png94.08 KBreglogge
#78 locale-form-item.png64.88 KBJeff Burnz
#73 before.png55.5 KBreglogge
#73 after.png53.23 KBreglogge
#73 drupal.system-exposed-filters.73.patch19.24 KBreglogge
#69 drupal.system-exposed-filters.69.patch19.39 KBreglogge
#68 drupal.system-exposed-filters.68.patch19.35 KBJacine
#68 exposed-filters-IE6.png5.69 KBJacine
#64 drupal.system-exposed-filters.64.patch19.21 KBsun
#59 Before.png5.3 KBcosmicdreams
#59 after.PNG4.2 KBcosmicdreams
#56 Capture1.PNG3.41 KBcosmicdreams
#56 Capture2.PNG4.02 KBcosmicdreams
#55 732914-55.patch19.13 KBJacine
#50 Selection_017.png5.09 KBcosmicdreams
#49 drupal.system-exposed-filters.49.patch18 KBsun
#47 732914-45.patch18.62 KBJacine
#45 732914-44.patch18.63 KBJacine
#41 732914-40.patch19.17 KBJacine
#41 732914-40-b.patch18.67 KBJacine
#39 732914-39.patch19.2 KBJacine
#39 732914-39-b.patch18.7 KBJacine
#37 732914-37.patch19.26 KBJacine
#37 rtl-filters.jpg77.93 KBJacine
#36 Home text isn't disable.png139.34 KBaspilicious
#34 chromeAfter.png160.31 KBaspilicious
#34 ffAfter.png542.83 KBaspilicious
#34 ieAfter.png206.06 KBaspilicious
#30 732914-30.patch17.74 KBJacine
#26 chromeFilterContentAfter.png158.72 KBaspilicious
#26 chromeFilterContentBefore.png142.25 KBaspilicious
#26 chromeFilterPeopleAfter.png160.85 KBaspilicious
#26 chromeFilterPeopleBefore.png157.46 KBaspilicious
#26 ffFilterContentAfter.png198.46 KBaspilicious
#26 ffFilterContentBefore.png557.39 KBaspilicious
#26 ffFilterPeopleAfter.png200.18 KBaspilicious
#26 ffFilterPeopleBefore.png662.34 KBaspilicious
#26 ieFilterContentAfter.png208.98 KBaspilicious
#26 ieFilterContentBefore.png199.13 KBaspilicious
#26 ieFilterPeopleAfter.png209.59 KBaspilicious
#26 ieFilterPeopleBefore.png202.14 KBaspilicious
#26 operaFilterContentAfter.png198.29 KBaspilicious
#26 operaFilterContentBefore.png204.25 KBaspilicious
#26 operaFilterPeopleAfter.png200.38 KBaspilicious
#26 operaFilterPeopleBefore.png198.35 KBaspilicious
#25 drupal.system-exposed-filters.25.patch17.57 KBsun
#23 732914-23.patch15.75 KBJacine
#21 732914-21.patch16.69 KBJacine
#19 732914-19.patch16.75 KBJacine
#17 732914-17.patch16.89 KBJacine
#14 732914-14.patch16.94 KBJacine
#9 drupal.admin-filter-form.8.patch6.33 KBsun
#8 container-inline.png16.33 KBcosmicdreams
#3 fieldset-result.png23.26 KBcosmicdreams
#2 drupal.dl-cleanup.2.patch2.45 KBcosmicdreams
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jacine’s picture

Title: Improve the markup for content and user filter forms » Improve the markup/CSS for content and user filter forms

Even it it's too late for the markup, the CSS can and should be improved here, to at least fix the floating issues they cause. See #676800: Fieldsets break design badly

cosmicdreams’s picture

FileSize
2.45 KB

@Jacine: This patch does what you suggest. Testing it now.

cosmicdreams’s picture

FileSize
23.26 KB

Here's a sample of what happens to the fieldset once those styles are removed. If I'm reading you OP correctly, you are saying that the responsibility of rendering these form elements properly should fall onto the theme's shoulders. Do I have that right?

Jacine’s picture

@cosmicdreams - Thanks for getting on this so fast and for the screenshot :)

I am hoping to actually remove the DL markup & CSS, and then wrap the form items using .container-inline, so the only visual difference would be the button at the bottom of the form.

cosmicdreams’s picture

For Seven there is also a lot of css in style.css that effects these definition lists. Should that stay?

Jacine’s picture

Issue tags: +Needs design review

Nope, it should go.

That's why I bring up this issue. Most themes end up having to massaging this code, because it's not really flexible. I don't think themes should have to do anything at all for this to work properly.

The hope is to remove all of it, and let the default form styling (.container-inline, .form-item) handle it.

Tagging this needs design review so hopefully we can get more themers on it to chime in with feedback ;)

sun’s picture

Kill the #theme functions, to start with.

Second, #type = container around the list of enabled filters and around the form to enhance the filter.

Third, #field_prefix is now allowed on all form elements (or is my patch still in the RTBC queue?), so the select list labels _could_ be output with that. OTOH, looking at that form, I see a pure two-col form layout. Theming 101 :P

Due to the container of "second", the form actions can float around the filters form items.

cosmicdreams’s picture

FileSize
16.33 KB

Using Firebug: I was able to test out your idea. I'll post the code an a snippet of how it looks below:

<fieldset id="edit-filters" class="container-inline">
<legend><span class="fieldset-legend">Show only items where</span></legend>
  <div class="fieldset-wrapper">
    <ul class="clearfix"></ul>
    <dl class="multiselect">
      <dd>
        <div class="form-item form-type-select form-item-status">
          <label for="edit-status-2">status </label>
          <select id="edit-status-2" class="form-select" name="status">
            <option selected="selected" value="[any]">any</option>
            <option value="status-1">published</option>
            <option value="status-0">not published</option>
            <option value="promote-1">promoted</option>
            <option value="promote-0">not promoted</option>
            <option value="sticky-1">sticky</option>
            <option value="sticky-0">not sticky</option>
          </select>
        </div>
        <div class="form-item form-type-select form-item-type">
          <label for="edit-type">type </label>
          <select id="edit-type" class="form-select" name="type">
            <option selected="selected" value="[any]">any</option>
            <option value="article">Article</option>
            <option value="page">Basic page</option>
            <option value="poll">Poll</option>
          </select>
        </div>
      </dd>
    </dl>
    <div id="node-admin-buttons" class="form-actions container-inline form-wrapper">
      <input type="submit" class="form-submit" value="Filter" id="edit-submit" name="op">
    </div>
  </div>
</fieldset>
sun’s picture

Status: Active » Needs review
FileSize
6.33 KB

Starting point.

1) Same needs to be applied to User admin filter form.

2) Search for .multiselect across core and nuke/adapt everything.

3) Filter form actions may need minimal margin tweaking to be horizontally in line with first select list. Ideally, we apply an additional class to the container + apply some special CSS here, so we do not duplicate the same PHP/CSS code...

seutje’s picture

subscribe

Status: Needs review » Needs work

The last submitted patch, drupal.admin-filter-form.8.patch, failed testing.

sun’s picture

Is anyone able to continue here? I'd be happy to assist. However, I've already mentioned in IRC that I have little interest in this patch myself (aside from the very nice clean-ups), because I'm using the admin_views module that ships with admin_menu, which replaces those pages entirely with dynamic, ajaxified Views + VBO.

+++ modules/system/system-behavior.css	4 Mar 2010 21:29:30 -0000
@@ -182,22 +182,15 @@ tr .ajax-progress .throbber {
+ * Multi-filter form.

1) Rename to "Two column form layout".

2) These styles are totally unrelated to JavaScript behaviors. If there is a system.css, let's move the new styles in there.

Powered by Dreditor.

Jacine’s picture

@sun If no one else gets to it before me, I'll be giving it a shot over the weekend.

Jacine’s picture

Status: Needs work » Needs review
FileSize
16.94 KB

Ok, here's my attempt at this. Notes:

  • A theme function is still needed to semantically represent the current filters in a list. I consolidated these functions into one function called theme_exposed_filters() and put them in form.inc. Not sure if that is the right location.
  • As part of the consolidation of these theme functions, I had to add extra markup, i.e. "and where" when filters are applied. I used the following code to add a #prefix: '#prefix' => ($i ? '<div class="additional-filters"><em>' . t('and') . '</em> ' . t('where') . '</div>' : ''), I'm not sure if checking $i here is correct, but it doesn't work with: !empty($form['filters']['current'])
  • Because of the new theme function, the CSS targets .exposed-filters, so I removed the 2-column form layout code. I'm kinda on the fence about whether we can/should try to make that generic here because the width of the labels needs to be known and that's tough outside of this specific use case. I did leave the class, for now, in case you think that should be added back.

What still needs to be done:

  1. RTL styling in system-rtl.css. Not quite sure what it should look like since RTL isn't exactly my forte.
  2. Docs for theme_exposed_filters in form.inc. Need assistance with this.
  3. We probably need to figure out why @sun's patch failed above, as this one will probably fail too.
  4. Seven needs to use bullets for .item-list li. Sheesh.

BTW, cross browser and theme (garland/stark/seven) testing has been done and it's looking good to me. I'll post some screenshots.

Jacine’s picture

Oh, and maybe you guys can explain to me why I can't do:

$output .= drupal_render($form);

but, instead I need to specifically do:

  $output .= drupal_render($form['status']);
  $output .= drupal_render($form['actions']);

That was a serious WTF moment for me, so I would appreciate some guidance there. Thanks. :)

sun’s picture

drupal_render_children() is your friend. If you are stuck, the best recommendation I can give is simply to lookup similar stuff in Drupal core. (That's how I learned about drupal_render_children() myself ;) Probably not the best example, but: http://api.drupal.org/api/function/theme_filter_admin_format_filter_order/7

Jacine’s picture

FileSize
16.89 KB

Oh, ha! :D Thank you @sun.

I did look around (not enough obviously), and tried drupal_render(element_children($form)); :P

Updated patch attached.

sun’s picture

Code review. Didn't apply the patch and look at the actual output yet.

+++ includes/form.inc	6 Mar 2010 22:24:23 -0000
@@ -3133,6 +3133,38 @@ function theme_form_element_label($varia
+ * Theme an exposed filter form.
+*

Wrong indentation.

+++ includes/form.inc	6 Mar 2010 22:24:23 -0000
RCS file: modules/node/node-rtl.css
diff -N modules/node/node-rtl.css

+++ modules/system/system.css	6 Mar 2010 22:24:25 -0000
--- modules/user/user-rtl.css	3 Jan 2010 21:01:04 -0000	1.7
+++ modules/user/user-rtl.css	6 Mar 2010 22:24:26 -0000

We have to remember to put back corresponding RTL styles into system-rtl.css.

+++ modules/node/node.admin.inc	6 Mar 2010 22:24:24 -0000
@@ -150,8 +150,13 @@ function node_filter_form() {
+    '#attributes' => array('class' => array('form-layout-twocol clearfix')),

@@ -177,9 +190,17 @@ function node_filter_form() {
+    '#attributes' => array('class' => array('form-layout-twocol', 'clearfix')),

+++ modules/user/user.admin.inc	6 Mar 2010 22:24:26 -0000
@@ -40,7 +40,11 @@ function user_filter_form() {
+    '#attributes' => array('class' => array('form-layout-twocol clearfix')),

@@ -55,16 +59,30 @@ function user_filter_form() {
+    '#attributes' => array('class' => array('form-layout-twocol', 'clearfix')),

We can remove those .form-layout-twocol classes with this approach.

+++ modules/node/node.admin.inc	6 Mar 2010 22:24:24 -0000
@@ -177,9 +190,17 @@ function node_filter_form() {
+    '#prefix' => ($i ? '<div class="additional-filters"><em>' . t('and') . '</em> ' . t('where') . '</div>' : ''),

+++ modules/user/user.admin.inc	6 Mar 2010 22:24:26 -0000
@@ -55,16 +59,30 @@ function user_filter_form() {
+    '#prefix' => ($i ? '<div class="additional-filters"><em>' . t('and') . '</em> ' . t('where') . '</div>' : ''),

1) Not sure whether this doesn't rather belong into the theme function? Entirely not sure though. Perhaps not.

2) t() should contain the entire phrase - inline markup is allowed. Otherwise, translators have no chance to translate these words for this context. (The DIV doesn't count as inline markup of course)

+++ modules/system/system-behavior.css	6 Mar 2010 22:24:25 -0000
--- modules/system/system.css	18 Jan 2010 17:29:28 -0000	1.73
+++ modules/system/system.css	6 Mar 2010 22:24:25 -0000

btw, do we also have an admin.css? This stuff only appears on administrative pages, so actually admin.css would make the most sense... (if I'm not mistaken, then system.css is loaded unconditionally for all pages)

Powered by Dreditor.

Jacine’s picture

FileSize
16.75 KB

Yay, ok. Here's another patch.

  1. Indentation fixed
  2. occurrences of .form-layout-twocol removed
  3. t() implementation fixed
  4. CSS moved to admin.css (yay, you're right this is a much better idea)

I was on the fence about the additional filters text being in the theme function vs. the form too, but with themes being able to alter this, the form_alter might be easier. Especially if you only want to affect 1 of the forms. Either way seems fine to me though, so I trust whatever you think it best.

Updated todo list:

  1. RTL styling needs to be done in admin-rtl.css.
  2. Docs for theme_exposed_filters in form.inc.
sun’s picture

+++ modules/node/node.admin.inc	6 Mar 2010 23:28:49 -0000
@@ -150,8 +150,13 @@ function node_filter_form() {
+    '#theme' => 'exposed_filters',

+++ modules/user/user.admin.inc	6 Mar 2010 23:28:51 -0000
@@ -40,7 +40,11 @@ function user_filter_form() {
+    '#theme' => 'exposed_filters',

Thank god we talked about theme overrides just before... this should be

'#theme' => 'exposed_filters__node',

See http://api.drupal.org/api/function/theme/7 for details.

+++ includes/form.inc	6 Mar 2010 23:28:47 -0000
@@ -3133,6 +3133,37 @@ function theme_form_element_label($varia
+ * @param $variables
+ *   An associative array containing an exposed filter form.
+ *   @todo - Get help to do this right.

Actually, it's a fragment of a form, i.e. a partial form structure. Not sure how that is described elsewhere, but yeah, let's look elsewhere ;)

+++ includes/form.inc	6 Mar 2010 23:28:47 -0000
@@ -3133,6 +3133,37 @@ function theme_form_element_label($varia
+ * @return
+ *   A string containing an HTML-formatted form.

I don't think that @return is required here.

+++ includes/form.inc	6 Mar 2010 23:28:47 -0000
@@ -3133,6 +3133,37 @@ function theme_form_element_label($varia
+  $items = array();
+  if (!empty($form['current'])) {
+    foreach (element_children($form['current']) as $key) {

This !empty() will always be TRUE due to form_builder(). We can simply remove it, element_children() will take care for the rest.

+++ modules/system/admin.css	6 Mar 2010 23:28:50 -0000
@@ -135,3 +135,45 @@ table.screenshot {
+
+

Duplicate newline.

+++ modules/system/admin.css	6 Mar 2010 23:28:50 -0000
@@ -135,3 +135,45 @@ table.screenshot {
\ No newline at end of file

This should not happen :)

144 critical left. Go review some!

Jacine’s picture

FileSize
16.69 KB

Oops. Ok:

  1. Changed the #theme to exposed_filters__node and exposed_filters__user
  2. Removed the !empty() from the theme function
  3. Fixed my coding style mess (hopefully)

FYI, regarding the function docs, I found that standard (which is still under discussion) here: #716496: Theme functions group needs some updates in this comment. I'll look around and see if I can find anything though.

Status: Needs review » Needs work

The last submitted patch, 732914-21.patch, failed testing.

Jacine’s picture

Status: Needs work » Needs review
FileSize
15.75 KB

Re-roll. Maybe the testbot will like this one?

Status: Needs review » Needs work

The last submitted patch, 732914-23.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
17.57 KB

Helping you out a bit.

aspilicious’s picture

aspilicious’s picture

Status: Reviewed & tested by the community » Needs review

There isn't enough space between the dropdown boxes after patch (see screens in #26)

EDIT:

role, permission, ... are bold after patch

Jacine’s picture

@sun Thanks so much for the help with the testing stuff. How did you know I was lost on it? ;)

@aspilicious You are awesome! Thanks for pointing that out. :)

I think this was a Seven-specific issue. I'll fix it tonight.

sun’s picture

@jacine: I had my second training session in telepathy last week. Glad that your thoughts crossed my mind.

Jacine’s picture

FileSize
17.74 KB

@sun hehe ;) I am glad too!

Ok, here's an updated version that fixes the margins and the label.

Jacine’s picture

Status: Needs review » Needs work

Oh man, this still needs RTL love. Who can help with that?

sun’s picture

@jacine: Just enable Locale module, add the "English" language one more time, edit that new language, and set it to RTL -- and you'll see the "switched" output.

aspilicious’s picture

Everthing looks good now, and in #32 works this is rtbc (leave this to jacine).
In the IE screen you see that some buttons are way to close to a drop down box.
But that was also before the patch, so that's an other issue!

aspilicious’s picture

Status: Needs work » Needs review
FileSize
206.06 KB
542.83 KB
160.31 KB

Forgot screenshots...

sun’s picture

Can someone test with a RTL language setting (see #32 for how to) and mark this RTBC?

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
139.34 KB

This one is rtbc I tested it. Same screenshots as #34 but in mirror view.

I found an rtl error but I don't think it's related.
Do I have to open new issue? (screenshot)

Jacine’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
77.93 KB
19.26 KB

Here's a reroll w/RTL support. Testing in Garland revealed an issue with the code when filters are applied. The filter value needs to be in a <strong>.

I fixed this by doing:

'#markup' => '<strong>' . check_plain($value) . '</strong>',

If that's wrong, let me know. Here's the updated patch and a before and after screenshot.

sun’s picture

1) TBH, all of those text formattings always confused me. No idea why "and" is always emphasized, the property too + bold on top, and the value only bold... ?

Can we remove those formattings and just use %-placeholders in the t()-strings? %-placeholders are triggering http://api.drupal.org/api/function/drupal_placeholder/7, so we could style them differently, if needed. Most probably, it would make sense to remove the italics and just make 'em bold.

2) The list bullets in the "after" shots do not look like Garland's list bullets (as in the "before" shots). Intentional? Not sure whether that's a good idea.

Jacine’s picture

FileSize
18.7 KB
19.2 KB

Ok... #1 has always bugged me too. I wasn't sure I should touch it, but it's fixed now and looking much better.

#2 - I didn't even notice that until you pointed it out, but it allows us to fix another annoyance. The difference is that the list was hard-coded before, and now it's being run through theme_item_list() which is kinda broken in Garland.

system.css has:

.item-list ul li {
  margin: 0 0 0.25em 1.5em; /* LTR */
  padding: 0;
  list-style: disc; 
}

garland style.css has:

ul, li.leaf {
  list-style-image: url(images/menu-leaf.gif);
}

So, the disc, which is totally asinine to declare in the first place wins. I don't know if you want to do that here or not, so there are 2 versions of this patch attached. 732914-39-b leaves system.css alone.

Status: Needs review » Needs work

The last submitted patch, 732914-39-b.patch, failed testing.

Jacine’s picture

Status: Needs work » Needs review
FileSize
18.67 KB
19.17 KB

Ugh, sorry... forgot to take my @override out.

Let's try this again.

Status: Needs review » Needs work

The last submitted patch, 732914-40-b.patch, failed testing.

sun’s picture

+++ modules/node/node.admin.inc	22 Mar 2010 06:52:55 -0000
@@ -177,9 +188,17 @@ function node_filter_form() {
+    '#prefix' => ($i ? '<div class="additional-filters">' . t('<em>and</em> where') . '</div>' : ''),

Still an EM here.

+++ modules/node/node.test	22 Mar 2010 06:52:55 -0000
@@ -1140,7 +1140,10 @@ class NodeAdminTestCase extends DrupalWe
+    $this->assertRaw(t('<strong>%property</strong> is', array('%property' => t('status'))), t('Content list is filtered by status.'));

@@ -1150,8 +1153,13 @@ class NodeAdminTestCase extends DrupalWe
+    $this->assertRaw(t('<strong>%property</strong> is', array('%property' => t('status'))), t('Content list is filtered by status.'));
...
+    $this->assertRaw(t('<em>and</em> where <strong>%property</strong> is', array('%property' => t('type'))), t('Content list is filtered by content type.'));

The test assertions need to be updated. ;)

+++ modules/system/admin.css	22 Mar 2010 06:52:56 -0000
@@ -116,6 +116,7 @@ table.screenshot {
+ * @group

Can we remove that? (no consensus reached yet)

+++ modules/system/admin.css	22 Mar 2010 06:52:56 -0000
@@ -135,3 +136,53 @@ table.screenshot {
+/**
+* Exposed filters
+*/

Wrong indentation.

+++ modules/system/admin.css	22 Mar 2010 06:52:56 -0000
@@ -135,3 +136,53 @@ table.screenshot {
+.exposed-filters .form-item,
+.exposed-filters .form-actions,
+.exposed-filters .form-item label {
+  margin: 0;
+  padding: 0;
+  overflow: hidden;
+}
+.exposed-filters .form-item {
+  margin-bottom: 0.1em;
+}

I'm not a fan of wildcard overrides like this + subsequent re-overrides of the previous overrides. In themes, we can do that, but I'd prefer to avoid it in default/module CSS.

+++ modules/system/admin.css	22 Mar 2010 06:52:56 -0000
@@ -135,3 +136,53 @@ table.screenshot {
+.exposed-filters .filters {
+  float: left; /* LTR */
+  width: 22em;
+  overflow: hidden;

Why does this need a width? Same question for overflow?

+++ modules/system/admin.css	22 Mar 2010 06:52:56 -0000
@@ -135,3 +136,53 @@ table.screenshot {
+/* Current Filters */
+.exposed-filters .item-list {
+  margin-bottom: 1em;
+}
+.exposed-filters li {
+  margin-left: 0; /* LTR */
+}
+.exposed-filters li .form-item,
+.exposed-filters li .form-item label {

TBH, this looks a bit awkward. Can't we target the current filters a bit more precisely?

(is this also the reason for the overrides mentioned earlier?)

+++ modules/system/system.css	22 Mar 2010 06:52:56 -0000
@@ -113,7 +113,6 @@ div.ok, tr.ok {
 .item-list ul li {
   margin: 0 0 0.25em 1.5em; /* LTR */
   padding: 0;
-  list-style: disc;
 }

Actually, I'd prefer to remove this styling altogether. Stark can rely on browser default styling, and for every theme out in the wild, styles like this get horribly in the way. We can do this change here, but should definitely create a follow-up to fix system.css.

+++ modules/system/system.module	22 Mar 2010 06:52:56 -0000
@@ -3629,6 +3629,35 @@ function theme_system_settings_form($var
+function theme_exposed_filters($variables) {
...
+  foreach (element_children($form['current']) as $key) {
+    $items[] = drupal_render($form['current'][$key]);
+  }
+  if ($items) {
+    $output .= theme('item_list', array('items' => $items, 'attributes' => array('class' => 'clearfix')));

+++ modules/user/user.admin.inc	22 Mar 2010 06:52:56 -0000
@@ -40,7 +40,11 @@ function user_filter_form() {
+  $form['filters']['current'] = array(
+    '#type' => 'container',
+    '#attributes' => array('class' => array('clearfix')),
   );

aha! We don't apply a class for the current filters yet.

140 critical left. Go review some!

Jacine’s picture

Status: Needs work » Needs review
FileSize
18.63 KB

Ok, here's another try at this. I don't know if the test stuff is right. A width is needed because of IE, overflow is not so that's gone. I also removed this since it's not having any affect as we are making this output in a list and added a current-filters class to the theme function:

$form['filters']['current'] = array(
   '#type' => 'container',
   '#attributes' => array('class' => array('clearfix')),
);

Hopefully this addresses everything above.

Status: Needs review » Needs work

The last submitted patch, 732914-44.patch, failed testing.

Jacine’s picture

Status: Needs work » Needs review
FileSize
18.62 KB

Forgot one more EM. The patch failed testing, so this one will too. I don't get it.

Status: Needs review » Needs work

The last submitted patch, 732914-45.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
18 KB

This one should come back green.

I've additionally streamlined the markup and CSS a bit. Feel free to yell at me. ;)

cosmicdreams’s picture

FileSize
5.09 KB

So far this looks like an improvement. Testing in Safari we see that /admin/content's dropdowns have a clear seperation. When the dropdowns are selected a very visible highlight of the field is present. However, /admin/reports/dblog needs a better seperation of the two multi-select boxes (Type and Severity). There is no visible gap between them (see: selection_017.png)

sun’s picture

That reports filter form is not touched by this patch, sorry. :)

EDIT: And shouldn't/couldn't, as it's using a different structure/workflow.

sun’s picture

RTBC, anyone?

Jacine’s picture

Status: Needs review » Needs work

What is the point of this?

+  $form['filters']['status'] = array(
+    '#type' => 'container',
+    '#attributes' => array('class' => array('clearfix')),
+    '#prefix' => ($i ? '<div class="additional-filters">' . t('and where') . '</div>' : ''),
+  );

That clearfix class doesn't end up used as far as I can tell, and if I really wanted to modify this I would have to deal with both the theme function AND the form. The additional filters part seems like it belongs in the theme function.

Also, re: the width on .filters have you tested on IE6? If I'm wrong, fine, but I remember double-checking and it being an issue. Anyway, I'll look again tonight.

sun’s picture

Yay, that almost sounds like yelling :)

.clearfix is used to clear the float that is applied to align the buttons next to the additional filters.

If we want to separate the additional filters text prefix, then it should simply be added as new, first subkey:

  $form['filters']['status']['additional'] = array(
    '#type' => 'container',
    '#attributes' => array('class' => array('additional-filters')),
  );
  $form['filters']['status']['additional']['prefix'] = array(
    '#markup' => t('and where'),
  );
Jacine’s picture

Status: Needs work » Needs review
FileSize
19.13 KB

No, this is fine, and I guess I was wrong about needing the width on filters (sorry), though it's still making me a feel a bit crazy.

Only thing that was wrong in the patch (and it's my probably my fault for forgetting it in my last patch) is the theme_node_filters() function not being removed. This reroll just takes care of that and doesn't change anything else. I think it's ready.

cosmicdreams’s picture

FileSize
4.02 KB
3.41 KB

I'm not sure if this is something this patch should be concerned with but I'm just going to post it here anyways. In IE7, on admin/content, the buttons seem inconsistent in their design. one button is flush with the right side of a select box the other is not. See screenshots.

Testing the rest...

cosmicdreams’s picture

This issue seems to work well for Safari (on windows). Good improvement.

Jacine’s picture

@cosmicdreams Thanks for testing. The issue you bring is not related. Capture 2 is all we are messing with here.

cosmicdreams’s picture

FileSize
4.2 KB
5.3 KB

I've tested firefox 3.6, Opera 10.51, IE 6, 7, and 8, and Safari 4. The only issue I found for the area of the page that Capture2.png shows is with IE 6. See the screenshot I attached.

There doesn't seem to be a major issue with IE6, perhaps the area that these fields need can be widened for IE6.

cosmicdreams’s picture

patch doesn't apply anymore. Here's the content of the .rej file:

***************
*** 1005,1042 ****
    drupal_set_message(t('The role has been deleted.'));
    $form_state['redirect'] = 'admin/people/permissions/roles';
  }
-
- /**
-  * Theme user administration filter selector.
-  *
-  * @ingroup themeable
-  */
- function theme_user_filters($variables) {
-   $form = $variables['form'];
-
-   $output = '<ul class="clearfix">';
-   if (!empty($form['current'])) {
-     foreach (element_children($form['current']) as $key) {
-       $output .= '<li>' . drupal_render($form['current'][$key]) . '</li>';
-     }
-   }
-   $output .= '</ul>';
-
-   $output .= '<div class="clearfix">';
-
-   $output .= '<dl class="multiselect">' . (!empty($form['current']) ? '<dt><em>' . t('and') . '</em> ' . t('where') . '</dt>' : '');
-
-   $output .= '<dd>';
-
-   foreach (element_children($form['status']) as $key) {
-     $output .= drupal_render($form['status'][$key]);
-   }
-   $output .= '</dd>';
-
-   $output .= '</dl>';
-   $output .= drupal_render($form['actions']);
-
-   $output .= '</div>';
-
-   return $output;
- }
--- 1012,1014 ----
    drupal_set_message(t('The role has been deleted.'));
    $form_state['redirect'] = 'admin/people/permissions/roles';
  }

I tried to reroll this patch myself but it's those last two lines that have me confused. The theme_user_filters function is at the end of the page. It seems like in this patch it isn't and i'm not sure if I simply need to remove the the theme_user_filters function or if there is more that needs to be done.

retester2010’s picture

Issue tags: -Needs design review

#55: 732914-55.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Needs design review

The last submitted patch, 732914-55.patch, failed testing.

Jacine’s picture

I've tested firefox 3.6, Opera 10.51, IE 6, 7, and 8, and Safari 4. The only issue I found for the area of the page that Capture2.png shows is with IE 6. See the screenshot I attached.

Hmm, this is actually why I had a width set in CSS, but Sun said we didn't need it. I will try to reroll this by this weekend.

sun’s picture

Status: Needs work » Needs review
Issue tags: -Needs design review
FileSize
19.21 KB

Oh dear, I thought this was in already.

Re-rolled against HEAD. (only, no other changes)

RobLoach’s picture

Issue tags: +markupmarines

This patch makes my brain explode from too much awesome.

reglogge’s picture

Status: Needs review » Reviewed & tested by the community

This works beautifully. Especially nice that the width of the labels is now increased to 10em (was only 6em before) which solves problems for translated installs where 6em was sometimes to narrow.

Tested in Safari (Mac), FF (Mac, Windows), IE7

Jacine’s picture

Status: Reviewed & tested by the community » Needs work

I need to add a width to fix the issue described in #59. After that this will be ready. I'm going to work on this right now.

Jacine’s picture

Status: Needs work » Needs review
FileSize
5.69 KB
19.35 KB

Ok, width added back and tested for IE6. Screenshot of IE6 attached. I think this is ready.

reglogge’s picture

The width of 22em for .exposed-filters .filters in admin.css is too small since .exposed-filters .form-item label has 10em and .exposed-filters .form-select has 14em. We need 25em for .exposed-filters .filters since .exposed-filters .form-select also has 2px padding.

Otherwise select boxes are positioned below the label.

Patch attached.

Jacine’s picture

Yeah, you're right. Thanks for the review and for re-rolling the patch :)

sun’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

This is an awesome clean-up. Removes more lines than it adds, and improves the situation while doing so. I think this is ready to fly. If there are any remaining issues, we can deal with them in follow-ups.

sun’s picture

Just saw that this patch is still sitting in the queue. Still ready to go in, doesn't break anything, but allows modules (if they want) to remove lots of duplicate code.

reglogge’s picture

Just for reviewers two screenshots showing the filter select controls on admin/content as an example. Note the added margins between the selext controls in after.png.

This even works in IE6.

The patch is a simple reroll aginst current HEAD since the patch from #69 didn't apply cleanly anymore.

Jacine’s picture

@regelogge It worked in IE6 all along. We did a LOT of testing. What changes did you make in the latest reroll?

reglogge’s picture

No changes in code against #69 at all, just the reroll since the patch in #69 didn't apply cleanly anymore against today's HEAD.

Jacine’s picture

Status: Reviewed & tested by the community » Needs review

Great, thank you :) New patches need to be reviewed though. Let's make sure the bot is all good with it and I'll give it a test again as well.

Jacine’s picture

Status: Needs review » Reviewed & tested by the community

Ok, it's all good. Back to RTBC. Thanks again for re-rolling @reglogge!

Jeff Burnz’s picture

Status: Reviewed & tested by the community » Needs work
FileSize
64.88 KB

This is a great patch and one that really should go through - I just found an odd situation when Locale module is enabled and the front end theme and admin theme are the same theme - locale loads some CSS that restricts the width of the form-item to just 15em, so it wraps. If we add a width: auto; to .exposed-filters .form-item we can negate this ever happening.

.exposed-filters .form-item {
  margin: 0 0 0.1em;
  padding: 0;
  width: auto;
}
reglogge’s picture

FileSize
94.08 KB

I can't reproduce the problem from #78.

I tried with Bartik and Garland both enabled as front end and admin theme at the same time. Locale module is enabled. Seems that in my install (fresh checkout from today) locale.css doesn't get loaded for these pages like /admin/content at all.

Did you test this with the latest HEAD? If so, can you describe more exactly the steps you took to arrive at this situation?

Jacine’s picture

FileSize
18.22 KB

Wow, good catch Jeff. That is totally buried, and I'd actually call it a bug with the locale module's CSS. It seems to me that entire form should be converted to use the code we are using in this patch, as it is yet another filter form that seems to be using better markup, but some of the original CSS used for the user and content filter forms we are fixing here.

I tracked down what that actual code is for. It's on this page: admin/config/regional/translate/translate. I've attached a screenshot of the filter form in question. What do you guys think?

Jeff Burnz’s picture

From what i can tell locale.css is only meant to load on admin/config/regional/translate/translate but I don't really have the time to dig into Locale and figure out why or when this loads - from what i can tell I have English as my default language and Arabic and Swedish installed as well. Apart from that I can't tell you much more. I always run patches against latest head - don't you ;)

EDIT - yes Jacine, I would say its a bug also, I can't see anywhere or why this CSS would load ever for the Content Pages.

Jacine’s picture

Status: Needs work » Reviewed & tested by the community

Ok, we need to file a bug against the locale.css for that. It would be nice to convert that form to use theme_exposed_filters() in this patch, but since it would mean a significant change in the UI, and this patch does not change the UI, it should be taken care of separately.

FTR, while I believe that it's happening, I also cannot reproduce this. I tried with all the core themes, using the same front end and backend theme, with locale enabled, 3 languages set, and content in each of them and I'm not seeing the problem.

Setting this back to RTBC.

Jeff Burnz’s picture

Just out of interest are you guys using Overlay? I wasn't, but when I turned on the Overlay the issue went away.

Jacine’s picture

I was using Overlay at first, but I tried to trigger this without it as well.

Jeff Burnz’s picture

OK, I posted as issue against Locale #914194: locale.css loaded and applied on other pages and elements - but I still think we should add width:auto; as this seems pretty fragile without it.

Jacine’s picture

I dunno. I'm not thrilled about adding excess in brand spanking new CSS, just because it might get broken.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Jacine’s picture

Awesome! Thank you Dries ;)

I cannot wait to point out that this has been fixed when I hear the next person complaint about it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Jacine’s picture

Status: Closed (fixed) » Needs review
FileSize
1.13 KB
19.94 KB

I ran into a problem with this today, as shown in the screenshot, by setting a line-height: 2em on label.

We basically need to clear the float for the label, but don't have an easy way of doing that since we cannot affect the classes on the form element wrapper, so here's a patch that uses inline-block for that label instead. I think it's better because it removes the need for the RTL code (it even works fine in IE because the label has a width).

Jacine’s picture

#90: 732914-90.patch queued for re-testing.

Jacine’s picture

Version: 7.x-dev » 8.x-dev
Component: markup » CSS
Issue tags: -markupmarines +Needs backport to D7
pbz1912’s picture

Issue tags: -Needs backport to D7
FileSize
978 bytes

Patch in #90 didn't apply any more as core moved to core/ folder.

I have recreated the patch. Just needs testing.

Manjit.Singh’s picture

93: 732914-93.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 93: 732914-93.patch, failed testing.

Manjit.Singh’s picture

Status: Needs work » Needs review

93: 732914-93.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 93: 732914-93.patch, failed testing.

mgifford’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
557 bytes

Reroll..

Status: Needs review » Needs work

The last submitted patch, 98: 732914-98.patch, failed testing.

LewisNyman’s picture

Issue tags: +frontend, +CSS

Status: Needs work » Needs review

mgifford queued 98: 732914-98.patch for re-testing.

mgifford’s picture

The patch is just CSS so the errors don't make sense to me.

idebr’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Needs review » Needs work

The theme function for Exposed filters has been removed in Drupal 8 in favor of Views exposed filters in #2087239: Remove theme_exposed_filters(). The CSS is no longer in use since it has been abstracted into new class .form--inline in #2333719: Abstract Views Exposed Form styling out into a reusable class, so this issue is only relevant for D7

  • Dries committed 1d9f387 on 8.3.x
    - Patch #732914 by Jacine, sun, reglogge, cosmicdreams: improve the...

  • Dries committed 1d9f387 on 8.3.x
    - Patch #732914 by Jacine, sun, reglogge, cosmicdreams: improve the...

  • Dries committed 1d9f387 on 8.4.x
    - Patch #732914 by Jacine, sun, reglogge, cosmicdreams: improve the...

  • Dries committed 1d9f387 on 8.4.x
    - Patch #732914 by Jacine, sun, reglogge, cosmicdreams: improve the...

  • Dries committed 1d9f387 on 9.1.x
    - Patch #732914 by Jacine, sun, reglogge, cosmicdreams: improve the...