Sha256: a301d12c6590611c448661f780716b17f1fb7778de39de1d0290a26c4bc4a986

Contents?: true

Size: 873 Bytes

Versions: 39

Compression:

Stored size: 873 Bytes

Contents

module Kuhsaft
  class TwoColumnBrick < ColumnBrick

    before_create :add_columns

    attr_accessible :partitioning

    #
    # Childs should only contain ColumnBricks, therefore we
    # don't want the user to mess with it
    #
    def user_can_add_childs?
      false
    end

    def user_can_delete?
      true
    end

    def user_can_save?
      true
    end

    #
    # Use own rendering implementation to show columns side by side
    #
    def renders_own_childs?
      true
    end

    def partitioning
      super || 0
    end

    def self.partitionings
      [Partition.new('70/30', 0), Partition.new('50/50', 1), Partition.new('30/70', 2)]
    end

    def to_style_class
      [super, 'row-fluid'].join(' ')
    end

    private

    def add_columns
      bricks << Kuhsaft::ColumnBrick.new
      bricks << Kuhsaft::ColumnBrick.new
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
kuhsaft-1.8.6 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.8.5 app/models/kuhsaft/two_column_brick.rb
kuhsaft-2.0.2 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.8.4 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.8.1 app/models/kuhsaft/two_column_brick.rb
kuhsaft-2.0.1 app/models/kuhsaft/two_column_brick.rb
kuhsaft-2.0.0 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.8.0 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.7.1 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.7.0 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.6.0 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.5.0 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.4.3 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.4.2 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.4.1 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.4.0 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.3.1 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.2.15 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.2.14 app/models/kuhsaft/two_column_brick.rb
kuhsaft-1.2.13 app/models/kuhsaft/two_column_brick.rb