lespoupeesrusses/promethee

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

Summary

Maintainability
Test Coverage
<%
  init = <<~JAVASCRIPT
    promethee.definitions.push({
      name: 'Collection',
      icon: #{ promethee_component_render_icon 'collection' },
      position: 20,
      library: true,
      data: {
        type: 'collection',
        attributes: {
          items_per_line: {
            collection: [
              { label: '2', value: 2 },
              { label: '3', value: 3 },
              { label: '4', value: 4 },
              { label: '6', value: 6 }
            ],
            searchable: false,
            translatable: false,
            type: 'enum',
            value: 6
          }
        },
        children: []
      }
    })
  JAVASCRIPT
%>
<div ng-init="<%= init %>"></div>