diff options
| author | Xinhui | 2017-05-17 11:17:53 +0200 |
|---|---|---|
| committer | Xinhui | 2017-05-17 11:17:58 +0200 |
| commit | 6b7e24df14a4c18cb50b96e9b308bd6f3caf924d (patch) | |
| tree | c5704bfd4e537814ce759a94eb896988d8947c23 /app/views/time_table_combinations | |
| parent | eb239913b31d857f532d9e21b4010a77af3e789b (diff) | |
| download | chouette-core-6b7e24df14a4c18cb50b96e9b308bd6f3caf924d.tar.bz2 | |
Wip refactoring TimeTableCombinations form & controller
Refs #3406
Diffstat (limited to 'app/views/time_table_combinations')
7 files changed, 10 insertions, 34 deletions
diff --git a/app/views/time_table_combinations/_combine.html.slim b/app/views/time_table_combinations/_combine.html.slim deleted file mode 100644 index a2e9a9c6e..000000000 --- a/app/views/time_table_combinations/_combine.html.slim +++ /dev/null @@ -1,12 +0,0 @@ -#modal_combine.modal.fade tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" - .modal-dialog - .modal-content - .modal-header - button.close type="button" data-dismiss="modal" - span aria-hidden="true" × - span.sr-only Close - - h4.modal-title id="myModalLabel" - = t('time_tables.show.combine_form') - - == render "time_table_combinations/combine_form"
\ No newline at end of file diff --git a/app/views/time_table_combinations/_combine_form.html.slim b/app/views/time_table_combinations/_combine_form.html.slim deleted file mode 100644 index 2367cd4af..000000000 --- a/app/views/time_table_combinations/_combine_form.html.slim +++ /dev/null @@ -1,11 +0,0 @@ -= semantic_form_for [@referential, @time_table, @time_table_combination], :remote => true do |form| - .modal-body - == render "shared/flash_messages" - - = form.inputs do - = form.input :operation, as: :radio, :collection => Hash[TimeTableCombination.operations.map {|b| [t( b, :scope => "time_table_combinations.operations"),b]}] - = form.input :combined_id, :label => t('.time_tables'), as: :search_time_table, :json => referential_autocomplete_time_tables_path(@referential, :format => :json), :hint_text => t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1 - - .modal-footer - = form.actions do - = form.action :submit, as: :button , :label => t('time_tables.show.combine')
\ No newline at end of file diff --git a/app/views/time_table_combinations/_form.html.slim b/app/views/time_table_combinations/_form.html.slim new file mode 100644 index 000000000..e61ceee44 --- /dev/null +++ b/app/views/time_table_combinations/_form.html.slim @@ -0,0 +1,8 @@ += simple_form_for [@referential, @time_table, @time_table_combination], html: {class: 'form-horizontal'}, wrapper: :horizontal_form do |form| + .row + .col-lg-12 + = form.input :operation, as: :select, :collection => Hash[TimeTableCombination.operations.map {|b| [t( b, :scope => "time_table_combinations.operations"),b]}] + + / = form.input :combined_id, :label => t('.time_tables'), as: :search_time_table, :json => referential_autocomplete_time_tables_path(@referential, :format => :json), hint_text: t('search_hint'), no_result_text: t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1 + + = form.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr' diff --git a/app/views/time_table_combinations/create_failure.js.slim b/app/views/time_table_combinations/create_failure.js.slim deleted file mode 100644 index c5b544483..000000000 --- a/app/views/time_table_combinations/create_failure.js.slim +++ /dev/null @@ -1,3 +0,0 @@ -| var combine_form_partial = "#{j render 'time_table_combinations/combine_form'}"; - -| $('#new_time_table_combination').replaceWith(combine_form_partial);
\ No newline at end of file diff --git a/app/views/time_table_combinations/create_success.js.slim b/app/views/time_table_combinations/create_success.js.slim deleted file mode 100644 index f18eea4bc..000000000 --- a/app/views/time_table_combinations/create_success.js.slim +++ /dev/null @@ -1,6 +0,0 @@ -| var combine_form_partial = "#{j render 'time_table_combinations/combine_form'}"; - -| $('#new_time_table_combination').replaceWith(combine_form_partial); - -| var time_table_partial = "#{j render 'time_tables/show_time_table'}"; -| $('#time_table_show').replaceWith(time_table_partial);
\ No newline at end of file diff --git a/app/views/time_table_combinations/new.html.slim b/app/views/time_table_combinations/new.html.slim new file mode 100644 index 000000000..9bed24730 --- /dev/null +++ b/app/views/time_table_combinations/new.html.slim @@ -0,0 +1,2 @@ += t('time_tables.show.combine_form') += render 'form' diff --git a/app/views/time_table_combinations/new.js.slim b/app/views/time_table_combinations/new.js.slim deleted file mode 100644 index 749ec04f6..000000000 --- a/app/views/time_table_combinations/new.js.slim +++ /dev/null @@ -1,2 +0,0 @@ -| var combine_form_partial = "#{j render 'time_table_combinations/combine_form'}"; -| $('#new_time_table_combination').replaceWith(combine_form_partial);
\ No newline at end of file |
