Sha256: a6540c9208bfcac9d9b13a03bf5bb2ae6dddb3d3fd96429a7ad6f3d9162f0dfa

Contents?: true

Size: 1.69 KB

Versions: 1

Compression:

Stored size: 1.69 KB

Contents

- if params[:q]
  - if params[:q].length > 0
    %h2
      = "Search for '#{params[:q]}'"
  - if @search_results.suggestion
    %p
      Did you mean
      %a{:href => "/search?q=#{@search_results.suggestion}"}
        = @search_results.suggestion
  %ul
    - @search_results.items.map {|i| i.object.feature["id"] }.uniq.each do |current_feature_id|
      - root_search_result = @search_results.items.find { |r| r.object.feature["id"] == current_feature_id }
      %li
        %a{:href => "/features/#{root_search_result.object.feature["id"]}"}
          = root_search_result.object.feature["name"]
        - if root_search_result.object.feature["tags"]
          = haml :tag_links, {:locals => {:tags => root_search_result.object.feature["tags"]}, :layout => false}
        %p
          != highlighted_search_result_blurb root_search_result
        %ul
          - @search_results.items.select { |r| r.object.feature["id"] == current_feature_id }.each do |search_result|
            - if search_result.object.scenario && search_result.object.scenario["id"]
              %li
                %a{:href => "/features/#{search_result.object.scenario["id"].gsub(";", "/scenario/")}"}
                  = search_result.object.scenario["name"]
                - if search_result.object.scenario["tags"]
                  = haml :tag_links, {:locals => {:tags => search_result.object.scenario["tags"]}, :layout => false}
                %p
                  != highlighted_search_result_blurb(search_result)
  - if @search_results.items.empty?
    %p{:class => 'alert-message error'}
      Where's Wally? This search returned no results.

- else
  %p{:class => 'alert-message error'}
    Where's Wally? This search returned no results.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wally-0.0.33 lib/wally/views/search.haml