Sha256: fc7e23f79d71ffb638eba2c6012a53b284c11054c381b8dd7add799b038f3e93

Contents?: true

Size: 580 Bytes

Versions: 19

Compression:

Stored size: 580 Bytes

Contents

module AdminIt
  #
  class TilesContext < CollectionContext
    dsl do
      dsl_accessor :header do |value|
        field = fields.find { |f| f.field_name == value }
        field.nil? ? header : field.field_name
      end
    end

    class << self
      attr_reader :header

      protected

      def default_icon
        'th'
      end
    end

    def self.header
      fields.empty? ? nil : fields.first.name
    end

    def self.path
      AdminIt::Engine.routes
        .url_helpers.send("tiles_#{resource.plural}_path")
    end

    class_attr_reader :header
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
admin_it-1.3.8 lib/admin_it/context/tiles_context.rb
admin_it-1.3.7 lib/admin_it/context/tiles_context.rb
admin_it-1.3.6 lib/admin_it/context/tiles_context.rb
admin_it-1.3.5 lib/admin_it/context/tiles_context.rb
admin_it-1.3.4 lib/admin_it/context/tiles_context.rb
admin_it-1.3.3 lib/admin_it/context/tiles_context.rb
admin_it-1.3.2 lib/admin_it/context/tiles_context.rb
admin_it-1.3.1 lib/admin_it/context/tiles_context.rb
admin_it-1.3.0 lib/admin_it/context/tiles_context.rb
admin_it-1.2.8 lib/admin_it/context/tiles_context.rb
admin_it-1.2.7 lib/admin_it/context/tiles_context.rb
admin_it-1.2.6 lib/admin_it/context/tiles_context.rb
admin_it-1.2.5 lib/admin_it/context/tiles_context.rb
admin_it-1.2.4 lib/admin_it/context/tiles_context.rb
admin_it-1.2.3 lib/admin_it/context/tiles_context.rb
admin_it-1.2.2 lib/admin_it/context/tiles_context.rb
admin_it-1.2.1 lib/admin_it/context/tiles_context.rb
admin_it-1.2.0 lib/admin_it/context/tiles_context.rb
admin_it-1.1.0 lib/admin_it/context/tiles_context.rb