Sha256: b8a91d0d2a455b7b4e8ac62f74a6bf0a2c533120365a18c58c8cd8042dc67b58

Contents?: true

Size: 672 Bytes

Versions: 13

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Helper related to organization' setting :rich_text_editor_in_public_views.
  module RichTextEditorHelper
    def self.included(base)
      base.include Decidim::SanitizeHelper
    end

    delegate :rich_text_editor_in_public_views?, to: :current_organization

    def text_editor_for(form, attribute, options = {})
      if rich_text_editor_in_public_views?
        options[:lines] ||= 25
        options[:context] ||= "participant"
        form.editor attribute, options
      else
        options.delete(:hashtaggable)
        options[:rows] ||= 10
        form.text_area attribute, options
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.28.4 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.29.0 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.28.3 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.29.0.rc4 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.29.0.rc3 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.29.0.rc2 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.29.0.rc1 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.28.2 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.28.1 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.28.0 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.28.0.rc5 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.28.0.rc4 app/helpers/decidim/rich_text_editor_helper.rb