diff options
| -rw-r--r-- | app/assets/javascripts/select2.coffee | 14 | ||||
| -rw-r--r-- | app/views/autocomplete_calendars/autocomplete.rabl | 2 | ||||
| -rw-r--r-- | app/views/autocomplete_time_tables/index.rabl | 2 | ||||
| -rw-r--r-- | app/views/time_table_combinations/_form.html.slim | 4 | 
4 files changed, 6 insertions, 16 deletions
| diff --git a/app/assets/javascripts/select2.coffee b/app/assets/javascripts/select2.coffee index 6771a7d05..07efac6d1 100644 --- a/app/assets/javascripts/select2.coffee +++ b/app/assets/javascripts/select2.coffee @@ -20,23 +20,13 @@ bind_select2_ajax = (el, cfg = {}) ->        delay: 125,        processResults: (data, params) -> results: data      minimumInputLength: 3 -    templateResult: eval(target.data('formater')) +    templateResult: (item) -> +      item.text      templateSelection: (item) ->        item.text    bind_select2(el, cfg) -select2_time_table = (item) -> -  return item.text if item.loading -  wrap  = $('<div>', "class":'select2-result clearfix') -  wrap.html(["<h5>#{item.comment}</h5>"].join("\n")) - -select2_calendar = (item) -> -  return item.text if item.loading -  wrap  = $('<div>', "class":'select2-result clearfix') -  wrap.html(["<h5>#{item.name}</h5>"].join("\n")) - -  @select_2 = ->    $("[data-select2ed='true']").each ->      bind_select2(this) diff --git a/app/views/autocomplete_calendars/autocomplete.rabl b/app/views/autocomplete_calendars/autocomplete.rabl index 199195f31..9aba2c37b 100644 --- a/app/views/autocomplete_calendars/autocomplete.rabl +++ b/app/views/autocomplete_calendars/autocomplete.rabl @@ -1,5 +1,5 @@  collection @calendars, :object_root => false  attribute :id, :name, :short_name, :shared  node :text do |cal| -  cal.name +  "#{cal.id} - #{cal.name}"  end diff --git a/app/views/autocomplete_time_tables/index.rabl b/app/views/autocomplete_time_tables/index.rabl index bd478301d..f52429e9d 100644 --- a/app/views/autocomplete_time_tables/index.rabl +++ b/app/views/autocomplete_time_tables/index.rabl @@ -5,7 +5,7 @@ node do |time_table|      :time_table_bounding => time_table.presenter.time_table_bounding,      :composition_info => time_table.presenter.composition_info,      :tags => time_table.tags.join(','), -    :text => time_table.comment, +    :text => "#{time_table.objectid.parts.try(:third)} - #{time_table.comment}",      :day_types => %w(monday tuesday wednesday thursday friday saturday sunday).select{ |d| time_table.send(d) }.map{ |d| time_table.human_attribute_name(d).first(2)}.join('')}  end diff --git a/app/views/time_table_combinations/_form.html.slim b/app/views/time_table_combinations/_form.html.slim index ef6a1b56b..1cda41597 100644 --- a/app/views/time_table_combinations/_form.html.slim +++ b/app/views/time_table_combinations/_form.html.slim @@ -5,8 +5,8 @@ h1 = @time_table.comment        = form.input :combined_type, as: :select, collection: ['time_table', 'calendar']        = form.input :operation, as: :select, collection: TimeTableCombination.operations -      = form.input :time_table_id, as: :select, input_html: {class: 'tt_combination_target', data: { select2_ajax: 'true', term: 'comment_cont', url: referential_autocomplete_time_tables_path(@referential, format: :json), formater: 'select2_time_table'}}, disabled: @combination.combined_type != 'time_table', wrapper_html: {class: @combination.combined_type != 'time_table' ? 'hidden' : ''} +      = form.input :time_table_id, as: :select, input_html: {class: 'tt_combination_target', data: { select2_ajax: 'true', term: 'comment_cont', url: referential_autocomplete_time_tables_path(@referential, format: :json)}}, disabled: @combination.combined_type != 'time_table', wrapper_html: {class: @combination.combined_type != 'time_table' ? 'hidden' : ''} -      = form.input :calendar_id, as: :select, input_html: { class: 'tt_combination_target', data: { select2_ajax: 'true', term: 'name_cont', url: autocomplete_calendars_path, formater: 'select2_calendar'}}, disabled: @combination.combined_type != 'calendar', wrapper_html: {class: @combination.combined_type != 'calendar' ? 'hidden' : ''} +      = form.input :calendar_id, as: :select, input_html: { class: 'tt_combination_target', data: { select2_ajax: 'true', term: 'name_cont', url: autocomplete_calendars_path}}, disabled: @combination.combined_type != 'calendar', wrapper_html: {class: @combination.combined_type != 'calendar' ? 'hidden' : ''}        = form.button :submit, t('actions.submit') | 
