Sha256: e23562e050e626284d51ce7f87c79c6c898d9b68670c6b5631885d69c443742e

Contents?: true

Size: 1.56 KB

Versions: 2

Compression:

Stored size: 1.56 KB

Contents

= javascript_include_tag "carnival/advanced_search"
= link_to t("advanced_search"), "", id: "advanced_search_toggler", :class => "carnival-action-button busca"
%ul#advanced_search_form.carnival-form
  - presenter.advanced_search_fields.each do |key, field|
    - if params[key.to_s].present? && params[key.to_s] != "undefined"
      - value =  params[key.to_s]
    %li.search_item
      .search_field
        .label
          - label_field = presenter.get_field(field)
          - translation_prefix = "activerecord.attributes.#{presenter.full_model_name}"
          - if presenter.relation_field?(label_field)
            = label_tag key, t("#{translation_prefix}.#{key.to_s.gsub('.', '_')}")
          - else
            = label_tag key, t("#{translation_prefix}.#{key}")
        .field
          = render '/carnival/shared/advanced_search_field', :field => field, :presenter => presenter, :value => value
  %li.search_item
    .action
      = link_to t("clear"), "#", :id=> "clear_button", :class => "carnival-action-button clear-search"
    .action
      = link_to t("search"), "#", :id=> "search_button", :class => "carnival-action-button search-submit"

%ul.advanced-search-tags
  - presenter.advanced_search_fields.each do |key, field|
    - if params[key.to_s].present? && params[key.to_s] != "undefined"
      - value =  params[key.to_s]
      %li.advanced-search-tag
        %span
          = t("activerecord.attributes.#{presenter.full_model_name}.#{key.to_s.gsub('.', '_')}")
          = ": #{value}"
        %a{:href => "javascript:Carnival.removeAdvancedSearch('"+key.to_s+"')"}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
carnival-0.3.0 app/views/carnival/shared/_advanced_search.html.haml
carnival-0.2.8 app/views/carnival/shared/_advanced_search.html.haml