Skip to content

Commit

Permalink
filtering-stories-by-status-dryml
Browse files Browse the repository at this point in the history
## Filtering stories by status

Rapid's `<table-plus>` is giving us some nice searching and sorting features on the project page. We can easily add some filtering into the mix, so that it's easy to, say, see only new stories.

First we'll add the filter control to the header of the table-plus. Rapid provides a `<filter-menu>` tag which is just what we need. We want to add it to the header section, before the stuff that's already there. In DRYML, you can prepend or append content to any named parameter. `<table-plus>` has a `header:` parameter, so we can use `<prepend-header:>`, like this:

SHOW_PATCH
  • Loading branch information
bryanlarsen authored and iox committed Aug 12, 2013
1 parent b478033 commit 3617654
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/views/projects/show.dryml
@@ -1,6 +1,11 @@
<show-page>
<collection: replace>
<table-plus with="&@stories" fields="this, tasks_count, status">
<prepend-header:>
<div class="filter">
Display by status: <filter-menu param-name="status" options="&StoryStatus.all"/>
</div>
</prepend-header:>
<empty-message:>No stories match your criteria</empty-message:>
</table-plus>
</collection:>
Expand Down

2 comments on commit 3617654

@ampinog
Copy link

@ampinog ampinog commented on 3617654 Feb 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tal como esta no me funciono, buscando encontré que la línea display by status: debe ser:
Display by status:

@iox
Copy link
Member

@iox iox commented on 3617654 Feb 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Angel, I'll check it and try to improve the tutorial :).

Gracias Angel, lo revisaré e intentaré mejorar el tutorial.

Please sign in to comment.