<div class="search row">
  {{input type="text" value=searchTerm class="input-xxlarge search no-blur" action="search"}}
  {{d-button action="search" icon="search" class="btn-primary"}}
</div>

{{#conditional-loading-spinner condition=loading}}

  {{#unless model.posts}}
    <h3>
      {{i18n "search.no_results"}} <a href class="show-help" {{action "showSearchHelp" bubbles=false}}>{{i18n "search.search_help"}}</a>
    </h3>
  {{/unless}}

  {{#each model.posts as |result|}}
    <div class='fps-result'>
        <div class='topic'>
          {{avatar result imageSize="tiny"}}
          <a class='search-link' href='{{unbound result.url}}'>
            {{topic-status topic=result.topic disableActions=true}}<span class='topic-title'>{{unbound result.topic.title}}</span>
          </a>
          <div class='search-category'>
            {{category-link result.topic.category}}
            {{plugin-outlet "full-page-search-category"}}
          </div>
        </div>
        <div class='blurb container'>
          <span class='date'>
          {{format-age result.created_at}}
          {{#if result.blurb}}
          -
          {{/if}}
          </span>
          {{#if result.blurb}}
            {{#highlight-text highlight=controller.q}}
              {{{unbound result.blurb}}}
            {{/highlight-text}}
          {{/if}}
        </div>
    </div>
  {{/each}}

  {{#if model.posts}}
  <h3 class="search-footer">
    {{i18n "search.no_more_results"}}
    <a href class="show-help" {{action "showSearchHelp" bubbles=false}}>{{i18n "search.search_help"}}</a>
  </h3>
  {{/if}}

{{/conditional-loading-spinner}}
