lespoupeesrusses/promethee

View on GitHub
app/views/promethee/components/collection_item/_edit_define.html.erb

Summary

Maintainability
Test Coverage
<%
  init = <<~JAVASCRIPT
    promethee.definitions.push({
      name: 'Collection Item',
      icon: #{ promethee_component_render_icon 'collection_item' },
      position: 15,
      library: false,
      data: {
        type: 'collection_item',
        attributes: {
          caption: {
            searchable: true,
            translatable: true,
            type: 'text',
            value: ''
          },
          media_type: {
            collection: [
              { label: 'Image', value: 'image' },
              { label: 'Video', value: 'video' }
            ],
            searchable: false,
            translatable: false,
            type: 'enum',
            value: 'image'
          },
          image: {
            searchable: false,
            translatable: false,
            type: 'blob',
            value: {
              id: undefined,
              name: ''
            }
          },
          video: {
            searchable: false,
            translatable: true,
            type: 'video',
            value: 'https://vimeo.com/115082758'
          }
        }
      }
    })
  JAVASCRIPT
%>
<div ng-init="<%= init %>"></div>