rx/presenters

View on GitHub
views/mdc/components/content.erb

Summary

Maintainability
Test Coverage
<%
  require_relative "drag_and_drop/drag_and_drop"
  if comp
     position_classes = comp.position.map {|p| "v-content-position-#{p}"}.join(' ')
%>
  <div id="<%= comp.id %>"
       <% if comp.tag %>
       data-input-tag="<%= comp.tag %>"
       <% end %>
       <%= draggable_attributes(comp) %>
       <%= drop_zone_attributes(comp) %>
       class="v-content
            <%= position_classes %>
            <%= _padding_classes_(comp.padding) %>
            <%= 'v-hidden' if comp.hidden %>
            <%= 'v-dnd-draggable' if comp.draggable %>
            <%= comp.float  ? 'v-content--float' : 'v-content--relative'%>
            <%= comp.css_class.join(' ') %>
            <%= color_classname(comp, 'background-', :background_color)%>"
     <%= erb :"components/event", :locals => {comp: comp, events: comp.events, parent_id: comp.event_parent_id} %>
       style="text-align: <%= comp.text_align %>;
             <%= "display: inline-block;" if comp.inline %>
             <%= "width: #{comp.width};" if comp.width %>
             <%= "height : #{comp.height };" if comp.height  %>
             <%= color_style(comp, 'background-', :background_color) %>"
       data-is-container>
    <%= erb(:"components/progress", :locals => {:comp => comp.progress}) if comp.progress && includes_one?(Array(comp.progress.position), %i(top both)) %>
    <% if comp.shows_errors %>
      <div class="v-errors">
    <% end %>
    <%= erb :"components/render", :locals => {:components => comp.components, :scope => nil} %>
    <% if comp.shows_errors %>
      </div>
    <% end %>
    <%= erb(:"components/progress", :locals => {:comp => comp.progress}) if comp.progress && includes_one?(Array(comp.progress.position), %i(bottom both)) %>
  </div>
<% end %>