Sha256: 73ced64c665d23cb5e1bbf8fd473596d908a47afcccbf719ae71027739bfe5e5

Contents?: true

Size: 884 Bytes

Versions: 13

Compression:

Stored size: 884 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Conferences
    module Admin
      # A form object used to update conference diploma configuration
      # from the admin dashboard
      #
      class DiplomaForm < Form
        mimic :conference

        attribute :main_logo
        attribute :signature
        attribute :signature_name, String
        attribute :sign_date, Decidim::Attributes::LocalizedDate

        validates :signature_name, :sign_date, :main_logo, :signature, presence: true

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-conferences-0.22.0 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.21.0 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.20.1 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.20.0 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.19.1 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.18.1 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.19.0 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.17.2 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.18.0 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.17.1 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.16.1 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.17.0 app/forms/decidim/conferences/admin/diploma_form.rb
decidim-conferences-0.16.0 app/forms/decidim/conferences/admin/diploma_form.rb