Sha256: 1f877556d44600b85bc723ad3e3cca228ee59d99752e65b6d7696dd5fb888872

Contents?: true

Size: 1.06 KB

Versions: 69

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    module Admin
      # This class holds a Form to update meeting agenda items
      class MeetingAgendaItemsForm < Decidim::Form
        include TranslatableAttributes

        translatable_attribute :title, String
        translatable_attribute :description, String

        attribute :duration, Integer, default: 0
        attribute :parent_id, Integer
        attribute :position, Integer
        attribute :deleted, Boolean, default: false
        attribute :agenda_item_children, Array[MeetingAgendaItemsForm]

        validates :title, translatable_presence: true, unless: :deleted
        validates :position, numericality: { greater_than_or_equal_to: 0 }, unless: :deleted
        validates :duration, presence: true, numericality: { greater_than_or_equal_to: 0 }

        def to_param
          return id if id.present?

          "meeting-agenda-item-id"
        end

        def to_param_child
          return id if id.present?

          "meeting-agenda-item-child-id"
        end
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
decidim-meetings-0.29.1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.28.4 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.27.9 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.29.0 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.28.3 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.27.8 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.29.0.rc4 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.29.0.rc3 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.29.0.rc2 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.29.0.rc1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.28.2 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.27.7 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.28.1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.27.6 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.26.10 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.26.9 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.28.0 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.27.5 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.28.0.rc5 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.28.0.rc4 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb