hummingbird-me/hummingbird

View on GitHub
frontend/app/templates/search.hbs

Summary

Maintainability
Test Coverage
<div class="container search-container">
  <div class="search-container-head">
    <h2>Search Hummingbird for...</h2>
  </div>
  <div class="search-container-body">
    <form class="row" {{action "submitSearch" on="submit"}}>
      <div class="col-md-9">
        {{input value=query class="form-control" placeholder="I'm sure there's something interesting to find here!"}}
      </div>
      <div class="col-md-3">
        {{view "select" class="form-control"
                        content=scopes
                        optionValuePath="content.value"
                        optionLabelPath="content.label"
                        value=scope}}
      </div>
    </form>
    <hr />
    <ul class="search-container-results">
      {{#if performingSearch}}
        <li>{{loading-indicator}}</li>
      {{else}}
        {{#each searchResults as |result|}}
          <li class="search-result clearfix">
          {{!-- == TODO: For 2 col layout with library feature later ==
            <li class="search-result row">
              <div class="col-md-8">
            --}}
              {{#link-to result.type result.link}}
                <img {{bind-attr src="result.image"}} class="search-result-image" />
                <div class="pull-right">
                  {{#each result.badges as |badge|}}
                    <span {{bind-attr class=":badge badge.class"}}>{{{badge.content}}}</span>
                  {{/each}}
                </div>
                <p class="search-result-details">
                  <strong>{{result.title}}</strong><br />
                  {{result.desc}}
                </p>
              {{/link-to}}
            {{!--
            </div>
            <div class="col-md-4">
              &nbsp;
            </div>
            --}}
          </li>
        {{else}}
          {{#if performedSearch}}
            <p class="search-results-nosuccess">
            <span class="noresults-icon"><i class="fa fa-meh-o"></i></span>
            <span class="noresults-text">No results found for <strong>{{filter}}: {{searchRequest}}</strong></span>
            </p>
          {{/if}}
        {{/each}}
      {{/if}}
    </ul>
  </div>
</div>