diff options
| -rw-r--r-- | app/views/time_tables/_filter.html.slim | 26 | ||||
| -rw-r--r-- | app/views/time_tables/index.html.slim | 24 | ||||
| -rw-r--r-- | config/locales/time_tables.en.yml | 1 | ||||
| -rw-r--r-- | config/locales/time_tables.fr.yml | 1 | 
4 files changed, 29 insertions, 23 deletions
| diff --git a/app/views/time_tables/_filter.html.slim b/app/views/time_tables/_filter.html.slim new file mode 100644 index 000000000..b5d8185f0 --- /dev/null +++ b/app/views/time_tables/_filter.html.slim @@ -0,0 +1,26 @@ += search_form_for @q, url: referential_time_tables_path(@referential), html: { method: :get, class: 'form form-filter' } do |f| +  .ffg-row +    .input-group.search_bar +      = f.text_field :comment_cont, :placeholder => "#{t('time_tables.index.comment')}", class: 'form-control' +      span.input-group-btn +        button.btn.btn-default type='submit' +          span.fa.fa-search + +  .ffg-row +    .form-group.togglable +      = f.label @time_tables.human_attribute_name(:color), required: false, class: 'control-label' +      = f.input :color_cont_any, collection: ["#9B9B9B", "#FFA070", "#C67300", "#7F551B", "#41CCE3", "#09B09C", "#3655D7",   "#6321A0", "#E796C6", "#DD2DAA"], as: :check_boxes, label: false, label_method: lambda{|tt| ("<span style='height:19px;'><span class='fa fa-circle' style='position:relative;top:0;margin-top:0;color:" + tt + "'></span></span>").html_safe }, required: false, wrapper_html: { class: 'checkbox_list' } + +      / = f.label @time_tables.human_attribute_name(:tag_search), required: false, class: 'control-label' +      / = f.input :tag_search, as: :tags, collection: Chouette::TimeTable.tags_on(:tags).pluck(:name), label: false, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': 'Indiquez une étiquette...' }, wrapper_html: { class: 'select2ed'}, include_blank: false + +    .form-group.togglable +      = f.label @time_tables.human_attribute_name(:bounding_dates), required: false, class: 'control-label' +      .filter_menu +        = f.input :start_date_gteq, as: :date, label: t('simple_form.from'), wrapper_html: { class: 'date filter_menu-item' } +        = f.input :end_date_lteq, as: :date, label: t('simple_form.to'), wrapper_html: { class: 'date filter_menu-item' } + + +  .actions +    = link_to 'Effacer', @workbench, class: 'btn btn-link' +    = f.submit 'Filtrer', class: 'btn btn-default' diff --git a/app/views/time_tables/index.html.slim b/app/views/time_tables/index.html.slim index 65d0787e8..4e803e18f 100644 --- a/app/views/time_tables/index.html.slim +++ b/app/views/time_tables/index.html.slim @@ -9,29 +9,7 @@    .container-fluid      .row        .col-lg-12 -        = search_form_for @q, url: referential_time_tables_path(@referential), html: { method: :get, class: 'form form-filter' } do |f| -          .ffg-row -            .input-group.search_bar -              = f.text_field :comment_cont, :placeholder => "#{t('.comment')}", class: 'form-control' -              span.input-group-btn -                button.btn.btn-default type='submit' -                  span.fa.fa-search - -          .ffg-row -            .form-group -              = f.label @time_tables.human_attribute_name(:tag_search), required: false, class: 'control-label' -              = f.input :tag_search, as: :tags, collection: Chouette::TimeTable.tags_on(:tags).pluck(:name), label: false, input_html: { 'data-select2ed': 'true', 'data-select2ed-placeholder': 'Indiquez une étiquette...' }, wrapper_html: { class: 'select2ed'}, include_blank: false - -            .form-group.togglable -              = f.label @time_tables.human_attribute_name(:bounding_dates), required: false, class: 'control-label' -              .filter_menu -                = f.input :start_date_gteq, as: :date, label: t('simple_form.from'), wrapper_html: { class: 'date filter_menu-item' } -                = f.input :end_date_lteq, as: :date, label: t('simple_form.to'), wrapper_html: { class: 'date filter_menu-item' } - - -          .actions -            = link_to 'Effacer', @workbench, class: 'btn btn-link' -            = f.submit 'Filtrer', class: 'btn btn-default' +        = render 'filter'      - if @time_tables.any?        .row diff --git a/config/locales/time_tables.en.yml b/config/locales/time_tables.en.yml index 5127675e8..495770987 100644 --- a/config/locales/time_tables.en.yml +++ b/config/locales/time_tables.en.yml @@ -1,6 +1,7 @@  en:    time_tables:      duplicate_success: "duplication succeded" +    search_no_results: 'No calendar matching your query'      time_table:        empty: "empty"        bounding: "from %{start} to %{end}" diff --git a/config/locales/time_tables.fr.yml b/config/locales/time_tables.fr.yml index dc4d4572f..12b1b9aee 100644 --- a/config/locales/time_tables.fr.yml +++ b/config/locales/time_tables.fr.yml @@ -1,6 +1,7 @@  fr:    time_tables:      duplicate_success: "duplication terminée" +    search_no_results: 'Aucun calendrier ne correspond à votre recherche'      time_table:        empty: "vide"        bounding: "du %{start} au %{end}" | 
