Sha256: 52182d6d433e85d6535323672475384ee1fddaed498fbfa629a57dd66a9a6d89

Contents?: true

Size: 730 Bytes

Versions: 22

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # A form object used to create participatory process groups from the admin
    # dashboard.
    #
    class ParticipatoryProcessGroupForm < Form
      include TranslatableAttributes

      translatable_attribute :name, String
      translatable_attribute :description, String
      attribute :participatory_process_ids, Array[Integer]

      mimic :participatory_process_group

      attribute :hero_image

      validates :name, :description, translatable_presence: true

      validates :hero_image, file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } }, file_content_type: { allow: ["image/jpeg", "image/png"] }
    end
  end
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
decidim-admin-0.5.1 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.5.1 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.5.0 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.5.0 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.4.4 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.4.4 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.4.3 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.4.2 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.4.1 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.4.3 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.4.2 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.4.1 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.4.0 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.4.0 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.3.2 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.3.2 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.3.1 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.3.1 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb
decidim-admin-0.3.0 app/forms/decidim/admin/participatory_process_group_form.rb
decidim-0.3.0 decidim-admin/app/forms/decidim/admin/participatory_process_group_form.rb