From 1f8d2759c545e60ab2989fc6331e55e95a3b0e67 Mon Sep 17 00:00:00 2001 From: cedricnjanga Date: Tue, 10 Apr 2018 09:40:58 -0700 Subject: Refs #6431 small changes on line & stop area status --- app/helpers/referentials_helper.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/referentials_helper.rb b/app/helpers/referentials_helper.rb index a01d901e6..9b5b13ace 100644 --- a/app/helpers/referentials_helper.rb +++ b/app/helpers/referentials_helper.rb @@ -1,15 +1,14 @@ module ReferentialsHelper # Outputs a green check icon and the text "Oui" or a red exclamation mark # icon and the text "Non" based on `status` - def line_status(status, verbose=true) - if status - out = content_tag(:span, nil, class: 'fa fa-exclamation-circle fa-lg text-danger') - out += t('activerecord.attributes.line.deactivated') if verbose - out + def line_status(status) + case status + when :deactivated + content_tag(:span, nil, class: 'fa fa-exclamation-circle fa-lg text-danger') + + Chouette::Line.tmf('deactivated') else - out = content_tag(:span, nil, class: 'fa fa-check-circle fa-lg text-success') - out += t('activerecord.attributes.line.activated') if verbose - out + content_tag(:span, nil, class: 'fa fa-check-circle fa-lg text-success') + + Chouette::Line.tmf('activated') end end -- cgit v1.2.3