= form_for search, url: searches_path, method: "POST", html: {class: 'form-vertical advanced-search'} do |f| = hidden_field :commit, "Search" %h4 People .accordion#accordion2 .accordion-group .accordion-heading %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion2",:href=>"#collapseZero"} Type #collapseZero.accordion-body.collapse .accordion-inner = f.select :person_type, options_for_select(["Individual", "Company"]), {include_blank: ""}, {"ng-model" => "data.person_type", "ng-init" => "data.person_type = '#{search.person_type}'"} = f.label :person_subtype, "Company Type", "ng-show" => "data.person_type == 'Company'", :class => "ng-cloak" = f.select :person_subtype, options_for_select(["Business", "Foundation", "Government", "Nonprofit", "Other"]), {include_blank: ""}, {"ng-model" => "data.person_subtype", "ng-show" => "data.person_type == 'Company'", :class => "ng-cloak", "ng-init" => "data.person_subtype = '#{search.person_subtype}'"} .accordion-group .accordion-heading %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion2",:href=>"#collapseOne"} Tag #collapseOne.accordion-body.collapse .accordion-inner = f.text_field :tagging, placeholder: "Tag Name", :class => "typeahead", "data-provide"=>"typeahead", "data-items"=>"10", "data-source"=>"[" + @tags_string.html_safe + "]" .accordion-group .accordion-heading %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion2",:href=>"#collapseTwo"} Events #collapseTwo.accordion-body.collapse .accordion-inner -# = select_tag :has_has_not, options_for_select(["Purchaed Tickets", "Has Not Purchased"]) = f.select :event_id, options_for_select(@event_options, selected: search.event_id), include_blank: "" .accordion-group .accordion-heading %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion2",:href=>"#collapseThree"} Donations #collapseThree.accordion-body.collapse .accordion-inner .control .input-prepend %span.add-on $ = f.text_field :min_donations_amount, placeholder: "min", class: "input-mini" %span.range-separator to .input-prepend %span.add-on $ = f.text_field :max_donations_amount, placeholder: "max", class: "input-mini" .control = date_field_tag "search[min_donations_date]", search.min_donations_date.try(:strftime, "%F"), max: Time.now.strftime("%F") %span.range-separator to = date_field_tag "search[max_donations_date]", search.max_donations_date.try(:strftime, "%F"), max: Time.now.strftime("%F") .accordion-group .accordion-heading %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion2",:href=>"#collapseFour"} Value #collapseFour.accordion-body.collapse .accordion-inner .input-prepend %span.add-on $ = f.text_field :min_lifetime_value, :placeholder => "min", class: "input-mini" %span.range-separator to .input-prepend %span.add-on $ = f.text_field :max_lifetime_value, :placeholder => "max", class: "input-mini" .accordion-group .accordion-heading %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion2",:href=>"#collapseFive"} Discount Code #collapseFive.accordion-body.collapse .accordion-inner = f.select :discount_code, options_for_select(@discount_codes, search.discount_code), {:include_blank => true} .accordion-group .accordion-heading %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion2",:href=>"#collapseSix"} Location #collapseSix.accordion-body.collapse .accordion-inner = f.number_field :zip, in: 00001..99999, placeholder: "Zipcode", class: "input-small" = f.select :state, options_for_select(sorted_us_state_names, selected: search.state), {include_blank: "State"}, {class: "input-medium"} / %h4 Membership / .accordion#accordion3 / .accordion-group / .accordion-heading / %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion3",:href=>"#collapseSeven"} / Status / #collapseSeven.accordion-body.collapse / .accordion-inner / = f.select :membership_status, ["Current", "Lapsed", "Past", "Never"], include_blank: "" / .accordion-group / .accordion-heading / %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion3",:href=>"#collapseEight"} / Type / #collapseEight.accordion-body.collapse / .accordion-inner / = f.select :membership_type_id, options_from_collection_for_select(@membership_types, 'id', 'name', @search.membership_type), include_blank: "" / .accordion-group / .accordion-heading / %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion3",:href=>"#collapseNine"} / Start/End / #collapseNine.accordion-body.collapse / .accordion-inner / = date_field_tag "search[min_donations_date]", search.min_donations_date.try(:strftime, "%F"), max: Time.now.strftime("%F") / %span.range-separator to / = date_field_tag "search[max_donations_date]", search.max_donations_date.try(:strftime, "%F"), max: Time.now.strftime("%F") / .accordion-group / .accordion-heading / %a.accordion-toggle{"data-toggle"=>"collapse","data-parent"=>"#accordion3",:href=>"#collapseTen"} / Year / #collapseTen.accordion-body.collapse / .accordion-inner / = f.select :membership_status, ["2013", "2012", "2010", "2009"], include_blank: "" .control = f.submit "Search", :class => 'btn' = link_to "Simple Search", people_path