networksforchange:components

v2.1.5Published 8 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Easy Search Components

The components package adds helpful Blaze Templates to your app that cover a lot of basic functionality with extendibility and customization in mind. The easy:search package wraps this package together with easysearch:core for convenience.

1<template name="searchBox">
2  <!-- searchIndex typeof EasySearch.Index -->
3  {{> EasySearch.Input index=searchIndex }}
4
5  {{#EasySearch.IfInputEmpty index=searchIndex }}
6    <div class="padded examples">Search to see the magic!</div>
7  {{else}}
8    {{#if resultsCount}}
9      <div class="padded count-results">{{resultsCount}} results found.</div>
10    {{/if}}
11  {{/EasySearch.IfInputEmpty}}
12
13  {{#EasySearch.IfSearching index=searchIndex }}
14    <div>Searching...</div>
15  {{/EasySearch.IfSearching }}  
16  
17  <ol class="leaderboard">
18    {{#EasySearch.Each index=searchIndex }}
19      ...
20    {{/EasySearch.Each}}
21  </ol>
22
23  {{#EasySearch.IfNoResults index=searchIndex }}
24    <div class="padded no-results">No results found</div>
25  {{/EasySearch.IfNoResults }}
26  
27  {{> EasySearch.Pagination index=searchIndex maxPages=10 }}
28</template>

How to install

cd /path/to/project
meteor add easysearch:components

NB: This package will use the erasaur:meteor-lodash package if it is already installed in your application, else it will fallback to the standard Meteor underscore package