diff options
| author | jpl | 2017-07-28 11:02:46 +0200 | 
|---|---|---|
| committer | jpl | 2017-07-28 11:02:54 +0200 | 
| commit | 5e725d3babb2dde610b1aa3a743f2d95b16d886f (patch) | |
| tree | fd1206e8f1a39141099ca3a733308d05a2f05b40 | |
| parent | 650aaa1ddfb79e84bb11714f97494968c9a1f193 (diff) | |
| download | chouette-core-5e725d3babb2dde610b1aa3a743f2d95b16d886f.tar.bz2 | |
Refs #4184: updating tt_combination search fields autocomplete display
5 files changed, 11 insertions, 7 deletions
| diff --git a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/TimetableSelect2.js b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/TimetableSelect2.js index 14e7b60c6..56244e9a6 100644 --- a/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/TimetableSelect2.js +++ b/app/assets/javascripts/es6_browserified/vehicle_journeys/components/tools/select2s/TimetableSelect2.js @@ -38,7 +38,7 @@ class BSelect4 extends React.Component{                };              },              processResults: function(data, params) { -              console.log(data) +              // console.log(data)                return {                  results: data.map(                    item => _.assign( diff --git a/app/assets/javascripts/select2.coffee b/app/assets/javascripts/select2.coffee index 1c03fe451..2e3884d7f 100644 --- a/app/assets/javascripts/select2.coffee +++ b/app/assets/javascripts/select2.coffee @@ -25,6 +25,8 @@ bind_select2_ajax = (el, cfg = {}) ->        item.text      templateSelection: (item) ->        item.text +    escapeMarkup: (markup) -> +      markup    bind_select2(el, cfg) diff --git a/app/models/chouette/time_table.rb b/app/models/chouette/time_table.rb index 713ce0b21..7bae1bd21 100644 --- a/app/models/chouette/time_table.rb +++ b/app/models/chouette/time_table.rb @@ -297,7 +297,7 @@ class Chouette::TimeTable < Chouette::TridentActiveRecord    end    def display_day_types -    %w(monday tuesday wednesday thursday friday saturday sunday).select{ |d| self.send(d) }.map{ |d| self.human_attribute_name(d).first(2)}.join('') +    %w(monday tuesday wednesday thursday friday saturday sunday).select{ |d| self.send(d) }.map{ |d| self.human_attribute_name(d).first(2)}.join(', ')    end    def day_by_mask(flag) diff --git a/app/views/autocomplete_calendars/autocomplete.rabl b/app/views/autocomplete_calendars/autocomplete.rabl index 9aba2c37b..3a7703c53 100644 --- a/app/views/autocomplete_calendars/autocomplete.rabl +++ b/app/views/autocomplete_calendars/autocomplete.rabl @@ -1,5 +1,6 @@  collection @calendars, :object_root => false  attribute :id, :name, :short_name, :shared +  node :text do |cal| -  "#{cal.id} - #{cal.name}" +  "<strong>" + cal.name + " - " + cal.id.to_s + "</strong>"  end diff --git a/app/views/autocomplete_time_tables/index.rabl b/app/views/autocomplete_time_tables/index.rabl index 80e3f8684..7aafdca16 100644 --- a/app/views/autocomplete_time_tables/index.rabl +++ b/app/views/autocomplete_time_tables/index.rabl @@ -2,14 +2,15 @@ collection @time_tables, :object_root => false  node do |time_table|    { -    :id => time_table.id, :comment => time_table.comment, :objectid => time_table.objectid, +    :id => time_table.id, +    :comment => time_table.comment, +    :objectid => time_table.objectid,      :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} - #{time_table.display_day_types} - #{time_table.objectid.parts.try(:third)}",      :color => time_table.color,      :day_types => time_table.display_day_types, -    :short_id => time_table.objectid.parts.try(:third) +    :short_id => time_table.objectid.parts.try(:third), +    :text => "<strong><span class='fa fa-circle' style='color:" + (time_table.color ? time_table.color : '#4b4b4b') + "'></span> " + time_table.comment + " - " + time_table.objectid.parts.try(:third) + "</strong><br/><small>" + time_table.display_day_types + "</small>"    }  end - | 
