Sha256: bdf8ebcef0145142e2f54c215fa79e9422974e64d3fee9af6b5bc1fa0040b8e9

Contents?: true

Size: 924 Bytes

Versions: 13

Compression:

Stored size: 924 Bytes

Contents

format :html do
  view :raw do
    wrap_with :div, class: "form-group w-100" do
      select_tag "query[keyword]", "", class: "_navbox navbox form-control w-100",
                                       placeholder: navbar_placeholder
    end
  end

  # TODO: the more natural placeholder would be the content of the navbox card, no?
  # Also, the forced division of "raw" and "core" should probably be replaced
  # with a single haml template (for core view)
  def navbar_placeholder
    @@placeholder ||= begin
      holder_card = Card["#{Card[:navbox].name}+*placeholder"]
      holder_card ? holder_card.content : "Search"
    end
  end

  view :navbar do
    class_up "navbox-form", "form-inline col-md-3"
    _render_core
  end

  view :core do
    form_tag path(mark: :search),
             method: "get", role: "search",
             class: classy("navbox-form", "nodblclick") do
      _render_raw
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
card-1.96.8 mod/search/set/self/navbox.rb
card-1.96.7 mod/search/set/self/navbox.rb
card-1.96.6 mod/search/set/self/navbox.rb
card-1.96.5 mod/search/set/self/navbox.rb
card-1.96.4 mod/search/set/self/navbox.rb
card-1.96.3 mod/search/set/self/navbox.rb
card-1.96.2 mod/search/set/self/navbox.rb
card-1.96.1 mod/search/set/self/navbox.rb
card-1.96.0 mod/search/set/self/navbox.rb
card-1.95.3 mod/search/set/self/navbox.rb
card-1.95.2 mod/search/set/self/navbox.rb
card-1.95.1 mod/search/set/self/navbox.rb
card-1.95.0 mod/search/set/self/navbox.rb