Sha256: 9710c719df325787fa89da297c493ae2d64b400a2d42f219e65bc90718df226f

Contents?: true

Size: 868 Bytes

Versions: 10

Compression:

Stored size: 868 Bytes

Contents

# frozen_string_literal: true
module Zizia
  module MetadataDetailsHelper
    def css_class(value)
      return 'missing' if value == 'not configured'
      return 'missing' if value.match?(/translation missing/)
    end

    def system_field(detail)
      return "" if detail.nil?
      return "non-system-field" unless detail[:usage]
      return "system-field" if detail[:usage].match?("system field")
      "non-system-field"
    end

    def hide_system_field(detail)
      return "" if detail.nil?
      return "" unless detail[:usage]
      # rubocop: disable Rails/OutputSafety
      return "style='display: none'".html_safe if detail[:usage].match?("system field")
      # rubocop: enable Rails/OutputSafety
      ""
    end

    def true_false_to_yes_no(value)
      return "" if value.nil?
      return "yes" if value == "true"
      "no"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
zizia-6.0.1 app/helpers/zizia/metadata_details_helper.rb
zizia-6.0.0 app/helpers/zizia/metadata_details_helper.rb
zizia-5.5.0 app/helpers/zizia/metadata_details_helper.rb
zizia-5.4.0 app/helpers/zizia/metadata_details_helper.rb
zizia-5.3.0 app/helpers/zizia/metadata_details_helper.rb
zizia-5.2.0 app/helpers/zizia/metadata_details_helper.rb
zizia-5.1.0 app/helpers/zizia/metadata_details_helper.rb
zizia-5.0.1 app/helpers/zizia/metadata_details_helper.rb
zizia-5.0.0 app/helpers/zizia/metadata_details_helper.rb
zizia-4.6.0.alpha.01 app/helpers/zizia/metadata_details_helper.rb