We currently have 'empty row' message functionality in theme_tablesort, but we should standardize this and apply it to theme_table as well. Plus, we can do fun things and apply an 'empty' class.

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new21.48 KB

Hooray! And took an opportunity to standardize our empty row text as 'No [thing] available.' and double checked that any empty messages with an add link (like 'Add new content type') have new [thing] local actions on the page.

dave reid’s picture

Title: Add 'empty' row functionality to theme_table. » Add 'empty' row functionality to theme_table (standardize with tableselects)

Status: Needs review » Needs work

The last submitted patch failed testing.

dave reid’s picture

Status: Needs work » Needs review
StatusFileSize
new28.11 KB

Fixed the test failures (changes in expected strings).

dave reid’s picture

Title: Add 'empty' row functionality to theme_table (standardize with tableselects) » Standardize add 'empty' row functionality to all table (from tableselect elements)

Dave Reid requested that failed test be re-tested.

mattyoung’s picture

~

dries’s picture

Status: Needs review » Fixed

Nice clean-up. Making an exception for it. Committed.

Status: Fixed » Closed (fixed)

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

Bojhan’s picture

Status: Closed (fixed) » Active

#664394: Convert remaining tables to "Empty table pattern" - This patch broke the UI standard. Please add Usability tag, if it changes a UI element.

dave reid’s picture

@Bojhan: Is this documented on the usability patterns site? I'll help fix this back but we were inconsistant within core with a minority of the tables including an 'Add' link. I thought this is why we had local actions like the 'Add content' on the Content listing page.

Bojhan’s picture

Cough - what site? :) See http://drupal.org/node/501452 and then Tables.. We do this as basically an extra call to action, its just a 0.5 second win over local actions.

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new5.4 KB

Patch re-adds all the removed add action links to the empty table rows.

casey’s picture

Not sure if possible, but shouldn't we use something like:

...
'empty' => array(
  array(
    '#markup' => t('No categories available.')
  ),
  array(
    '#type' => 'link',
    '#path' => 'admin/config/services/aggregator/add/category',
    '#text' => t('Add category'),
  )
casey’s picture

Ok I am told previous post should be discussed in a follow-up.

Patch in #13 looks good to me.

Only thing I noticed is a forgotten space between , and 'attributes'

-  return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No vocabularies available.'),'attributes' => array('id' => 'taxonomy'))) . drupal_render_children($form);
+  return theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No vocabularies available. <a href="@link">Add vocabulary</a>.', array('@link' => url('admin/structure/taxonomy/add'))),'attributes' => array('id' => 'taxonomy'))) . drupal_render_children($form);
dave reid’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.4 KB

Good catch, even though that's what the original code was. Based on #15 marking this as RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Status: Fixed » Closed (fixed)

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