From 9a642d186ec8ca9016dba59d925c1bdb079eb23f Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Wed, 4 Oct 2017 23:20:41 +0200 Subject: Refs 4517 Add some modification to the two modules to add methods to list the sorted transport modes and submodes --- app/views/compliance_control_blocks/_form.html.slim | 4 ++-- app/views/lines/_filters.html.slim | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/compliance_control_blocks/_form.html.slim b/app/views/compliance_control_blocks/_form.html.slim index 88fa7e98b..2e87a877e 100644 --- a/app/views/compliance_control_blocks/_form.html.slim +++ b/app/views/compliance_control_blocks/_form.html.slim @@ -2,8 +2,8 @@ .row .col-lg-12 .form-group - = f.input :transport_mode, as: :select, collection: ComplianceControlBlock.transport_modes, label: t('activerecord.attributes.compliance_control_blocks.transport_mode') - = f.input :transport_submode, as: :select, collection: ComplianceControlBlock.transport_submodes, label: t('activerecord.attributes.compliance_control_blocks.transport_submode') + = f.input :transport_mode, as: :select, collection: ComplianceControlBlock.sorted_transport_modes, label: t('activerecord.attributes.compliance_control_blocks.transport_mode'), label_method: lambda {|t| ("" + t("enumerize.transport_mode.#{t}") + "").html_safe } + = f.input :transport_submode, as: :select, collection: ComplianceControlBlock.sorted_transport_submodes, label: t('activerecord.attributes.compliance_control_blocks.transport_submode'), label_method: lambda {|t| ("" + t("enumerize.transport_submode.#{t}") + "").html_safe } .separator diff --git a/app/views/lines/_filters.html.slim b/app/views/lines/_filters.html.slim index 01c2da58f..7662c41b5 100644 --- a/app/views/lines/_filters.html.slim +++ b/app/views/lines/_filters.html.slim @@ -17,11 +17,11 @@ .form-group.togglable = f.label Chouette::Line.human_attribute_name(:transport_mode), required: false, class: 'control-label' - = f.input :transport_mode_eq_any, collection: sorted_transport_mode, as: :check_boxes, label: false, label_method: lambda{|l| ("" + t("enumerize.transport_mode.#{l}") + "").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'} + = f.input :transport_mode_eq_any, collection: Chouette::Line.sorted_transport_modes, as: :check_boxes, label: false, label_method: lambda{|l| ("" + t("enumerize.transport_mode.#{l}") + "").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'} .form-group.togglable = f.label Chouette::Line.human_attribute_name(:transport_submode), required: false, class: 'control-label' - = f.input :transport_submode_eq_any, collection: sorted_transport_submode, as: :check_boxes, label: false, label_method: lambda{|l| ("" + t("enumerize.transport_submode.#{l}") + "").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'} + = f.input :transport_submode_eq_any, collection: Chouette::Line.sorted_transport_submodes, as: :check_boxes, label: false, label_method: lambda{|l| ("" + t("enumerize.transport_submode.#{l}") + "").html_safe}, required: false, wrapper_html: { class: 'checkbox_list'} .actions = link_to 'Effacer', @workbench, class: 'btn btn-link' -- cgit v1.2.3