Module: Pageflow::Admin::WidgetsHelper

Defined in:
app/helpers/pageflow/admin/widgets_helper.rb

Overview

Since:

  • 12.2

Instance Method Summary collapse

Instance Method Details

#admin_widget_types_collection_for_role(config, role) ⇒ Object

Since:

  • 12.2



11
12
13
14
15
# File 'app/helpers/pageflow/admin/widgets_helper.rb', line 11

def admin_widget_types_collection_for_role(config, role)
  config.widget_types.find_all_by_role(role).each_with_object({}) do |widget_type, result|
    result[I18n.t(widget_type.translation_key)] = widget_type.name
  end
end

#admin_widgets_fields(form, config) ⇒ Object

Since:

  • 12.2



4
5
6
7
8
9
# File 'app/helpers/pageflow/admin/widgets_helper.rb', line 4

def admin_widgets_fields(form, config)
  render('pageflow/admin/widgets/fields',
         widgets: form.object.widgets.resolve(config, include_placeholders: true),
         form: form,
         config: config)
end