fix the user.trustie.net

This commit is contained in:
xianbo 2014-04-01 16:40:55 +08:00
parent e4939bca2c
commit 5d77381bb9
2 changed files with 19 additions and 23 deletions

View File

@ -17,7 +17,7 @@
class WelcomeController < ApplicationController
caches_action :robots
before_filter :entry_select_course, :entry_select_contest, :only => [:index]
before_filter :entry_select_course, :entry_select_contest, :entry_select_user, :only => [:index]
def index
# @news = News.latest User.current
@ -124,4 +124,11 @@ class WelcomeController < ApplicationController
return 0
end
end
def entry_select_user
if request.original_url.match(/user\.trustie\.net/)
redirect_to(:controller => "users", :action => "index")
return 0
end
end
end

View File

@ -1,43 +1,32 @@
<%
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
realUrl = request.original_url
if (realUrl.match(/project\/course/))
@nav_dispaly_course_label = 1
elsif (realUrl.match(/users/))
if (realUrl.match(/users/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
elsif (realUrl.match(/projects/))
@nav_dispaly_project_label = 1
elsif (realUrl.match(/contest/))
@nav_dispaly_contest_label = 1
elsif (realUrl.match(/calls/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_bid_label = 1
elsif (realUrl.match(/forums/))
@nav_dispaly_forum_label = 1
elsif (realUrl.match(/[^forge]\/course[^\.]/))
@nav_dispaly_course_label = 1
elsif (realUrl.match(/forge\.trustie\.net\/*/))
@nav_dispaly_project_label = 1
@nav_dispaly_contest_label = 1
elsif (realUrl.match(/course\.trustie\.net/))
@nav_dispaly_forum_label = 1
elsif (realUrl.match(/course\.trustie\.net\/*/))
@nav_dispaly_course_all_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_store_all_label = 1
elsif (realUrl.match(/user\.trustie\.net/))
elsif (realUrl.match(/user\.trustie\.net\/*/))
@nav_dispaly_home_path_label = 1
@nav_dispaly_course_all_label = 1
@nav_dispaly_project_label = 1
elsif (realUrl.match(/forge\.trustie\.net/))
@nav_dispaly_project_label = 1
@nav_dispaly_user_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
else
@nav_dispaly_course_label = 1
@nav_dispaly_project_label = 1
@nav_dispaly_user_label = 1
@nav_dispaly_contest_label = 1
@nav_dispaly_bid_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_home_path_label = 1
@nav_dispaly_main_course_label = 1
@nav_dispaly_main_project_label = 1
end
%>
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">