Sha256: f1dcf1dbe0607bae93e849254103c970680738a2b2912732cdfb20662a8de852

Contents?: true

Size: 958 Bytes

Versions: 9

Compression:

Stored size: 958 Bytes

Contents

module Enjoy
  module Admin
    module ContactMessage
      def self.config(fields = {})
        Proc.new {
          # navigation_label I18n.t('enjoy.contact_message')
          field :c_at do
            read_only true
          end
          field :name
          field :content, :text
          field :email
          field :phone

          Enjoy.config.contacts_fields.each_pair do |fn, ft|
            next if ft.nil?
            if ft.is_a?(Array)
              field fn, ft[1].to_sym
            else
              field fn
            end
          end

          fields.each_pair do |name, type|
            if type.nil?
              field name
            else
              if type.is_a?(Array)
                field name, type[0], &type[1]
              else
                field name, type
              end
            end
          end

          if block_given?
            yield self
          end

        }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
enjoy_cms-0.3.2.1 lib/enjoy/admin/contact_message.rb
enjoy_cms-0.3.2 lib/enjoy/admin/contact_message.rb
enjoy_cms-0.3.1.2 lib/enjoy/admin/contact_message.rb
enjoy_cms-0.3.1.1 lib/enjoy/admin/contact_message.rb
enjoy_cms-0.3.1 lib/enjoy/admin/contact_message.rb
enjoy_cms-0.3.0.4 lib/enjoy/admin/contact_message.rb
enjoy_cms-0.3.0.3 lib/enjoy/admin/contact_message.rb
enjoy_cms-0.3.0.2 lib/enjoy/admin/contact_message.rb
enjoy_cms-0.2.1 lib/enjoy/admin/contact_message.rb