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.10.1 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.10.0 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.9.3 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.9.2 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.9.1 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.9.0 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.8.4 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.8.3 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.8.2 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.8.1 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.8.0 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.7.4 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.7.3 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.7.2 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.7.1 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.7.0 app/forms/decidim/admin/feature_form.rb
decidim-admin-0.6.8 app/forms/decidim/admin/feature_form.rb
decidim-0.6.8 decidim-admin/app/forms/decidim/admin/feature_form.rb
decidim-admin-0.6.7 app/forms/decidim/admin/feature_form.rb
decidim-0.6.7 decidim-admin/app/forms/decidim/admin/feature_form.rb