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) case status when :deactivated content_tag(:span, nil, class: 'fa fa-exclamation-circle fa-lg text-danger') + Chouette::Line.tmf('deactivated') else content_tag(:span, nil, class: 'fa fa-check-circle fa-lg text-success') + Chouette::Line.tmf('activated') end end def icon_for_referential_state state case state.to_s when "pending" "" when "failed" "" when "archived" "" else "" end.html_safe end def referential_state referential, icon: true state_icon = icon && icon_for_referential_state(@referential.state) "