Sha256: 638f0f0705e8b98d7d8daab1f0e1c12bdaab405208cf2eb79592d3efbe9b3d69

Contents?: true

Size: 1.27 KB

Versions: 12

Compression:

Stored size: 1.27 KB

Contents

format do
  view :core, cache: :never do
    _render search_result_view
  end

  def search_result_view
    case search_with_params
    when Exception              then :search_error
    when Integer                then :search_count
    when nest_mode == :template then :raw
    else                         :card_list
    end
  end
end

format :rss do
  view :feed_body do
    case raw_feed_items
    when Exception then @xml.item(render!(:search_error))
    when Integer then @xml.item(render!(:search_count))
    else super()
    end
  end

  def raw_feed_items
    @raw_feed_items ||= search_with_params
  end
end

format :html do
  view :core do
    _render search_result_view
  end

  view :bar do
    voo.hide :one_line_content
    super()
  end

  view :one_line_content, cache: :never do
    if depth > max_depth
      "..."
    else
      render_core hide: "paging", items: { view: :link }
      # TODO: if item is queryified to be "name", then that should work.
      # otherwise use link
    end
  end

  def rss_link_tag
    path_opts = { format: :rss }
    Array(search_params[:vars]).compact.each { |k, v| opts["_#{k}"] = v }
    tag "link", rel: "alternate",
                type: "application/rss+xml",
                title: "RSS",
                href: path(path_opts)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
card-mod-search-0.18.1 set/abstract/search_views.rb
card-mod-search-0.18.0 set/abstract/search_views.rb
card-mod-search-0.17.0 set/abstract/search_views.rb
card-mod-search-0.16.0 set/abstract/search_views.rb
card-mod-search-0.15.6 set/abstract/search_views.rb
card-mod-search-0.15.5 set/abstract/search_views.rb
card-mod-search-0.15.4 set/abstract/search_views.rb
card-mod-search-0.15.3 set/abstract/search_views.rb
card-mod-search-0.15.2.pre1 set/abstract/search_views.rb
card-mod-search-0.15.1.1 set/abstract/search_views.rb
card-mod-search-0.15.1 set/abstract/search_views.rb
card-mod-search-0.15.0 set/abstract/search_views.rb