Sha256: 2b267543db69015f1e48456106e1f29acd23036cf4f014bcab88024d4e75a2d6

Contents?: true

Size: 1.28 KB

Versions: 8

Compression:

Stored size: 1.28 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")}",
          in: "&ni; #{I18n.t("headmin.filters.operators.in")}",
          not_in: "&notni; #{I18n.t("headmin.filters.operators.not_in")}"
        }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
headmin-0.6.1 app/models/headmin/filter/operator_view.rb
headmin-0.6.0 app/models/headmin/filter/operator_view.rb
headmin-0.5.9 app/models/headmin/filter/operator_view.rb
headmin-0.5.8 app/models/headmin/filter/operator_view.rb
headmin-0.5.7 app/models/headmin/filter/operator_view.rb
headmin-0.5.6 app/models/headmin/filter/operator_view.rb
headmin-0.5.5 app/models/headmin/filter/operator_view.rb
headmin-0.5.4 app/models/headmin/filter/operator_view.rb