Sha256: b524f7048ea146cd8d1a0f00c5de88443d14d2d830fee6fc9f31afa71ca76bda
Contents?: true
Size: 784 Bytes
Versions: 1
Compression:
Stored size: 784 Bytes
Contents
# frozen_string_literal: true module Decidim module ParticipatoryDocuments module Admin class DocumentForm < Decidim::Form include Decidim::HasUploadValidations include Decidim::TranslatableAttributes mimic :document translatable_attribute :title, String translatable_attribute :description, String attribute :box_color, String, default: "#1e98d7" attribute :box_opacity, Integer, default: 12 attribute :file attribute :remove_file, Boolean, default: false # ensure color and opacity are present def map_model(doc) self.box_color = doc.box_color.presence || "#1e98d7" self.box_opacity = doc.box_opacity.presence || 12 end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
decidim-participatory_documents-0.2.0 | app/forms/decidim/participatory_documents/admin/document_form.rb |