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 committed Nov 14, 2011
1 parent bdccf92 commit 83bbb2f
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

0 comments on commit 83bbb2f

Please sign in to comment.