Sha256: 66da4ee78367e670ea5a9b227c6c47725200a6a769799ebe13b6c05ecc10b9e6

Contents?: true

Size: 795 Bytes

Versions: 34

Compression:

Stored size: 795 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # A form object used to attach a feature to a participatory process from the
    # admin panel.
    #
    class FeatureForm < Decidim::Form
      include TranslatableAttributes

      mimic :feature

      translatable_attribute :name, String
      validates :name, translatable_presence: true

      attribute :settings, Object
      attribute :default_step_settings, Object
      attribute :manifest
      attribute :weight, Integer, default: 0

      attribute :step_settings, Hash[String => Object]
      attribute :participatory_space

      def settings?
        settings.manifest.attributes.any?
      end

      def default_step_settings?
        default_step_settings.manifest.attributes.any?
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
decidim-admin-0.6.6 app/forms/decidim/admin/feature_form.rb
decidim-0.6.6 decidim-admin/app/forms/decidim/admin/feature_form.rb
decidim-admin-0.6.5 app/forms/decidim/admin/feature_form.rb
decidim-0.6.5 decidim-admin/app/forms/decidim/admin/feature_form.rb
decidim-admin-0.6.4 app/forms/decidim/admin/feature_form.rb
decidim-0.6.4 decidim-admin/app/forms/decidim/admin/feature_form.rb
decidim-admin-0.6.3 app/forms/decidim/admin/feature_form.rb
decidim-0.6.3 decidim-admin/app/forms/decidim/admin/feature_form.rb
decidim-admin-0.6.2 app/forms/decidim/admin/feature_form.rb
decidim-0.6.2 decidim-admin/app/forms/decidim/admin/feature_form.rb
decidim-admin-0.6.1 app/forms/decidim/admin/feature_form.rb
decidim-0.6.1 decidim-admin/app/forms/decidim/admin/feature_form.rb
decidim-admin-0.6.0 app/forms/decidim/admin/feature_form.rb
decidim-0.6.0 decidim-admin/app/forms/decidim/admin/feature_form.rb