Sha256: 189d1997cc88ff44dd0656ef3993541b82791aa69a0997db76112ded91399a97

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

module Headmin
  module Filter
    class OperatorView < ViewModel
      def allowed_operators
        @allowed_operators || []
      end

      def selected
        @selected || nil
      end

      def operator_symbol
        {
          eq: "&equals; #{I18n.t("headmin.filters.operators.eq")}",
          not_eq: "&ne; #{I18n.t("headmin.filters.operators.not_eq")}",
          gt: "&gt; #{I18n.t("headmin.filters.operators.gt")}",
          gteq: "&ge; #{I18n.t("headmin.filters.operators.gteq")}",
          lt: "&lt; #{I18n.t("headmin.filters.operators.lt")}",
          lteq: "&le; #{I18n.t("headmin.filters.operators.lteq")}",
          starts_with: "&sqsub; #{I18n.t("headmin.filters.operators.starts_with")}",
          ends_with: "&sqsup; #{I18n.t("headmin.filters.operators.ends_with")}",
          matches: "&approx; #{I18n.t("headmin.filters.operators.matches")}",
          does_not_match: "&napprox; #{I18n.t("headmin.filters.operators.does_not_match")}",
          is_null: "&#9675; #{I18n.t("headmin.filters.operators.is_null")}",
          is_not_null: "&#9679; #{I18n.t("headmin.filters.operators.is_not_null")}"
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
headmin-0.5.3 app/models/headmin/filter/operator_view.rb
headmin-0.5.2 app/models/headmin/filter/operator_view.rb
headmin-0.5.1 app/models/headmin/filter/operator_view.rb
headmin-0.5.0 app/models/headmin/filter/operator_view.rb