Sha256: f3ac0a3d238fa48a337afec6e1ebe471960707dd9a283378ace65ad6fa3ec86e

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

= search_form_for @q, url: {}, :html =>{"data-pjax"=>true} do |f|
  = hidden_field_tag :s, "advanced"
  - (params[:q] || {}).each do |q,v|
    = f.hidden_field q,  :value => v

  .row-fluid.center
    .input-append.input-prepend
      .btn-group
        = content_tag(:select, :disabled => elements.size < 2, id: "advanced_field") do
          - for e in elements
            option data-type=e[1] value=e[0] selected=(e[0] == main_element)
              = e[0].to_s.titleize

        = select_tag nil, grouped_options_for_select(ransack_options, "cont"), id: "ransack_options"
      = f.text_field "#{main_element}_cont", id: "advanced_query"
      .btn-group
        
        = render "cardboard/resources/search_button", f: f

    = link_to "Simple Search", "#", id: "simple_search_link"
    /, class: "btn"

  .row-fluid#filter_list
    b= "Filters: "  unless params[:q].blank?
    - (params[:q] || {}).each do |q,v|
      - if v.present?
        .filter

          = link_to url_for({q: params[:q].except(q), s: "advanced"}) do
            '
            i.icon-remove
            - *a, b = q.split("_")
            = a.join(" ")
            '
            = {cont: "~", not_cont: "!~", gt: ">", lt:"<", eq: "="}[b.to_sym] || b.pluralize + " with"
            '
            = v



Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cardboard_cms-0.1.8 app/views/cardboard/resources/_advanced_search.html.slim
cardboard_cms-0.1.6 app/views/cardboard/resources/_advanced_search.html.slim
cardboard_cms-0.1.4 app/views/cardboard/resources/_advanced_search.html.slim