Dalphi/dalphi

View on GitHub
app/views/interfaces/index.slim

Summary

Maintainability
Test Coverage
.container.interfaces
  .row.row-eq-height

    - if @interfaces.any?
      - @interfaces.each do |interface_type, interfaces|
        = render 'interfaces/shared/card',
                 xl_size: @interfaces.count <= 4 ? 12 / @interfaces.count : 3,
                 interfaces: interfaces,
                 interface_type: interface_type

    - else
      .col-xs-12
        .jumbotron
          h1.display-3
            = t('interfaces.blank-slate.title')
          p.lead
            = t('interfaces.blank-slate.text', link: '')
          hr.m-y-2
          = render 'shared/button',
                   href: new_interface_path,
                   type: 'primary',
                   label: t('activerecord.actions.interface.new'),
                   icon: 'plus'

  .row.btn-row
    .col-xs-12
      = render 'shared/button',
               type: 'back'
      - if @interfaces.any?
        = render 'shared/button',
                 href: new_interface_path,
                 type: 'primary',
                 label: t('activerecord.actions.interface.new'),
                 icon: 'plus'