diff options
| author | jpl | 2017-02-09 15:18:48 +0100 |
|---|---|---|
| committer | jpl | 2017-02-09 15:18:48 +0100 |
| commit | c9c42f71e881ad279471f08cbb37ae077823d467 (patch) | |
| tree | d3dc956f836f1c474eb1899d7ef15f37ddeb18b3 | |
| parent | 9ce7eeafabfa62a23db02a6dda584a06325c9260 (diff) | |
| download | chouette-core-c9c42f71e881ad279471f08cbb37ae077823d467.tar.bz2 | |
Refs #2549: adding filters to referentials#show
| -rw-r--r-- | app/assets/stylesheets/components/_forms.sass | 2 | ||||
| -rw-r--r-- | app/views/referentials/_filters.html.slim | 55 |
2 files changed, 10 insertions, 47 deletions
diff --git a/app/assets/stylesheets/components/_forms.sass b/app/assets/stylesheets/components/_forms.sass index 4164528e0..0f4f80db9 100644 --- a/app/assets/stylesheets/components/_forms.sass +++ b/app/assets/stylesheets/components/_forms.sass @@ -227,10 +227,12 @@ $cbx-size: 20px top: 100% left: 0 min-width: 100% + max-height: 300px background-color: #fff color: $darkgrey box-shadow: 0 0 3px $darkgrey white-space: nowrap + overflow: auto $cbx-size-xs: 14px > .checkbox diff --git a/app/views/referentials/_filters.html.slim b/app/views/referentials/_filters.html.slim index 2eb0c46ac..b62a00943 100644 --- a/app/views/referentials/_filters.html.slim +++ b/app/views/referentials/_filters.html.slim @@ -1,57 +1,18 @@ = search_form_for @q, url: referential_path(@referential.id), class: 'form form-filter' do |f| - - -.form.form-filter .form-group.togglable - .control-label Mode(s) - .checkbox_list - .checkbox - label - input.check_boxes type='checkbox' - span - |1 - span.fa.fa-paw - .checkbox - label - input.check_boxes type='checkbox' - span - |2 - span.fa.fa-paw + = f.label @reflines.human_attribute_name(:transport_mode), required: false, class: 'control-label' + = f.input :transport_mode_eq_any, collection: LineReferential.first.transport_modes, as: :check_boxes, label: false, label_method: lambda{|l| ("<span>" + t("transport_modes.label.#{l}") + "</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' } .form-group.togglable - .control-label Réseau(x) - .checkbox_list - .checkbox - label - input.check_boxes type='checkbox' - span - |1 - span.fa.fa-paw - .checkbox - label - input.check_boxes type='checkbox' - span - |2 - span.fa.fa-paw + = f.label @reflines.human_attribute_name(:network), required: false, class: 'control-label' + = f.input :network_id_eq_any, collection: LineReferential.first.networks.pluck(:id), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>#{LineReferential.first.networks.find(l).name}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' } .form-group.togglable - .control-label Transporteur(s) principal(aux) - .checkbox_list - .checkbox - label - input.check_boxes type='checkbox' - span - |1 - span.fa.fa-paw - .checkbox - label - input.check_boxes type='checkbox' - span - |2 - span.fa.fa-paw + = f.label @reflines.human_attribute_name(:company), required: false, class: 'control-label' + = f.input :company_id_eq_any, collection: LineReferential.first.companies.pluck(:id), as: :check_boxes, label: false, label_method: lambda{|l| ("<span>#{LineReferential.first.companies.find(l).name}</span>").html_safe}, required: false, wrapper_html: { class: 'checkbox_list' } .actions - .btn.btn-link Effacer - .btn.btn-default Filtrer + = link_to 'Effacer', @workbench, class: 'btn btn-link' + = f.submit 'Filtrer', class: 'btn btn-default' / filtres par: modes, reseaux, transporteurs principaux |
