2014-03-23 00:22:25 +00:00
|
|
|
class RoundsController < ApplicationController
|
|
|
|
def index
|
|
|
|
sort = case params['sort']
|
|
|
|
when "start" then "start"
|
|
|
|
when "server" then "server_id"
|
|
|
|
when "team1" then "team1_id"
|
|
|
|
when "team2" then "team2_id"
|
|
|
|
when "map" then "map_name"
|
|
|
|
when "commander" then "commander_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
@rounds = Round.basic.paginate \
|
2014-03-31 21:33:16 +00:00
|
|
|
order: sort,
|
|
|
|
page: params[:page],
|
|
|
|
per_page: 30
|
2014-03-23 00:22:25 +00:00
|
|
|
|
|
|
|
if params[:ajax]
|
2014-03-31 21:33:16 +00:00
|
|
|
render partial: 'list', layout: false
|
2014-03-23 00:22:25 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
@round = Round.find(params[:id])
|
|
|
|
end
|
|
|
|
end
|