rx/presenters

View on GitHub
views/mdc/components/list/header.erb

Summary

Maintainability
Test Coverage
<li class="mdc-list-item
           v-list-item--header
           v-list-item--selectable-header"
    id="<%= line.id %>">
  <div class="v-input v-checkbox v-hidden">
    <input class="mdc-checkbox__native-control" type="checkbox" id="select-total" name="all" value="true" data-indeterminate="false"/>
  </div>
  <%= erb :"components/checkbox", :locals => {:comp => line.checkbox, :class_name => 'v-checkbox--select-control', :dirtyable => false} if line.checkbox %>
  <span class="mdc-list-item__text">
    <%= expand_text(line.text&.text) %>

    <% if line.subtitle %>
      <span class="mdc-list-item__secondary-text">
        <%= expand_text(line.subtitle.text) %>
      </span>
    <% end %>

    <% if line.body %>
      <span class="mdc-list-item__secondary-text">
        <%= expand_text(line.body.text) %>
      </span>
    <% end %>
  </span>
</li>

<% if line.total_lines > 0 %>
  <li class="mdc-list-item hidden" id="list-item-select-all-header">
    <span class="mdc-list-item__secondary-text" id="list-item-select-all-toggle-off">
      All <span id="page-selection-count">10</span> records on this page are selected. <a href="#" class="toggle-total-set" data-select="on">Select all <%= line.total_lines %> records.</a>
    </span>
    <span class="mdc-list-item__secondary-text hidden" id="list-item-select-all-toggle-on">
      All <%= line.total_lines %> records selected. <a href="#" class="toggle-total-set" data-select="off">Clear selection</a>
    </span>
  </li>
<% end %>

<li role="separator" class="mdc-list-divider"></li>