- content_for(:title) { "recent reservations" }

%h2 Recent reservations

.row
  .col-md-12
    = will_paginate @recent_reservations

.row
  .col-md-12

    %table.table.table-condensed.table-hover
      %thead
        %tr
          %th Server
          %th Reserved by
          %th Reserved from
          %th Reserved until
          - if current_admin || current_streamer
            %th Actions
      %tbody
        - @recent_reservations.each do |reservation|
          - klass = 'table-success' if reservation.active?
          - klass = 'table-info'    if reservation.future?
          %tr[reservation]{:class => klass}
            - server = reservation.server.decorate
            - user = reservation.user.decorate
            %td= server.name
            %td= link_to(user.nickname, user.steam_profile_url, :target => "_blank")
            %td= I18n.l(reservation.starts_at,  :format => :short)
            %td= I18n.l(reservation.ends_at,    :format => :short)
            - if current_admin || current_streamer
              %td.actions= render 'reservations/actions', :reservation => reservation

- content_for(:title) { "recent reservations" }

%h2 Recent reservations

.row
  .col-md-12
    = will_paginate @recent_reservations

.row
  .col-md-12

    %table.table.table-condensed.table-hover
      %thead
        %tr
          %th Server
          %th Reserved by
          %th Reserved from
          %th Reserved until
          - if current_admin || current_streamer
            %th Actions
      %tbody
        - @recent_reservations.each do |reservation|
          - klass = 'table-success' if reservation.active?
          - klass = 'table-info'    if reservation.future?
          %tr[reservation]{:class => klass}
            - user = reservation.user.decorate
            - if reservation.server
              - server = reservation.server.decorate
              %td= server.name
            - else
              %td &nbsp;
            %td= link_to(user.nickname, user.steam_profile_url, :target => "_blank")
            %td= I18n.l(reservation.starts_at,  :format => :short)
            %td= I18n.l(reservation.ends_at,    :format => :short)
            - if current_admin || current_streamer
              %td.actions= render 'reservations/actions', :reservation => reservation

Allow reservations to have no server yet
Allow reservations to have no server yet
