ujh/fountainpencompanion

View on GitHub
app/views/admins/brand_clusters/index.html.slim

Summary

Maintainability
Test Coverage
div class="fpc-table fpc-table--full-width fpc-scroll-shadow"
  table class="table"
    thead
      tr class="table-secondary"
        th colspan="2" scope="colgroup" Brand cluster
        th colspan="4" scope="colgroup" Macro cluster
      tr class="table-secondary"
        th scope="col" ID
        th scope="col" Name
        th scope="col" ID
        th scope="col" Brand
        th scope="col" Line
        th scope="col" Ink
    tbody
      - @brand_clusters.each_with_index do |brand_cluster, i|
        tr class="#{i % 2 != 0 ? "table-secondary" : ""}"
          td rowspan=brand_cluster.macro_clusters.length = brand_cluster.id
          td rowspan=brand_cluster.macro_clusters.length = brand_cluster.name
          - brand_cluster.macro_clusters.sort_by(&:name).each_with_index do |macro_cluster, j|
              - if j != 0
                tr class="#{i % 2 != 0 ? "table-secondary" : ""}"
                  td= macro_cluster.id
                  td= macro_cluster.brand_name
                  td= macro_cluster.line_name
                  td= macro_cluster.ink_name
              - else
                td= macro_cluster.id
                td= macro_cluster.brand_name
                td= macro_cluster.line_name
                td= macro_cluster.ink_name