From c48c2f8afdb378c5a3d688ff57dd45eb32ddafee Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 22 Sep 2014 11:18:56 +0200 Subject: Fix modal display Refs #0028818 --- .../stylesheets/main/vehicle_translation.css.scss | 15 +++++++++ .../stylesheets/vendor/formtastic_changes.css.scss | 13 ++++---- app/inputs/search_stop_area_input.rb | 1 + app/inputs/search_time_table_input.rb | 1 + app/views/vehicle_journeys/show.html.erb | 2 +- .../vehicle_translations/_translate_form.html.erb | 37 ++++++++-------------- config/initializers/formtastic.rb | 4 +-- config/locales/formtastic.yml | 2 ++ config/locales/vehicle_journeys.yml | 2 -- 9 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 app/assets/stylesheets/main/vehicle_translation.css.scss diff --git a/app/assets/stylesheets/main/vehicle_translation.css.scss b/app/assets/stylesheets/main/vehicle_translation.css.scss new file mode 100644 index 000000000..f399d1a4a --- /dev/null +++ b/app/assets/stylesheets/main/vehicle_translation.css.scss @@ -0,0 +1,15 @@ +#translate_form{ + .repeat_cloning{ + margin-top: 30px; + } + + .modal-footer{ + .actions { + padding-left: 75%; + + li { + margin: 0px 0px; + } + } + } +} diff --git a/app/assets/stylesheets/vendor/formtastic_changes.css.scss b/app/assets/stylesheets/vendor/formtastic_changes.css.scss index bdd634384..4e7ea0d37 100644 --- a/app/assets/stylesheets/vendor/formtastic_changes.css.scss +++ b/app/assets/stylesheets/vendor/formtastic_changes.css.scss @@ -1,17 +1,16 @@ -input.typeahead{ - & .formtastic .input { +.formtastic{ + + .input.typeahead_wrapper{ overflow: inherit !important; } -} - -.formtastic{ .label{ white-space: normal; + text-align: right; } - .input{ - overflow: visible; + .stringish input{ + width: auto; } fieldset.inputs { diff --git a/app/inputs/search_stop_area_input.rb b/app/inputs/search_stop_area_input.rb index 44f9cf82a..1feb58d00 100644 --- a/app/inputs/search_stop_area_input.rb +++ b/app/inputs/search_stop_area_input.rb @@ -9,6 +9,7 @@ class SearchStopAreaInput < Formtastic::Inputs::SearchInput crossDomain: false, tokenLimit: #{tokenLimit}, minChars: 2, + preventDuplicates: true, hintText: '#{options[:hint_text]}', noResultsText: '#{options[:no_result_text]}', searchingText: '#{options[:searching_text]}', diff --git a/app/inputs/search_time_table_input.rb b/app/inputs/search_time_table_input.rb index 49f266d7a..eb992c2d0 100644 --- a/app/inputs/search_time_table_input.rb +++ b/app/inputs/search_time_table_input.rb @@ -9,6 +9,7 @@ class SearchTimeTableInput < Formtastic::Inputs::SearchInput crossDomain: false, tokenLimit: #{tokenLimit}, minChars: 2, + propertyToSearch: 'comment', preventDuplicates: true, hintText: '#{options[:hint_text]}', noResultsText: '#{options[:no_result_text]}', diff --git a/app/views/vehicle_journeys/show.html.erb b/app/views/vehicle_journeys/show.html.erb index c7ab1e073..9bf433c29 100644 --- a/app/views/vehicle_journeys/show.html.erb +++ b/app/views/vehicle_journeys/show.html.erb @@ -6,7 +6,7 @@ diff --git a/app/views/vehicle_translations/_translate_form.html.erb b/app/views/vehicle_translations/_translate_form.html.erb index 8759d89f9..0ca6a6b84 100644 --- a/app/views/vehicle_translations/_translate_form.html.erb +++ b/app/views/vehicle_translations/_translate_form.html.erb @@ -1,35 +1,24 @@ -
- <%= render "shared/flash_messages" %> - <%= semantic_form_for [@referential, @line, @route, @vehicle_journey, @vehicle_translation], remote: true do |form| %> +<%= render "shared/flash_messages" %> +<%= semantic_form_for [@referential, @line, @route, @vehicle_journey, @vehicle_translation], remote: true do |form| %> +
+<% end %> diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb index c20f77e40..2cdc37243 100644 --- a/config/initializers/formtastic.rb +++ b/config/initializers/formtastic.rb @@ -4,10 +4,10 @@ Formtastic::FormBuilder.default_text_field_size = 50 # Set the default text area height when input is a text. Default is 20. -# Formtastic::FormBuilder.default_text_area_height = 5 +Formtastic::FormBuilder.default_text_area_height = 5 # Set the default text area width when input is a text. Default is nil. -# Formtastic::FormBuilder.default_text_area_width = 50 +Formtastic::FormBuilder.default_text_area_width = 50 # Should all fields be considered "required" by default? # Defaults to true. diff --git a/config/locales/formtastic.yml b/config/locales/formtastic.yml index 40ea23472..13b82ef2e 100644 --- a/config/locales/formtastic.yml +++ b/config/locales/formtastic.yml @@ -12,6 +12,7 @@ en: export: "Launch export" validate: "Launch validation" duplicate: "Duplicate" + clone: "Clone" fr: formtastic: @@ -27,3 +28,4 @@ fr: export: "Lancer l'export" validate: "Lancer la validation" duplicate: "Dupliquer" + clone: "Cloner" \ No newline at end of file diff --git a/config/locales/vehicle_journeys.yml b/config/locales/vehicle_journeys.yml index 810c80ddb..d9768048a 100644 --- a/config/locales/vehicle_journeys.yml +++ b/config/locales/vehicle_journeys.yml @@ -38,7 +38,6 @@ en: arrival: "Arrival" time_tables: "Calendars list" bounding: "From %{start} to %{end}" - validation: "Clone" translation_form: "Vehicle journey translations" index: title: "Vehicle journeys on route %{route}" @@ -138,7 +137,6 @@ fr: arrival: "Arrivée" time_tables: "Liste des calendriers" bounding: "De %{start} à %{end}" - validation: "Cloner" translation_form: "Cloner la course" index: title: "Courses de la séquence d'arrêts %{route}" -- cgit v1.2.3