Sha256: c97520586ce7e190d5f17ae28b4171354ffc5dbc5c2c97efc5b73c8435c5dad6

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

- classes = 'btn'
- classes << ' btn-danger' if url_params.present? and (url_params.keys != ["f"] or url_params["f"].keys != ["s"]) # "f[s]" is OK
- link_data = { toggle: "ajax-modal", params: url_params, width: "600px", backdrop: "static", "modal-overflow" => true, tabindex: "-1" }

- if Basepack::Settings.filters.model_name and can?(:create, Basepack::Settings.filters.model_name.constantize)
  = link_to url, class: classes, data: link_data do
    %i.icon-search
    Filtr
  - filters = Basepack::Settings.filters.model_name.constantize.active.where(filter_type: resource_class.to_s).to_a
  - if filters.present?
    %button{type: "button", class: classes + ' dropdown-toggle', 'data-toggle' => "dropdown"}
      %span{class: "caret"}
    %ul.dropdown-menu.text-left{role: "menu", 'aria-labelledby' => "dropdownMenu"}
      %li.nav-header
        %small
          %a{href: polymorphic_path([:filters, association_chain, resource_class].flatten), tabindex: '-1'}
            %i.icon-folder-open-alt
            Seznam uložených filtrů
      - filters.each do |filter|
        %li{class: (filter.filter == url_params['ql'] ? 'active' : '')}
          %a{href: polymorphic_path([association_chain, resource_class].flatten, ql: filter.filter), tabindex: '-1'}= filter.name
- else
  = link_to url, class: classes, data: link_data do
    %i.icon-search
    = I18n.t('admin.misc.filter')

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
basepack-0.0.2 app/views/forms/buttons/_query.html.haml