Sha256: e0b37546b7315b14b1d3e006c598bce2862df94e6528c9c9e13f1bc4fad1a78c

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

/ Example:
/ = wcms_component "forms/presentation_data_editor",
/   form: f,
/   schema: @generic_object.presentation_data_template.schema,
/   presentation_data: @generic_object.presentation_data
/

ruby:
  if form ||= nil
    schema ||= form.object.presentation_data_template.try(:schema)
    presentation_data ||= form.object.presentation_data
  end

  schema ||= []
  presentation_data ||= {}
  embedded_image_url ||= wcms_components_embedded_images_url

= wcms_component "shared/embedded_image_uploader",
  embedded_image_url: embedded_image_url


/ Link to toggle between simple and advanced editors
- if current_user.try(:admin?)
  - if params[:edit_raw_data] == 'true'
      = link_to('Simple Editor', params.merge(edit_raw_data: nil), class: 'pull-right')
  - else
      = link_to('Edit Raw Data', params.merge(edit_raw_data: true), class: 'pull-right')
  .clearfix


- if params[:edit_raw_data] == 'true' && current_user.try(:admin?)
  / Render JSON editor
  = wcms_component 'forms/json_editor',
    form: form,
    attribute: :presentation_data_json

- else
  / Render HTML for presentation data editor
  = PresentationDataEditor.new(self, presentation_data, schema, form).render

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
biola_wcms_components-0.15.3 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.15.2 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.15.1 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.15.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.14.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.13.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.12.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.11.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.10.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.9.1 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.9.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.8.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.7.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.6.1 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.6.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim
biola_wcms_components-0.5.0 app/views/wcms_components/forms/_presentation_data_editor.html.slim