= render partial: 'menu'


  / .small-6.medium-4.large-3.cell
  /   // Search form
  /   = render 'packages/searchfield'

- if @logs
  // Paginator
  .grid-x
    .small-6.medium-8.large-9.cell
      // Paginator
      = render(partial: 'packages/paginator', locals: {items: @logs})

  table
    thead
      tr 
        th Time
        th Message
        / th Level
        th Section
        th Package
        th Screenshot
        th User
        th IP
    tbody 
      - @logs.each do |log|
        tr 
          td #{log.created_at}
          td #{log.message}
          / td #{log.level}
          td #{log.section}
          td
            - if log.package
              = link_to log.package.name, log.package
            - else 
              ' -
          td
            - if log.screenshot
              = link_to log.screenshot.id, package_path(log.package, highlight: log.screenshot.id)
            - else 
              ' -
          td 
            - if log.user
              = log.user.to_s
            - else 
              ' -
          td #{log.ip_address}

  .grid-x
    .small-6.medium-8.large-9.cell
      // Paginator
      = render(partial: 'packages/paginator', locals: {items: @logs})


- else 
  p Nothing here.

/ // Grid view of packages
/ .grid-x
/   .small-9.large-10.cell
/     - if @packages.any?
/       - if @view_style==:grid
/         .grid-x.grid-margin-x.small-up-1.medium-up-2.large-up-3 data-equalizer=true data-equalize-on="medium"
/           - @packages.all.each do |pkg|
/             .cell.pkgcard data-equalizer-watch=true
/               a.black href=package_path(name: pkg.name)
/                 .image
/                   / This leads to an N+1 SQL query for each image. Ideas for optimization welcome.
/                   = small_img(pkg.screenshots.accessible_by(current_ability, :view).first, cls: '')
/                 .text.pkgname
/                   = pkg.name
/                 .text
/                   = pkg.description