EagerELK/ditty

View on GitHub
views/user_login_traits/index.haml

Summary

Maintainability
Test Coverage
.row
  .col-md-12
    = haml :'partials/search'
    .card.card-default.shadow.table-responsive
      %table.table.table-striped.table-bordered.table-hover.mb-0
        %thead.thead-dark
          %tr
            %th= "User #{sort_ui(:user_id)}"
            %th= "IP Address #{sort_ui(:ip_address)}"
            %th= "Device #{sort_ui(:device)}"
            %th= "Platform #{sort_ui(:platform)}"
            %th= "Browser #{sort_ui(:browser)}"
            %th= "Last Seen #{sort_ui(:updated_at)}"
        %tbody
          - if list.count.positive?
            - list.all.each do |entity|
              %tr
                %td= entity.user&.email || 'Unknown'
                %td
                  %a{ href: "#{base_path}/#{entity.display_id}" }= entity.ip_address || 'Unknown'
                %td= entity.device || 'Unknown'
                %td= entity.platform || 'Unknown'
                %td= entity.browser || 'Unknown'
                %td= entity.updated_at
          - else
            %tr
              %td.text-center{ colspan: 6 } No records

      - if list.count > 0
        .card-body
          = pagination(list, base_path)