Sha256: 2e76fc9a6588f747cdfcc5dddf2fdce3a7f3b4ba4addeced7e08dca40000d2ef

Contents?: true

Size: 628 Bytes

Versions: 46

Compression:

Stored size: 628 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
        form.editor attribute, options
      else
        options.delete(:hashtaggable)
        options[:rows] ||= 10
        form.text_area attribute, options
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.8 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.7 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.6 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.26.10 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.26.9 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.5 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.26.8 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.4 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.3 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.26.7 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.26.5 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.2 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.1 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.26.4 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.0 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.26.3 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.0.rc2 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.27.0.rc1 app/helpers/decidim/rich_text_editor_helper.rb
decidim-core-0.26.2 app/helpers/decidim/rich_text_editor_helper.rb