Show More
Commit Description:
add more error message to user list upgrade. Fix #9
Commit Description:
add more error message to user list upgrade. Fix #9
References:
File last commit:
Show/Diff file:
Action:
app/controllers/site_controller.rb | 67 lines | 1.6 KiB | text/x-ruby | RubyLexer |
jittat
[web] site start/stop supports...
r123 class SiteController < ApplicationController
change depricated before_filter to before_action
r745 before_action :site_admin_authorization, :except => 'login'
jittat
MERGED 308:HEAD from http://theory.cpe.ku.ac.th/grader/web/branches/ytopc08-2/, removed some registration info...
r162
def login
# Site administrator login
change find(:xxx) to correct syntax for rails 4
r619 @countries = Country.includes(:sites).all
jittat
MERGED 308:HEAD from http://theory.cpe.ku.ac.th/grader/web/branches/ytopc08-2/, removed some registration info...
r162 @country_select = @countries.collect { |c| [c.name, c.id] }
@country_select_with_all = [['Any',0]]
@countries.each do |country|
@country_select_with_all << [country.name, country.id]
end
@site_select = []
@countries.each do |country|
country.sites.each do |site|
@site_select << ["#{site.name}, #{country.name}", site.id]
end
end
Jittat Fakcharoenphol
renamed model Configuration to GraderConfiguration, renamed rhtml views to erb, fixed other small errors
r320 @default_site = Site.first if !GraderConfiguration['contest.multisites']
jittat
MERGED 308:HEAD from http://theory.cpe.ku.ac.th/grader/web/branches/ytopc08-2/, removed some registration info...
r162
render :action => 'login', :layout => 'empty'
end
jittat
[web] site start/stop supports...
r123
def index
if @site.started
render :action => 'started', :layout => 'empty'
else
render :action => 'prompt', :layout => 'empty'
end
end
def start
@site.started = true
@site.start_time = Time.new.gmtime
@site.save
redirect_to :action => 'index'
end
jittat
[web] download through apache, sites highlight, logout for site admin...
r133 def logout
reset_session
redirect_to :controller => 'main', :action => 'login'
end
jittat
[web] site start/stop supports...
r123 protected
def site_admin_authorization
if session[:site_id]==nil
jittat
MERGED 308:HEAD from http://theory.cpe.ku.ac.th/grader/web/branches/ytopc08-2/, removed some registration info...
r162 redirect_to :controller => 'site', :action => 'login' and return
jittat
[web] site start/stop supports...
r123 end
begin
@site = Site.find(session[:site_id], :include => :country)
rescue ActiveRecord::RecordNotFound
@site = nil
end
if @site==nil
jittat
MERGED 308:HEAD from http://theory.cpe.ku.ac.th/grader/web/branches/ytopc08-2/, removed some registration info...
r162 redirect_to :controller => 'site', :action => 'login' and return
jittat
[web] site start/stop supports...
r123 end
end
switch to strong parameter for mass update (have not finished the problem controller yet)
r617 private
def site_params
params.require(:site).permit()
end
jittat
[web] site start/stop supports...
r123 end