|
|
|
@ -21,13 +21,7 @@ class WelcomeController < ApplicationController
|
|
|
|
|
before_filter :entry_select_course, :entry_select_contest, :entry_select_user, :only => [:index]
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
projectActive = Project.project_entities.active
|
|
|
|
|
@projectCount = projectActive.count
|
|
|
|
|
@projectPublicCount = projectActive.all_public.count
|
|
|
|
|
@projectHidenCount = @projectCount - @projectPublicCount
|
|
|
|
|
|
|
|
|
|
@developerCount = User.developer.count
|
|
|
|
|
@allUsercount = User.count
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def robots
|
|
|
|
@ -36,10 +30,7 @@ class WelcomeController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def course
|
|
|
|
|
@courseCount = Project.course_entities.count
|
|
|
|
|
@teacherCount = User.teacher.count
|
|
|
|
|
@studentCount = User.student.count
|
|
|
|
|
@logoLink = logolink()
|
|
|
|
|
@logoLink ||= logolink()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -121,25 +112,25 @@ class WelcomeController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def render(*args)
|
|
|
|
|
_fake if @fake_filter
|
|
|
|
|
super
|
|
|
|
|
end
|
|
|
|
|
# def render(*args)
|
|
|
|
|
# _fake if @fake_filter
|
|
|
|
|
# super
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
# private
|
|
|
|
|
|
|
|
|
|
def fake
|
|
|
|
|
@fake_filter = true
|
|
|
|
|
end
|
|
|
|
|
# def fake
|
|
|
|
|
# @fake_filter = true
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
# 骗子方法
|
|
|
|
|
def _fake
|
|
|
|
|
instance_variables.map { |variable|
|
|
|
|
|
if variable.to_s =~ /Count$/
|
|
|
|
|
self.instance_variable_set(variable.to_sym,
|
|
|
|
|
("1" + (self.instance_variable_get(variable.to_sym).to_s)).to_i)
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
# # 骗子方法
|
|
|
|
|
# def _fake
|
|
|
|
|
# instance_variables.map { |variable|
|
|
|
|
|
# if variable.to_s =~ /Count$/
|
|
|
|
|
# self.instance_variable_set(variable.to_sym,
|
|
|
|
|
# ("1" + (self.instance_variable_get(variable.to_sym).to_s)).to_i)
|
|
|
|
|
# end
|
|
|
|
|
# }
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|