Sha256: 0f1c497774a20a81289f5db442a8c6d941748eaa4c91ee8bb6a385449094ec81

Contents?: true

Size: 1.12 KB

Versions: 5

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

class Admin::Tramway::Landing::BlockForm < ::Tramway::ExtendedApplicationForm
  association :page

  properties :title, :background, :view_state_event, :block_type, :position, :navbar_link, :anchor, :description,
    :link_object_type, :link_object_id, :button_title, :button_link, :view_name

  def initialize(object = nil)
    super(object).tap do
      form_properties page: :association,
                      title: :string,
                      background: :file,
                      position: {
                        type: :numeric,
                        input_options: {
                          hint: I18n.t('hints.tramway.landing.block.position', array: ::Tramway::Landing::Block.on_main_page.map(&:position).join(','))
                        }
                      },
                      block_type: :default,
                      navbar_link: :default,
                      anchor: :string,
                      description: :ckeditor,
                      button_title: :string,
                      button_link: :string,
                      view_name: :string
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tramway-landing-3.3.0.11 app/forms/admin/tramway/landing/block_form.rb
tramway-landing-3.3.0.10 app/forms/admin/tramway/landing/block_form.rb
tramway-landing-3.3.0.9 app/forms/admin/tramway/landing/block_form.rb
tramway-landing-3.3.0.8 app/forms/admin/tramway/landing/block_form.rb
tramway-landing-3.3.0.7 app/forms/admin/tramway/landing/block_form.rb