Sha256: f4e2fe36553cb02fa63c9746727fd14f1be2f3664df23a1420a5e5243400380e

Contents?: true

Size: 1 KB

Versions: 16

Compression:

Stored size: 1 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
          id || "meeting-agenda-item-id"
        end

        def to_param_child
          id || "meeting-agenda-item-child-id"
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-meetings-0.16.1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.16.0 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.15.2 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.15.1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.15.0 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.14.4 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.14.3 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.14.2 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.14.1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.13.1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.12.2 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.13.0 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.12.1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.13.0.pre1 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.12.0 app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb
decidim-meetings-0.12.0.pre app/forms/decidim/meetings/admin/meeting_agenda_items_form.rb