/ Copyright (c) 2010-2014 Peter Horn & Florian Thomas, Provideal GmbH / / Permission is hereby granted, free of charge, to any person obtaining / a copy of this software and associated documentation files (the / "Software"), to deal in the Software without restriction, including / without limitation the rights to use, copy, modify, merge, publish, / distribute, sublicense, and/or sell copies of the Software, and to / permit persons to whom the Software is furnished to do so, subject to / the following conditions: / / The above copyright notice and this permission notice shall be / included in all copies or substantial portions of the Software. / / THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, / EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF / MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND / NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE / LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION / OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION / WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. form.form.form-horizontal.tabulatr_filter_form data-table=table_id data-remote="true" role='form' input name="#{classname}_sort" type="hidden" - if table_options[:filter] && columns.filtered_columns.present? - columns.filtered_columns.each do |column| - name = column.full_name .control-group.form-group data-filter-column-name=name - iname = "#{classname}_filter[#{name}]" - filter_name = "tabulatr_form_#{name}" label.control-label.col-md-3 for=filter_name = column.human_name .controls.col-md-9.row - if column.filter.is_a?(Hash) || column.filter.is_a?(Array) || column.filter.is_a?(String) select.form-control id=name name=iname - if column.filter.class.is_a?(String) = column.filter - else option = options_for_select(column.filter) - elsif column.filter == :range .col-md-5 input.tabulatr_filter.form-control type="text" id="#{name}_from" data-tabulatr-attribute="#{name}_from" name="#{iname}[from]" span.col-md-1.text-center — .col-md-5 input.tabulatr_filter.form-control type="text" id="#{name}_to" data-tabulatr-attribute="#{name}_to" name="#{iname}[to]" - elsif column.filter == :checkbox = check_box_tag(iname, column.checkbox_value, false, {}) = column.checkbox_label - elsif column.filter == :exact .col-md-11 input.tabulatr_filter.form-control type="text" id="#{name}_from" data-tabulatr-attribute="#{name}" name="#{iname}" - elsif column.filter == :date .col-md-3 select.form-control name="#{iname}[date][simple]" data-tabulatr-date-filter="#{classname}_#{name}_filter" option= I18n.t("tabulatr.date_filter.none") option value="today"= I18n.t("tabulatr.date_filter.today") option value="yesterday"= I18n.t("tabulatr.date_filter.yesterday") option value="this_week"= I18n.t("tabulatr.date_filter.this_week") option value="last_7_days"= I18n.t("tabulatr.date_filter.last_7_days") option value="this_month"= I18n.t("tabulatr.date_filter.this_month") option value="last_30_days"= I18n.t("tabulatr.date_filter.last_30_days") option value="from_to"= I18n.t("tabulatr.date_filter.from_to") .col-md-1 .col-md-3 input.tabulatr_filter.form-control.date-picker.hidden.from_to type="text" id="#{classname}_#{name}_filter_from" name="#{iname}[date][from]" .col-md-1.text-center .span.from_to.hidden |— .col-md-3 input.tabulatr_filter.form-control.date-picker.from_to.hidden type="text" id="#{classname}_#{name}_filter_to" name="#{iname}[date][to]" - else .col-md-11 input.tabulatr_filter.form-control type="text" id="#{name}_from" data-tabulatr-attribute="#{name}" name="#{iname}[like]" .col-md-1 = link_to "✕", '#', 'data-hide-table-filter' => name, class: 'form-control btn btn-danger btn-mini' .control-group.form-group data-filter-column-name="_submit" label.control-label.col-md-3 for="_submit" |  .controls.col-md-9 input.submit-table.btn.btn-primary.btn-mini.btn-sm type='submit' value=I18n.t('tabulatr.apply_filters')