diff options
Diffstat (limited to 'app/helpers/imports_helper.rb')
| -rw-r--r-- | app/helpers/imports_helper.rb | 24 | 
1 files changed, 19 insertions, 5 deletions
| diff --git a/app/helpers/imports_helper.rb b/app/helpers/imports_helper.rb index 140660153..a297c2521 100644 --- a/app/helpers/imports_helper.rb +++ b/app/helpers/imports_helper.rb @@ -2,33 +2,47 @@  module ImportsHelper    # Import statuses helper -  def import_status(status) -    if %w[new running pending].include? status +  def import_status(status, verbose: false) +    status = status.to_s.downcase +    out = if %w[new running pending].include? status        content_tag :span, '', class: "fa fa-clock-o"      else        cls =''        cls = 'success' if status == 'successful' +      cls = 'success' if status == 'ok'        cls = 'warning' if status == 'warning' -      cls = 'danger' if %w[failed aborted canceled].include? status +      cls = 'danger' if %w[failed aborted canceled error].include? status        content_tag :span, '', class: "fa fa-circle text-#{cls}"      end +    if verbose +      out += content_tag :span do +        txt = "imports.status.#{status}".t(fallback: "") +      end +    end +    out    end    # Compliance check set messages    def bootstrap_class_for_message_criticity message_criticity -    case message_criticity -      when "error" +    case message_criticity.downcase +      when "error", "aborted"          "alert alert-danger"        when "warning"          "alert alert-warning"        when "info"          "alert alert-info" +      when "ok", "success" +        "alert alert-success"        else          message_criticity.to_s      end    end +  def import_message_content message +    export_message_content message +  end +    ##############################    #      TO CLEAN!!!    ############################## | 
